/** * Get all possible errors * * @return array */ public function getErrors() { $errors = parent::getErrors(); if (!$this->isColor) { $errors = array_merge($errors, array('color' => $this->getLabel() . ' is no color')); } return $errors; }
/** * Return the allowed options for this widget * * @return array */ protected static function allowedOptions() { $additional = array('dir' => 1, 'lang' => 1, 'xml:lang' => 1, 'disabled' => 1, 'maxlength' => 1, 'readonly' => 1, 'size' => 1, 'path' => 4, 'securename' => 4, 'simple' => 4, 'allowed' => 4); return array_merge(parent::allowedOptions(), $additional); }
/** * Return the allowed options for this widget * * @return array */ protected static function allowedOptions() { $additional = array('cols' => 1, 'rows' => 1, 'dir' => 1, 'lang' => 1, 'xml:lang' => 1, 'tabindex' => 1, 'accesskey' => 1, 'disabled' => 1, 'readonly' => 1, 'type' => 2); return array_merge(parent::allowedOptions(), $additional); }
/** * Get the value for the widget * * @return mixed */ public function getValue($model) { if (!$model) { return null; } if ($this->getCfg('js')) { return parent::getValue($model); } else { $oc = new One_Context(); $day = $oc->get($this->getName() . 'Day'); $month = $oc->get($this->getName() . 'Month'); $year = $oc->get($this->getName() . 'Year'); if ($day == 0 || $month == 0 || $year == 0) { return '0000-00-00'; } else { return $year . '-' . $month . '-' . $day; } } }
/** * Class constructor * * @param string $id * @param string $name * @param string $label * @param array $config */ public function __construct($id = NULL, $name = '', $label = NULL, $config = array()) { throw new One_Exception_NotImplemented('Child widget is not yet implemented'); parent::__construct($id, $name, $label, $config); $this->_type = 'child'; }
/** * Return the allowed options for this widget * * @return array */ protected static function allowedOptions() { $additional = array('dir' => 1, 'lang' => 1, 'xml:lang' => 1, 'disabled' => 1, 'size' => 1); return array_merge(parent::allowedOptions(), $additional); }