summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2015-01-08 11:16:17 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2015-01-08 11:16:17 (GMT)
commit3af4b1c4f878b22d846485f17020fb364230b600 (patch)
tree2a1b20fdc425ce0fb7fe95c577bcb59f3ba35d9c /plugins
parent17f57ff7caa1ec36bb0c780a59b6f9e26644a156 (diff)
downloadroundcubemail-plugins-kolab-3af4b1c4f878b22d846485f17020fb364230b600.tar.gz
Fix performance issue by not loading tasklist settings when not needed (#3970)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/tasklist/tasklist_ui.php30
1 files changed, 17 insertions, 13 deletions
diff --git a/plugins/tasklist/tasklist_ui.php b/plugins/tasklist/tasklist_ui.php
index 922f295..1395148 100644
--- a/plugins/tasklist/tasklist_ui.php
+++ b/plugins/tasklist/tasklist_ui.php
@@ -32,34 +32,38 @@ class tasklist_ui
function __construct($plugin)
{
$this->plugin = $plugin;
- $this->rc = $plugin->rc;
+ $this->rc = $plugin->rc;
}
/**
- * Calendar UI initialization and requests handlers
- */
+ * Calendar UI initialization and requests handlers
+ */
public function init()
{
- if ($this->ready) // already done
+ if ($this->ready) {
return;
+ }
// add taskbar button
$this->plugin->add_button(array(
- 'command' => 'tasks',
- 'class' => 'button-tasklist',
- 'classsel' => 'button-tasklist button-selected',
+ 'command' => 'tasks',
+ 'class' => 'button-tasklist',
+ 'classsel' => 'button-tasklist button-selected',
'innerclass' => 'button-inner',
- 'label' => 'tasklist.navtitle',
+ 'label' => 'tasklist.navtitle',
), 'taskbar');
$this->plugin->include_stylesheet($this->plugin->local_skin_path() . '/tasklist.css');
- $this->plugin->include_script('tasklist_base.js');
- // copy config to client
- $this->rc->output->set_env('tasklist_settings', $this->load_settings());
+ if ($this->rc->task == 'mail' || $this->rc->task == 'tasks') {
+ $this->plugin->include_script('tasklist_base.js');
- // initialize attendees autocompletion
- $this->rc->autocomplete_init();
+ // copy config to client
+ $this->rc->output->set_env('tasklist_settings', $this->load_settings());
+
+ // initialize attendees autocompletion
+ $this->rc->autocomplete_init();
+ }
$this->ready = true;
}