Ejemplo n.º 1
0
 public function __construct($name = '', $info = array())
 {
     parent::__construct($name, $info);
     if (!$this->value) {
         $this->value = $name;
     }
 }
Ejemplo n.º 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'));
 }
Ejemplo n.º 3
0
 public function __construct($name = '', $info = array())
 {
     parent::__construct($name, $info);
     $this->required = FALSE;
     if ($this->value == 1) {
         $this->checked = TRUE;
     }
 }
Ejemplo n.º 4
0
 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();
         }
     }
 }
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 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();
 }
Ejemplo n.º 7
0
 public function __construct($name = '', $info = array())
 {
     parent::__construct($name, $info);
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 9
0
 public function __construct($name = '', $info = array())
 {
     parent::__construct($name, $info);
     Formo::instance($this->formo_name)->add_function('blank', array($this, 'blank'));
 }