summaryrefslogtreecommitdiff
path: root/plugins/managesieve
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-10-12 07:15:41 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-10-12 07:15:41 +0000
commitbfdecb4a8e47113dc0328966cebfd2ef5ee75a68 (patch)
treeace6370d1683008f13b9ebcdb8fa7abb41bcefc6 /plugins/managesieve
parent55e2bced29b6dc142786d313f1ffe65a70ea3270 (diff)
- Fixed "jumping" Filters tab
git-svn-id: https://svn.roundcube.net/trunk@5332 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'plugins/managesieve')
-rw-r--r--plugins/managesieve/managesieve.php37
1 files changed, 19 insertions, 18 deletions
diff --git a/plugins/managesieve/managesieve.php b/plugins/managesieve/managesieve.php
index 9d2be50c6..ff27486d9 100644
--- a/plugins/managesieve/managesieve.php
+++ b/plugins/managesieve/managesieve.php
@@ -63,12 +63,7 @@ class managesieve extends rcube_plugin
$this->register_action('plugin.managesieve-save', array($this, 'managesieve_save'));
if ($this->rc->task == 'settings') {
- // load localization
- $this->add_texts('localization/', array('filters','managefilters'));
-
- if (!strpos($this->rc->action, 'managesieve')) {
- $this->include_script('managesieve.js');
- }
+ $this->init_ui();
}
else if ($this->rc->task == 'mail') {
// register message hook
@@ -82,18 +77,30 @@ class managesieve extends rcube_plugin
}
/**
- * Add UI elements to the 'mailbox view' and 'show message' UI.
+ * Initializes plugin's UI (localization, js script)
*/
- function mail_task_handler()
+ private function init_ui()
{
+ if ($this->ui_initialized)
+ return;
+
// load localization
- $this->add_texts('localization/');
+ $this->add_texts('localization/', array('filters','managefilters'));
+ $this->include_script('managesieve.js');
+
+ $this->ui_initialized = true;
+ }
+ /**
+ * Add UI elements to the 'mailbox view' and 'show message' UI.
+ */
+ function mail_task_handler()
+ {
// use jQuery for popup window
$this->require_plugin('jqueryui');
- // include main js script
- $this->include_script('managesieve.js');
+ // include js script and localization
+ $this->init_ui();
// include styles
$skin = $this->rc->config->get('skin');
@@ -281,13 +288,7 @@ class managesieve extends rcube_plugin
function managesieve_actions()
{
- // load localization
- $this->add_texts('localization/', array('filters','managefilters'));
-
- // include main js script
- if ($this->api->output->type == 'html') {
- $this->include_script('managesieve.js');
- }
+ $this->init_ui();
$error = $this->managesieve_start();