XOOPS  2.6.0
image.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\Text(_XCAPTCHA_NUM_CHARS, 'num_chars', 2, 2, $this->config['num_chars']), true);
35 
36  $this->addElement(new Xoops\Form\RadioYesNo(_XCAPTCHA_CASESENSITIVE, 'casesensitive', $this->config['casesensitive']));
37 
38  $fontmin_form = new Xoops\Form\Select(_XCAPTCHA_FONTSIZE_MIN, 'fontsize_min', $this->config['fontsize_min']);
39  for ($i = 10; $i <= 30; ++$i) {
40  $fontmin_form->addOption($i, $i);
41  }
42  $this->addElement($fontmin_form, false);
43 
44  $fontmax_form = new Xoops\Form\Select(_XCAPTCHA_FONTSIZE_MAX, 'fontsize_max', $this->config['fontsize_max']);
45  for ($i = 10; $i <= 30; ++$i) {
46  $fontmax_form->addOption($i, $i);
47  }
48  $this->addElement($fontmax_form, false);
49 
50  $backtype_form = new Xoops\Form\Select(_XCAPTCHA_BACKGROUND_TYPE, 'background_type', $this->config['background_type'], $size = 7);
51  $backtype_form->addOption(0, _XCAPTCHA_BACKGROUND_BAR);
52  $backtype_form->addOption(1, _XCAPTCHA_BACKGROUND_CIRCLE);
53  $backtype_form->addOption(2, _XCAPTCHA_BACKGROUND_LINE);
54  $backtype_form->addOption(3, _XCAPTCHA_BACKGROUND_RECTANGLE);
55  $backtype_form->addOption(4, _XCAPTCHA_BACKGROUND_ELLIPSE);
56  $backtype_form->addOption(5, _XCAPTCHA_BACKGROUND_POLYGONE);
57  $backtype_form->addOption(100, _XCAPTCHA_BACKGROUND_IMAGE);
58  $this->addElement($backtype_form, false);
59 
60  $backnum_form = new Xoops\Form\Select(_XCAPTCHA_BACKGROUND_NUM, 'background_num', $this->config['background_num']);
61  for ($i = 10; $i <= 100; $i = $i+10) {
62  $backnum_form->addOption($i, $i);
63  }
64  $this->addElement($backnum_form, false);
65 
66  $polygon_point = new Xoops\Form\Select(_XCAPTCHA_POLYGON_POINT, 'polygon_point', $this->config['polygon_point']);
67  for ($i = 3; $i <= 20; ++$i) {
68  $polygon_point->addOption($i, $i);
69  }
70  $this->addElement($polygon_point, false);
71 
72  $value = implode('|', $this->config['skip_characters']);
73  $this->addElement(new Xoops\Form\TextArea(_XCAPTCHA_SKIP_CHARACTERS, 'skip_characters', $value, 5, 50), true);
74 
75  $this->addElement(new Xoops\Form\Hidden('type', 'image'));
76 
78  $button_tray->addElement(new Xoops\Form\Hidden('op', 'save'));
79  $button_tray->addElement(new Xoops\Form\Button('', 'submit', XoopsLocale::A_SUBMIT, 'submit'));
80  $button_tray->addElement(new Xoops\Form\Button('', 'reset', XoopsLocale::A_RESET, 'reset'));
81  $cancel_send = new Xoops\Form\Button('', 'cancel', XoopsLocale::A_CANCEL, 'button');
82  $cancel_send->setExtra("onclick='javascript:history.go(-1);'");
83  $button_tray->addElement($cancel_send);
84 
85  $this->addElement($button_tray);
86  }
87 }
const A_SUBMIT
Definition: en_US.php:128
$i
Definition: dialog.php:68
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: image.php:25
$xoops
Definition: image.php:25
const A_CANCEL
Definition: en_US.php:82
$button_tray
Definition: xoops_code.php:26