Esempio n. 1
0
 public function __construct($field, $smarty)
 {
     parent::__construct($field, $smarty);
     //post populate helper name
     $this->post_file_helper_name = Jelly_Field_File::$post_file_helper_prefix . $this->_field->name;
     //first empty element
     $this->_options[0] = __('select');
 }
Esempio n. 2
0
 public function __construct($field, $smarty)
 {
     parent::__construct($field, $smarty);
     //first empty element
     $this->_options[0] = __('select');
     $options = Jelly::query($this->_field->foreign['model'])->select()->as_array('id', $this->_field->form_field);
     //push options
     array_walk($options, function (&$item, $key) {
         $this->_options[$key] = $item;
     });
 }
Esempio n. 3
0
 public function __construct($field, $smarty)
 {
     parent::__construct($field, $smarty);
     //first empty element
     $this->_options[0] = __('select');
     $options = array_filter($this->_field->choices);
     //push options
     array_walk($options, function (&$item, $key) {
         $this->_options[$key] = $item;
     });
 }
Esempio n. 4
0
 public function __construct($field, $smarty)
 {
     parent::__construct($field, $smarty);
     //need presentation form
     if (!(bool) $field->presentation) {
         throw new Kohana_Exception('Specified presentation form for field :field', array(':field' => $field->name));
     }
     $field_class = self::$_field_prefix . ucfirst(strtolower($field->presentation));
     if (!class_exists($field_class)) {
         throw new Kohana_Exception('No class for presentation form :form', array(':from' => $field->presentation));
     }
     $this->_presentation_field = new $field_class($field, $smarty);
 }