XOOPS  2.6.0
recaptcha.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  $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 
48  $button_tray->addElement(new Xoops\Form\Hidden('op', 'save'));
49  $button_tray->addElement(new Xoops\Form\Button('', 'submit', XoopsLocale::A_SUBMIT, 'submit'));
50  $button_tray->addElement(new Xoops\Form\Button('', 'reset', XoopsLocale::A_RESET, 'reset'));
51  $cancel_send = new Xoops\Form\Button('', 'cancel', XoopsLocale::A_CANCEL, 'button');
52  $cancel_send->setExtra("onclick='javascript:history.go(-1);'");
53  $button_tray->addElement($cancel_send);
54 
55  $this->addElement($button_tray);
56  }
57 }
const A_SUBMIT
Definition: en_US.php:128
const A_RESET
Definition: en_US.php:121
static getInstance()
Definition: Xoops.php:160
addElement(Element $formElement, $required=false)
Definition: Form.php:206
__construct($object=null)
Definition: recaptcha.php:25
$xoops
Definition: admin.php:25
const A_CANCEL
Definition: en_US.php:82
$button_tray
Definition: xoops_code.php:26