1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18:
19:
20: class XcaptchaRecaptchaForm 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: $this->addElement(new Xoops\Form\TextArea(_XCAPTCHA_PRIVATE_KEY, 'private_key', $this->config['private_key'], 5, 50), true);
35: $this->addElement(new Xoops\Form\Textarea(_XCAPTCHA_PUBLIC_KEY, 'public_key', $this->config['public_key'], 5, 50), true);
36:
37: $theme_form = new Xoops\Form\Select(_XCAPTCHA_THEME, 'theme', $this->config['theme'], $size = 4);
38: $theme_form->addOptionArray($this->object->getThemes());
39: $this->addElement($theme_form, false);
40:
41: $lang_form = new Xoops\Form\Select(_XCAPTCHA_LANG, 'lang', $this->config['lang'], $size = 4);
42: $lang_form->addOptionArray($this->object->getLanguages());
43: $this->addElement($lang_form, false);
44:
45: $this->addElement(new Xoops\Form\Hidden('type', 'recaptcha'));
46:
47: $buttonTray = new Xoops\Form\ElementTray('', '');
48: $buttonTray->addElement(new Xoops\Form\Hidden('op', 'save'));
49: $buttonTray->addElement(new Xoops\Form\Button('', 'submit', XoopsLocale::A_SUBMIT, 'submit'));
50: $buttonTray->addElement(new Xoops\Form\Button('', 'reset', XoopsLocale::A_RESET, 'reset'));
51: $buttonCancelSend = new Xoops\Form\Button('', 'cancel', XoopsLocale::A_CANCEL, 'button');
52: $buttonCancelSend->setExtra("onclick='javascript:history.go(-1);'");
53: $buttonTray->addElement($buttonCancelSend);
54:
55: $this->addElement($buttonTray);
56: }
57: }
58: