Get rid of the 2nd argument of include_stylesheet()

.. make the optional behavior default now.
pull/6043/head
Aleksander Machniak 7 years ago
parent 1cf72fa2b6
commit 9ce8948294

@ -177,7 +177,7 @@ class acl extends rcube_plugin
$this->rc->output->add_label('save', 'cancel');
$this->include_script('acl.js');
$this->rc->output->include_script('list.js');
$this->include_stylesheet($this->local_skin_path() . '/acl.css', true);
$this->include_stylesheet($this->local_skin_path() . '/acl.css');
// add Info fieldset if it doesn't exist
if (!isset($args['form']['props']['fieldsets']['info']))

@ -25,7 +25,7 @@ class archive extends rcube_plugin
$archive_folder = $rcmail->config->get('archive_mbox');
if ($rcmail->task == 'mail' && ($rcmail->action == '' || $rcmail->action == 'show') && $archive_folder) {
$this->include_stylesheet($this->local_skin_path() . '/archive.css', true);
$this->include_stylesheet($this->local_skin_path() . '/archive.css');
$this->include_script('archive.js');
$this->add_texts('localization', true);
$this->add_button(
@ -59,7 +59,7 @@ class archive extends rcube_plugin
$this->add_hook('preferences_save', array($this, 'save_prefs'));
if ($rcmail->action == 'folders' && $archive_folder) {
$this->include_stylesheet($this->local_skin_path() . '/archive.css', true);
$this->include_stylesheet($this->local_skin_path() . '/archive.css');
$this->include_script('archive.js');
// set env variables for client
$rcmail->output->set_env('archive_folder', $archive_folder);

@ -125,7 +125,7 @@ class enigma_ui
}
$skin_path = $this->enigma->local_skin_path();
$this->enigma->include_stylesheet("$skin_path/enigma.css", true);
$this->enigma->include_stylesheet("$skin_path/enigma.css");
$this->css_loaded = true;
}

@ -55,7 +55,7 @@ class help extends rcube_plugin
}
// add style for taskbar button (must be here) and Help UI
$this->include_stylesheet($this->local_skin_path() . '/help.css', true);
$this->include_stylesheet($this->local_skin_path() . '/help.css');
}
function action()

@ -26,7 +26,7 @@ class hide_blockquote extends rcube_plugin
&& ($limit = $rcmail->config->get('hide_blockquote_limit'))
) {
// include styles
$this->include_stylesheet($this->local_skin_path() . "/style.css", true);
$this->include_stylesheet($this->local_skin_path() . "/style.css");
// Script and localization
$this->include_script('hide_blockquote.js');

@ -85,10 +85,10 @@ class managesieve extends rcube_plugin
// include styles
$skin_path = $this->local_skin_path();
if ($sieve_action || ($this->rc->task == 'settings' && empty($_REQUEST['_framed']))) {
$this->include_stylesheet("$skin_path/managesieve.css", true);
$this->include_stylesheet("$skin_path/managesieve.css");
}
else if ($this->rc->task == 'mail') {
$this->include_stylesheet("$skin_path/managesieve_mail.css", true);
$this->include_stylesheet("$skin_path/managesieve_mail.css");
}
$this->ui_initialized = true;

@ -23,7 +23,7 @@ class markasjunk extends rcube_plugin
if ($rcmail->action == '' || $rcmail->action == 'show') {
$this->add_texts('localization', true);
$this->include_script('markasjunk.js');
$this->include_stylesheet($this->local_skin_path() . '/markasjunk.css', true);
$this->include_stylesheet($this->local_skin_path() . '/markasjunk.css');
$this->add_button(array(
'type' => 'link',

@ -32,7 +32,7 @@ class vcard_attachments extends rcube_plugin
$btn_class = strpos($skin_path, 'classic') ? 'button' : 'listbutton';
$this->add_texts('localization', true);
$this->include_stylesheet($skin_path . '/style.css', true);
$this->include_stylesheet($skin_path . '/style.css');
$this->include_script('vcardattach.js');
$this->add_button(
array(
@ -48,7 +48,7 @@ class vcard_attachments extends rcube_plugin
}
else if (!$rcmail->output->framed && (!$rcmail->action || $rcmail->action == 'list')) {
$skin_path = $this->local_skin_path();
$this->include_stylesheet($skin_path . '/style.css', true);
$this->include_stylesheet($skin_path . '/style.css');
$this->include_script('vcardattach.js');
}
@ -123,7 +123,7 @@ class vcard_attachments extends rcube_plugin
if ($attach_script) {
$this->include_script('vcardattach.js');
$this->include_stylesheet($this->local_skin_path() . '/style.css', true);
$this->include_stylesheet($this->local_skin_path() . '/style.css');
}
return $p;

@ -86,7 +86,7 @@ class zipdownload extends rcube_plugin
break;
}
$this->include_stylesheet($this->local_skin_path() . '/zipdownload.css', true);
$this->include_stylesheet($this->local_skin_path() . '/zipdownload.css');
}
return $p;

@ -354,10 +354,9 @@ abstract class rcube_plugin
/**
* Make this stylesheet available on the client
*
* @param string $fn File path; absolute or relative to the plugin directory
* @param bool $if_exists Include the file only if exists
* @param string $fn File path; absolute or relative to the plugin directory
*/
public function include_stylesheet($fn, $if_exists = false)
public function include_stylesheet($fn)
{
$this->api->include_stylesheet($this->resource_url($fn), $if_exists);
}

@ -604,13 +604,12 @@ class rcube_plugin_api
/**
* Include a plugin stylesheet in the current HTML page
*
* @param string $fn Path to stylesheet
* @param bool $if_exists Include stylesheet only if the file exists
* @param string $fn Path to stylesheet
*/
public function include_stylesheet($fn, $if_exists = false)
public function include_stylesheet($fn)
{
if (is_object($this->output) && $this->output->type == 'html') {
if ($if_exists && $fn[0] != '/' && !preg_match('|^https?://|i', $fn)) {
if ($fn[0] != '/' && !preg_match('|^https?://|i', $fn)) {
$rcube = rcube::get_instance();
$devel_mode = $rcube->config->get('devel_mode');
$assets_dir = $rcube->config->get('assets_dir');

Loading…
Cancel
Save