From 9f64e4feacdc8cbbe2dd6711c946cb173c1f8a93 Mon Sep 17 00:00:00 2001 From: alec Date: Sat, 20 Nov 2010 17:59:50 +0000 Subject: - Apply forgotten changes for form errors handling - Fix handling of scripts with CRLF line separator git-svn-id: https://svn.roundcube.net/trunk@4241 208e9e7b-5314-0410-a742-e7e81cd9613c --- plugins/managesieve/managesieve.php | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) (limited to 'plugins/managesieve/managesieve.php') diff --git a/plugins/managesieve/managesieve.php b/plugins/managesieve/managesieve.php index 8fb8242bc..5de839da6 100644 --- a/plugins/managesieve/managesieve.php +++ b/plugins/managesieve/managesieve.php @@ -684,20 +684,17 @@ class managesieve extends rcube_plugin $copy = get_input_value('_copy', RCUBE_INPUT_POST); $selected = get_input_value('_from', RCUBE_INPUT_POST); - $table = new html_table(array('cols' => 2)); - // filter set name input $input_name = new html_inputfield(array('name' => '_name', 'id' => '_name', 'size' => 30, 'class' => ($this->errors['name'] ? 'error' : ''))); - $table->add('title', sprintf('', - '_name', Q($this->gettext('filtersetname')))); - $table->add(null, $input_name->show($name)); + $out .= sprintf(' %s

', + '_name', Q($this->gettext('filtersetname')), $input_name->show($name)); - $from ='
'; - $from .= '" . $this->gettext('filters') . ":\n"; + $out .= ''; - $from .= sprintf(' ', 'from_none', Q($this->gettext('none'))); + $out .= sprintf(' ', 'from_none', Q($this->gettext('none'))); // filters set list $list = $this->sieve->get_scripts(); @@ -711,26 +708,21 @@ class managesieve extends rcube_plugin foreach ($list as $set) $select->add($set . ($set == $active ? ' ('.$this->gettext('active').')' : ''), $set); - $from .= '
'; - $from .= sprintf(' ', 'from_set', Q($this->gettext('fromset'))); - $from .= $select->show($copy); + $out .= sprintf(' ', 'from_set', Q($this->gettext('fromset'))); + $out .= $select->show($copy); } // script upload box $upload = new html_inputfield(array('name' => '_file', 'id' => '_file', 'size' => 30, 'type' => 'file', 'class' => ($this->errors['name'] ? 'error' : ''))); - $from .= '
'; - $from .= sprintf(' ', 'from_file', Q($this->gettext('fromfile'))); - $from .= $upload->show(); - $from .= '
'; - - $table->add('title', ''); - $table->add(null, $from); - - $out .= $table->show(); + $out .= sprintf(' ', 'from_file', Q($this->gettext('fromfile'))); + $out .= $upload->show(); + $out .= ''; $this->rc->output->add_gui_object('sieveform', 'filtersetform'); @@ -763,6 +755,9 @@ class managesieve extends rcube_plugin $input_name = new html_inputfield(array('name' => '_name', 'id' => $field_id, 'size' => 30, 'class' => ($this->errors['name'] ? 'error' : ''))); + if ($this->errors['name']) + $this->add_tip($field_id, $this->errors['name'], true); + if (isset($scr)) $input_name = $input_name->show($scr['name']); else -- cgit v1.2.3