Example #1
0
 public function renderActive($renderer = null, $vars = null, $action = '', $method = 'get', $enctype = null, $focus = true)
 {
     if (is_null($vars)) {
         $vars = $this->_vars;
     }
     $vars = clone $vars;
     unset($vars->folder_new);
     parent::renderActive($renderer, $vars, $action, $method, $enctype, $focus);
 }
Example #2
0
 public function __construct($vars, $title = '', $name = null)
 {
     parent::__construct($vars, $title, $name);
     $v = $this->addVariable(_("Keep a copy of messages in this account?"), 'keep_copy', 'boolean', false);
     $v->setHelp('forward-keepcopy');
     $v = $this->addVariable(_("Address(es) to forward to:"), 'addresses', 'ingo:Longemail', false, false, null, array(5, 40));
     $v->setHelp('forward-addresses');
     $this->setButtons(_("Save"));
 }
Example #3
0
File: Spam.php Project: horde/horde
 public function validate($vars = null, $canAutoFill = false)
 {
     if (is_null($vars)) {
         $vars = $this->_vars;
     }
     if (strlen($vars->get('folder_new'))) {
         $this->folder_var->type->newFolderSet = true;
     }
     return parent::validate($vars, $canAutoFill);
 }
Example #4
0
 /**
  * Additional validate of start and end date fields.
  */
 public function validate($vars = null, $canAutoFill = false)
 {
     $valid = true;
     if (!parent::validate($vars, $canAutoFill)) {
         $valid = false;
     }
     if ($this->hasFeature('period')) {
         $this->_start->getInfo($vars, $start);
         $this->_end->getInfo($vars, $end);
         if ($start && $end && $end < $start) {
             $valid = false;
             $this->_errors['end'] = _("Vacation end date is prior to start.");
         }
         if ($end && $end < mktime(0, 0, 0)) {
             $valid = false;
             $this->_errors['end'] = _("Vacation end date is prior to today.");
         }
     }
     return $valid;
 }