XOOPS  2.6.0
captcha.php
Go to the documentation of this file.
1 <?php
21 {
25  public function __construct($object = null)
26  {
27  $this->object = $object;
28  $this->config = $object->config;
29 
31 
32  parent::__construct('', 'xcaptchaform', $xoops->getEnv('PHP_SELF'), 'post', true, 'horizontal');
33 
34  $activate = new Xoops\Form\Radio(_AM_XCAPTCHA_ACTIVATE, 'disabled', $this->config['disabled']);
35  $activate->addOption(1, _AM_XCAPTCHA_ENABLE);
36  $activate->addOption(0, _AM_XCAPTCHA_DISABLE);
37  $this->addElement($activate, false);
38 
39  $plugin_List = new Xoops\Form\Select(_AM_XCAPTCHA_PLUGINS, 'mode', $this->config['mode']);
40  $plugin_List->addOptionArray($this->object->plugin_List);
41  $this->addElement($plugin_List, false);
42 
43  $this->addElement(new Xoops\Form\Text(_AM_XCAPTCHA_NAME, 'name', 50, 50, $this->config['name']), true);
44 
45  $skipmember = new Xoops\Form\Radio(_AM_XCAPTCHA_SKIPMEMBER, 'skipmember', $this->config['skipmember']);
46  $skipmember->addOption(1, _AM_XCAPTCHA_ENABLE);
47  $skipmember->addOption(0, _AM_XCAPTCHA_DISABLE);
48  $this->addElement($skipmember, false);
49 
50  $this->addElement(new Xoops\Form\Text(_AM_XCAPTCHA_MAXATTEMPTS, 'maxattempts', 2, 2, $this->config['maxattempts'] ), true);
51 
52  $this->addElement(new Xoops\Form\Hidden('type', 'config'));
53 
55  $button_tray->addElement(new Xoops\Form\Hidden('op', 'save'));
56  $button_tray->addElement(new Xoops\Form\Button('', 'submit', XoopsLocale::A_SUBMIT, 'submit'));
57  $button_tray->addElement(new Xoops\Form\Button('', 'reset', XoopsLocale::A_RESET, 'reset'));
58  $cancel_send = new Xoops\Form\Button('', 'cancel', XoopsLocale::A_CANCEL, 'button');
59  $cancel_send->setExtra("onclick='javascript:history.go(-1);'");
60  $button_tray->addElement($cancel_send);
61 
62  $this->addElement($button_tray);
63  }
64 }
const A_SUBMIT
Definition: en_US.php:128
const A_RESET
Definition: en_US.php:121
const _AM_XCAPTCHA_ENABLE
Definition: admin.php:25
static getInstance()
Definition: Xoops.php:160
addElement(Element $formElement, $required=false)
Definition: Form.php:206
const _AM_XCAPTCHA_SKIPMEMBER
Definition: admin.php:32
const _AM_XCAPTCHA_NAME
Definition: admin.php:30
$xoops
Definition: admin.php:25
const A_CANCEL
Definition: en_US.php:82
const _AM_XCAPTCHA_ACTIVATE
Definition: admin.php:24
const _AM_XCAPTCHA_PLUGINS
Definition: admin.php:28
__construct($object=null)
Definition: captcha.php:25
$button_tray
Definition: xoops_code.php:26
const _AM_XCAPTCHA_MAXATTEMPTS
Definition: admin.php:34
const _AM_XCAPTCHA_DISABLE
Definition: admin.php:26