XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
formcaptcha.php
Go to the documentation of this file.
1 <?php
20 defined('XOOPS_ROOT_PATH') or die('Restricted access');
21 
23 
48 class XoopsFormCaptcha extends XoopsFormElement
49 {
51 
58  function XoopsFormCaptcha($caption = '', $name = 'xoopscaptcha', $skipmember = true, $configs = array())
59  {
60  xoops_load('XoopsCaptcha');
61  $this->captchaHandler = &XoopsCaptcha::getInstance();
62  $configs['name'] = $name;
63  $configs['skipmember'] = $skipmember;
64  $this->captchaHandler->setConfigs($configs);
65  if (! $this->captchaHandler->isActive()) {
66  $this->setHidden();
67  } else {
68  $caption = ! empty($caption) ? $caption : $this->captchaHandler->getCaption();
69  $this->setCaption($caption);
70  $this->setName($name);
71  }
72  }
73 
74  function setConfig($name, $val)
75  {
76  return $this->captchaHandler->setConfig($name, $val);
77  }
78 
79  function render()
80  {
81  // if (!$this->isHidden()) {
82  return $this->captchaHandler->render();
83  // }
84  }
85 
86  function renderValidationJS()
87  {
88  return $this->captchaHandler->renderValidationJS();
89  }
90 }
91 
92 ?>