From 9ce89482942a4865cbdca4b28a83e9a6a3e1ba1a Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Mon, 20 Nov 2017 14:03:07 +0100 Subject: [PATCH] Get rid of the 2nd argument of include_stylesheet() .. make the optional behavior default now. --- plugins/acl/acl.php | 2 +- plugins/archive/archive.php | 4 ++-- plugins/enigma/lib/enigma_ui.php | 2 +- plugins/help/help.php | 2 +- plugins/hide_blockquote/hide_blockquote.php | 2 +- plugins/managesieve/managesieve.php | 4 ++-- plugins/markasjunk/markasjunk.php | 2 +- plugins/vcard_attachments/vcard_attachments.php | 6 +++--- plugins/zipdownload/zipdownload.php | 2 +- program/lib/Roundcube/rcube_plugin.php | 5 ++--- program/lib/Roundcube/rcube_plugin_api.php | 7 +++---- 11 files changed, 18 insertions(+), 20 deletions(-) diff --git a/plugins/acl/acl.php b/plugins/acl/acl.php index d9eb7afb0a4..1aa6b5ec488 100644 --- a/plugins/acl/acl.php +++ b/plugins/acl/acl.php @@ -177,7 +177,7 @@ function folder_form($args) $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'])) diff --git a/plugins/archive/archive.php b/plugins/archive/archive.php index 306ae05be3f..c6daed9017a 100644 --- a/plugins/archive/archive.php +++ b/plugins/archive/archive.php @@ -25,7 +25,7 @@ function init() $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 @@ function init() $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); diff --git a/plugins/enigma/lib/enigma_ui.php b/plugins/enigma/lib/enigma_ui.php index d2f01180052..fd76c2b44b1 100644 --- a/plugins/enigma/lib/enigma_ui.php +++ b/plugins/enigma/lib/enigma_ui.php @@ -125,7 +125,7 @@ function add_css() } $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; } diff --git a/plugins/help/help.php b/plugins/help/help.php index c8c3999d108..c00c69ba7fd 100644 --- a/plugins/help/help.php +++ b/plugins/help/help.php @@ -55,7 +55,7 @@ function startup($args) } // 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() diff --git a/plugins/hide_blockquote/hide_blockquote.php b/plugins/hide_blockquote/hide_blockquote.php index d8670bc6cb4..c29047115eb 100644 --- a/plugins/hide_blockquote/hide_blockquote.php +++ b/plugins/hide_blockquote/hide_blockquote.php @@ -26,7 +26,7 @@ function init() && ($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'); diff --git a/plugins/managesieve/managesieve.php b/plugins/managesieve/managesieve.php index 9c8f1b78b1e..c8241303cb2 100644 --- a/plugins/managesieve/managesieve.php +++ b/plugins/managesieve/managesieve.php @@ -85,10 +85,10 @@ function init_ui() // 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; diff --git a/plugins/markasjunk/markasjunk.php b/plugins/markasjunk/markasjunk.php index ba3cecfb30c..633ff67a65f 100644 --- a/plugins/markasjunk/markasjunk.php +++ b/plugins/markasjunk/markasjunk.php @@ -23,7 +23,7 @@ function init() 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', diff --git a/plugins/vcard_attachments/vcard_attachments.php b/plugins/vcard_attachments/vcard_attachments.php index 8db690c829a..e7791accc53 100644 --- a/plugins/vcard_attachments/vcard_attachments.php +++ b/plugins/vcard_attachments/vcard_attachments.php @@ -32,7 +32,7 @@ function init() $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 @@ function init() } 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 @@ function message_objects($p) 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; diff --git a/plugins/zipdownload/zipdownload.php b/plugins/zipdownload/zipdownload.php index 401a3094ebf..abc8782ea91 100644 --- a/plugins/zipdownload/zipdownload.php +++ b/plugins/zipdownload/zipdownload.php @@ -86,7 +86,7 @@ public function attachment_ziplink($p) break; } - $this->include_stylesheet($this->local_skin_path() . '/zipdownload.css', true); + $this->include_stylesheet($this->local_skin_path() . '/zipdownload.css'); } return $p; diff --git a/program/lib/Roundcube/rcube_plugin.php b/program/lib/Roundcube/rcube_plugin.php index 946be40a2fa..b112695fb29 100644 --- a/program/lib/Roundcube/rcube_plugin.php +++ b/program/lib/Roundcube/rcube_plugin.php @@ -354,10 +354,9 @@ public function include_script($fn) /** * 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); } diff --git a/program/lib/Roundcube/rcube_plugin_api.php b/program/lib/Roundcube/rcube_plugin_api.php index 89a6ad43021..bd95bdfafc9 100644 --- a/program/lib/Roundcube/rcube_plugin_api.php +++ b/program/lib/Roundcube/rcube_plugin_api.php @@ -604,13 +604,12 @@ public function include_script($fn) /** * 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');