Add Filters tab using plugin API hook
| | |
| | | - Nicely handle server-side modification of script names (#1489412) |
| | | - Add Filters tab/section using plugin API hook |
| | | |
| | | * version 7.1 [2013-11-22] |
| | | ----------------------------------------------------------- |
| | |
| | | else |
| | | rcmail.enable_command('managesieve-create', true); |
| | | } |
| | | else { |
| | | var tab = $('<span>').attr('id', 'settingstabpluginmanagesieve').addClass('tablink filter'), |
| | | button = $('<a>').attr('href', rcmail.env.comm_path+'&_action=plugin.managesieve') |
| | | .attr('title', rcmail.gettext('managesieve.managefilters')) |
| | | .html(rcmail.gettext('managesieve.filters')) |
| | | .appendTo(tab); |
| | | |
| | | // add tab |
| | | rcmail.add_element(tab, 'tabs'); |
| | | } |
| | | |
| | | if (rcmail.env.task == 'mail' || rcmail.env.action.startsWith('plugin.managesieve')) { |
| | | // Create layer for form tips |
| | |
| | | $this->register_action('plugin.managesieve-save', array($this, 'managesieve_save')); |
| | | |
| | | if ($this->rc->task == 'settings') { |
| | | $this->add_hook('settings_actions', array($this, 'settings_actions')); |
| | | $this->init_ui(); |
| | | } |
| | | else if ($this->rc->task == 'mail') { |
| | |
| | | } |
| | | |
| | | /** |
| | | * Adds Filters section in Settings |
| | | */ |
| | | function settings_actions($args) |
| | | { |
| | | // register as settings action |
| | | $args['actions'][] = array('action' => 'plugin.managesieve', 'class' => 'filter', 'label' => 'filters', 'domain' => 'managesieve'); |
| | | return $args; |
| | | } |
| | | |
| | | /** |
| | | * Add UI elements to the 'mailbox view' and 'show message' UI. |
| | | */ |
| | | function mail_task_handler() |