1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18:
19:
20: class XcaptchaCaptchaForm extends Xoops\Form\ThemeForm
21: {
22: 23: 24:
25: public function __construct($object = null)
26: {
27: $this->object = $object;
28: $this->config = $object->config;
29:
30: $xoops = Xoops::getInstance();
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:
54: $buttonTray = new Xoops\Form\ElementTray('', '');
55: $buttonTray->addElement(new Xoops\Form\Hidden('op', 'save'));
56: $buttonTray->addElement(new Xoops\Form\Button('', 'submit', XoopsLocale::A_SUBMIT, 'submit'));
57: $buttonTray->addElement(new Xoops\Form\Button('', 'reset', XoopsLocale::A_RESET, 'reset'));
58: $buttonCancelSend = new Xoops\Form\Button('', 'cancel', XoopsLocale::A_CANCEL, 'button');
59: $buttonCancelSend->setExtra("onclick='javascript:history.go(-1);'");
60: $buttonTray->addElement($buttonCancelSend);
61:
62: $this->addElement($buttonTray);
63: }
64: }
65: