Performance: Load tags UI (and initialize configuration folder/cache) on when it's needed
This commit is contained in:
parent
6fc46f6823
commit
ffdc0454e0
2 changed files with 25 additions and 23 deletions
|
@ -79,10 +79,6 @@ class kolab_tags extends rcube_plugin
|
|||
return;
|
||||
}
|
||||
|
||||
if ($this->rc->action == 'print') {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($engine = $this->engine()) {
|
||||
$engine->ui();
|
||||
}
|
||||
|
|
|
@ -47,26 +47,32 @@ class kolab_tags_engine
|
|||
public function ui()
|
||||
{
|
||||
// set templates of Files UI and widgets
|
||||
if ($this->rc->task == 'mail') {
|
||||
$this->plugin->add_texts('localization/');
|
||||
|
||||
$this->plugin->include_stylesheet($this->plugin->local_skin_path().'/style.css');
|
||||
$this->plugin->include_script('kolab_tags.js');
|
||||
$this->rc->output->add_label('cancel', 'save');
|
||||
$this->plugin->add_label('tags', 'add', 'edit', 'delete', 'saving',
|
||||
'nameempty', 'nameexists', 'colorinvalid', 'untag', 'tagname',
|
||||
'tagcolor', 'tagsearchnew', 'newtag');
|
||||
|
||||
$this->rc->output->add_handlers(array(
|
||||
'plugin.taglist' => array($this, 'taglist'),
|
||||
));
|
||||
|
||||
$ui = $this->rc->output->parse('kolab_tags.ui', false, false);
|
||||
$this->rc->output->add_footer($ui);
|
||||
|
||||
// load miniColors
|
||||
jqueryui::miniColors();
|
||||
if ($this->rc->task != 'mail') {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($this->rc->action && !in_array($this->rc->action, array('show', 'preview'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->plugin->add_texts('localization/');
|
||||
|
||||
$this->plugin->include_stylesheet($this->plugin->local_skin_path().'/style.css');
|
||||
$this->plugin->include_script('kolab_tags.js');
|
||||
$this->rc->output->add_label('cancel', 'save');
|
||||
$this->plugin->add_label('tags', 'add', 'edit', 'delete', 'saving',
|
||||
'nameempty', 'nameexists', 'colorinvalid', 'untag', 'tagname',
|
||||
'tagcolor', 'tagsearchnew', 'newtag');
|
||||
|
||||
$this->rc->output->add_handlers(array(
|
||||
'plugin.taglist' => array($this, 'taglist'),
|
||||
));
|
||||
|
||||
$ui = $this->rc->output->parse('kolab_tags.ui', false, false);
|
||||
$this->rc->output->add_footer($ui);
|
||||
|
||||
// load miniColors
|
||||
jqueryui::miniColors();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue