7
* This source file is subject to the new BSD license that is bundled
8
* with this package in the file LICENSE.txt.
9
* It is also available through the world-wide-web at this URL:
10
* http://framework.zend.com/license/new-bsd
11
* If you did not receive a copy of the license and are unable to
12
* obtain it through the world-wide-web, please send an email
13
* to license@zend.com so we can send you a copy immediately.
17
* @subpackage Decorator
18
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
19
* @license http://framework.zend.com/license/new-bsd New BSD License
22
/** Zend_Form_Decorator_Abstract */
23
require_once 'Zend/Form/Decorator/Abstract.php';
26
* Word-based captcha decorator
28
* Adds hidden field for ID and text input field for captcha text
33
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
34
* @license http://framework.zend.com/license/new-bsd New BSD License
37
class Zend_Form_Decorator_Captcha_Word extends Zend_Form_Decorator_Abstract
42
* @param string $content
45
public function render($content)
47
$element = $this->getElement();
48
$view = $element->getView();
53
$name = $element->getFullyQualifiedName();
55
$hiddenName = $name . '[id]';
56
$textName = $name . '[input]';
58
$placement = $this->getPlacement();
59
$separator = $this->getSeparator();
61
$hidden = $view->formHidden($hiddenName, $element->getValue(), $element->getAttribs());
62
$text = $view->formText($textName, '', $element->getAttribs());
65
$content = $hidden . $separator . $text . $separator . $content;
69
$content = $content . $separator . $hidden . $separator . $text;