summaryrefslogtreecommitdiff
path: root/plugins/managesieve/managesieve.php
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-03-18 08:53:32 +0000
committeralecpl <alec@alec.pl>2010-03-18 08:53:32 +0000
commit98c489e9f49de6a4442821614d5e69b36173eeab (patch)
tree5fe4a2c717806ed16b031ab33ef75da4b551b7fe /plugins/managesieve/managesieve.php
parentc16986be7f5f4df21bfc85a93a2c35f38c86bf12 (diff)
- Managesieve: Added import from Horde-INGO
- Managesieve: Support for more than one match using if+stop instead of if+elsif structures (#1486078) - Managesieve: Support for selectively disabling rules within a single sieve script (#1485882) - Managesieve: Added vertical splitter
Diffstat (limited to 'plugins/managesieve/managesieve.php')
-rw-r--r--plugins/managesieve/managesieve.php32
1 files changed, 21 insertions, 11 deletions
diff --git a/plugins/managesieve/managesieve.php b/plugins/managesieve/managesieve.php
index e88fcff45..4c50616b1 100644
--- a/plugins/managesieve/managesieve.php
+++ b/plugins/managesieve/managesieve.php
@@ -7,7 +7,7 @@
* It's clickable interface which operates on text scripts and communicates
* with server using managesieve protocol. Adds Filters tab in Settings.
*
- * @version 2.2
+ * @version 2.3
* @author Aleksander 'A.L.E.C' Machniak <alec@alec.pl>
*
* Configuration (see config.inc.php.dist)
@@ -46,9 +46,7 @@ class managesieve extends rcube_plugin
function managesieve_start()
{
- $rcmail = rcmail::get_instance();
- $this->rc = &$rcmail;
-
+ $this->rc = rcmail::get_instance();
$this->load_config();
// register UI objects
@@ -302,6 +300,7 @@ class managesieve extends rcube_plugin
foreach ($sizeitems as $item)
$items[] = $item;
+ $this->form['disabled'] = $_POST['_disabled'] ? true : false;
$this->form['join'] = $join=='allof' ? true : false;
$this->form['name'] = $name;
$this->form['tests'] = array();
@@ -486,8 +485,10 @@ class managesieve extends rcube_plugin
if ($save && $fid !== false)
{
$this->rc->output->show_message('managesieve.filtersaved', 'confirmation');
- $this->rc->output->add_script(sprintf("rcmail.managesieve_updatelist('%s', '%s', %d);",
- isset($new) ? 'add' : 'update', Q($this->form['name']), $fid), 'foot');
+ $this->rc->output->add_script(
+ sprintf("rcmail.managesieve_updatelist('%s', '%s', %d, %d);",
+ isset($new) ? 'add' : 'update', Q($this->form['name']), $fid, $this->form['disabled']),
+ 'foot');
}
else
{
@@ -504,10 +505,12 @@ class managesieve extends rcube_plugin
{
// Handle form action
if (isset($_GET['_framed']) || isset($_POST['_framed'])) {
- if (isset($_GET['_newset']) || isset($_POST['_newset']))
+ if (isset($_GET['_newset']) || isset($_POST['_newset'])) {
$this->rc->output->send('managesieve.setedit');
- else
+ }
+ else {
$this->rc->output->send('managesieve.filteredit');
+ }
} else {
$this->rc->output->set_pagetitle($this->gettext('filters'));
$this->rc->output->send('managesieve.managesieve');
@@ -525,8 +528,12 @@ class managesieve extends rcube_plugin
$a_show_cols = array('managesieve.filtername');
foreach($this->script as $idx => $filter)
- $result[] = array('managesieve.filtername' => $filter['name'], 'id' => $idx);
-
+ $result[] = array(
+ 'managesieve.filtername' => $filter['name'],
+ 'id' => $idx,
+ 'class' => $filter['disabled'] ? 'disabled' : '',
+ );
+
// create XHTML table
$out = rcube_table_output($attrib, $result, $a_show_cols, 'id');
@@ -722,7 +729,10 @@ class managesieve extends rcube_plugin
$out .= "</div>\n";
$out .= "</fieldset>\n";
-
+
+ if ($scr['disabled']) {
+ $this->rc->output->set_env('rule_disabled', true);
+ }
$this->rc->output->add_label('managesieve.ruledeleteconfirm');
$this->rc->output->add_label('managesieve.actiondeleteconfirm');
$this->rc->output->add_gui_object('sieveform', 'filterform');