Example #1
0
 public function __construct($name = '', $info = array())
 {
     parent::__construct($name, $info);
     if (!$this->value) {
         $this->value = $name;
     }
 }
Example #2
0
 public function __construct($name = '', $info = array())
 {
     parent::__construct($name, $info);
     if (!$this->value) {
         $this->value = $name;
     }
     Formo::instance($this->formo_name)->add_function('check', array($this, 'check'))->add_function('uncheck', array($this, 'uncheck'));
 }
Example #3
0
 public function __construct($name = '', $info = array())
 {
     parent::__construct($name, $info);
     $this->required = FALSE;
     if ($this->value == 1) {
         $this->checked = TRUE;
     }
 }
 public function __construct($name = '', $info = array())
 {
     parent::__construct($name, $info);
     if (request::is_ajax() and isset($_GET['query'])) {
         if (!$this->data) {
             $this->data = call_user_func($this->source, $_GET['query']);
             $this->get_results();
         }
     }
 }
Example #5
0
 public function __construct($name = '', $info = array())
 {
     parent::__construct($name, $info);
     // load the config file
     $_config = Kohana::config('captcha');
     // get default if no group specified, group if it is
     $config = ($this->group and isset($_config[$this->group])) ? $_config[$this->group] : $_config['default'];
     // create the captcha object here if it's a riddle
     if (in_array($config['style'], $this->non_images)) {
         $this->captcha = Captcha::factory($this->group);
     }
 }
Example #6
0
 protected function validate_this()
 {
     // A blank is allowed only if the item is not required.
     if ($this->required and $this->value === '') {
         $this->error = $this->error_msg;
         return $this->error;
     }
     // Even if the field is optional, only pass a blank as valid if it appears
     // in the data array or has been added as a 'blank'.
     $keys = array_map('strtolower', array_keys($this->values));
     if (!in_array(strtolower($this->value), $keys) and (!$this->has_blank() or $this->value !== '')) {
         $this->error = $this->error_msg;
         return $this->error;
     }
     parent::validate_this();
 }
Example #7
0
 public function __construct($name = '', $info = array())
 {
     parent::__construct($name, $info);
 }
Example #8
0
 public function __construct($name = '', $info = array())
 {
     parent::__construct($name, $info);
     $form = Formo::instance($this->formo_name);
     $form->set('open', preg_replace('/>/', ' enctype="multipart/form-data">', $form->_open));
 }
Example #9
0
 public function __construct($name = '', $info = array())
 {
     parent::__construct($name, $info);
     Formo::instance($this->formo_name)->add_function('blank', array($this, 'blank'));
 }