From 39930a480955b7ebe5db7de71fddef8f750b8519 Mon Sep 17 00:00:00 2001 From: alec Date: Mon, 17 Oct 2011 10:50:37 +0000 Subject: - Filters - UI redesign: added possibility to move filter to any place using drag&drop (instead of up/down buttons), added filter sets list object, added more 'loading' messages - Added option to hide some scripts (managesieve_filename_exceptions) git-svn-id: https://svn.roundcube.net/trunk@5340 208e9e7b-5314-0410-a742-e7e81cd9613c --- plugins/managesieve/lib/rcube_sieve_script.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'plugins/managesieve/lib/rcube_sieve_script.php') diff --git a/plugins/managesieve/lib/rcube_sieve_script.php b/plugins/managesieve/lib/rcube_sieve_script.php index 8fc0e5545..3c6993dcc 100644 --- a/plugins/managesieve/lib/rcube_sieve_script.php +++ b/plugins/managesieve/lib/rcube_sieve_script.php @@ -187,11 +187,17 @@ class rcube_sieve_script array_push($exts, 'variables'); } foreach ($this->vars as $var) { - $output .= (empty($has_vars) ? '# ' : '') . 'set '; - foreach (array_diff(array_keys($var), array('name', 'value')) as $opt) { - $output .= ":$opt "; + if (empty($has_vars)) { + // 'variables' extension not supported, put vars in comments + $output .= sprintf("# %s %s\n", $var['name'], $var['value']); + } + else { + $output .= 'set '; + foreach (array_diff(array_keys($var), array('name', 'value')) as $opt) { + $output .= ":$opt "; + } + $output .= self::escape_string($var['name']) . ' ' . self::escape_string($var['value']) . ";\n"; } - $output .= self::escape_string($var['name']) . ' ' . self::escape_string($var['value']) . ";\n"; } } @@ -423,7 +429,7 @@ class rcube_sieve_script $rulename = $matches[1]; } // KEP:14 variables - else if (preg_match('/^# set "([^"]+)" "([^"]+)";$/', $line, $matches)) { + else if (preg_match('/^# (EDITOR|EDITOR_VERSION) (.+)$/', $line, $matches)) { $this->set_var($matches[1], $matches[2]); } // Horde-Ingo format -- cgit v1.2.3