Ejemplo n.º 1
0
 function validate()
 {
     parent::validate();
     if ($this->value != '' and $this->maxlength > 0) {
         $this->form->validator->email($this->field);
     }
 }
Ejemplo n.º 2
0
 function validate()
 {
     parent::validate();
     $strlen = strlen($this->value);
     if ($strlen > 0) {
         if (!preg_match("/^[0-9]{" . $strlen . "}\$/", $this->value)) {
             $this->form->validator->setError($this->field, 902);
         }
     }
 }
Ejemplo n.º 3
0
 function validate()
 {
     parent::validate();
     $strlen = strlen($this->value);
     if ($strlen > 0) {
         if (!preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $this->value)) {
             $this->form->validator->setError($this->field, 912);
         }
     }
 }
Ejemplo n.º 4
0
 function draw(&$form)
 {
     parent::draw($form);
     if ($this->updatable) {
         global $_CAMILA;
         $code = '<script type="text/javascript" src="camila/js/camila_security.js"></script>';
         $_CAMILA['page']->camila_add_js($code, 'camila_security');
         $js = new CHAW_js("<script>document.write('<a href=\\'javascript:void(0)\\' onclick=\\'document.forms[0]." . $this->key . ".value=camila_generate_password(" . $this->pwdlength . ",\"" . $this->type . "\");\\'>Genera codice casuale</a>')</script>");
         $form->add_userdefined($js);
     }
 }
Ejemplo n.º 5
0
 function draw(&$form)
 {
     parent::base_draw($form);
     if ($this->updatable) {
         $myInput = new CHAW_input($this->key, $this->value, $this->title . $this->labelseparator);
         if ($this->maxlength > 0) {
             $myInput->set_maxlength($this->maxlength);
         }
         if ($this->size > 0) {
             $myInput->set_size($this->size);
         }
         $myInput->set_type(HAW_INPUT_PASSWORD);
         $form->add_input($myInput);
     } else {
         //$myHidden = new CHAW_hidden($this->key, $this->value);
         //$form->add_input($myHidden);
         $myText = new CHAW_text($this->title . $this->labelseparator . ' **********');
         $form->add_text($myText);
     }
 }