Go to the documentation of this file.00001 <?php
00010 class form_captcha extends form_text {
00011
00012 protected function afterInit() {
00013 if (!$this->label && !is_bool($this->label))
00014 $this->label = ucfirst($this->name);
00015 if (!is_object($this->cfg->value))
00016 $this->cfg->value = utils::htmlOut($this->cfg->value);
00017 $this->id = str_replace(
00018 array('[]', '[', ']'),
00019 array('_', '_', ''),
00020 $this->name);
00021 }
00022
00023 public function getValid() {
00024 return null;
00025 }
00026
00027 public function isValid() {
00028 $ret = empty($this->cfg->value);
00029 if (!$ret && $this->cfg->errorFct && is_callable($this->cfg->errorFct))
00030 call_user_func($this->cfg->errorFct);
00031 return $ret;
00032 }
00033
00034 public function getErrors() {
00035 return $this->isValid()? array() : array($this->cfg->error);
00036 }
00037
00038 public function addRule($type, $prm=null) {}
00039
00040 }