예제 #1
0
파일: select.php 프로젝트: ZerGabriel/cms-1
 public function __construct($field)
 {
     parent::__construct($field);
     if ($this->size == Sidebar_Fields_Select::AUTO_SIZE) {
         $this->size = count($this->_field['options']);
     }
 }
예제 #2
0
 public function render()
 {
     $range = array();
     Text::alternate();
     foreach ($this->_field['range'] as $pair) {
         $date = $pair;
         $date = Arr::merge($date, $this->_attributes);
         $date['id'] = Text::alternate('date_from', 'date_to');
         if (!isset($date['name'])) {
             $date['name'] = $date['id'];
         }
         if ($this->_field['name'] !== NULL) {
             $date['name'] = $this->_field['name'] . '[' . $date['name'] . ']';
         }
         $date['inline'] = TRUE;
         $range[] = new Sidebar_Fields_Date($date);
     }
     unset($this->_field['range']);
     $this->_view->set('range', $range);
     return parent::render();
 }
예제 #3
0
 public function render()
 {
     $options = array();
     $_options = $this->_field['options'];
     $this->_view->set('label', $this->_field['label']);
     unset($this->_field['label'], $this->_field['options']);
     foreach ($_options as $option) {
         if ($option instanceof Sidebar_Fields_Abstract) {
             $options[] = $option;
             continue;
         }
         $option = Arr::merge($option, $this->_field);
         if (isset($this->param) and $this->param == $option['value']) {
             $option['selected'] = TRUE;
         }
         $option['inline'] = TRUE;
         $options[] = new Sidebar_Fields_Radio($option);
     }
     $this->_view->set('options', $options);
     return parent::render();
 }