import v2.0.0.0_RC3 | 2012-07-01

https://github.com/lucanos/CommunityID -> http://www.itadmins.net/archives/357
This commit is contained in:
2019-07-17 22:31:04 +02:00
parent 38c146901c
commit 2f397f01f7
2677 changed files with 296182 additions and 45159 deletions

View File

@ -23,13 +23,13 @@ require_once 'Zend/Form/Decorator/Interface.php';
/**
* Zend_Form_Decorator_Abstract
*
*
* @category Zend
* @package Zend_Form
* @subpackage Decorator
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Abstract.php 16218 2009-06-21 19:44:04Z thomas $
* @version $Id: Abstract.php 18951 2009-11-12 16:26:19Z alexander $
*/
abstract class Zend_Form_Decorator_Abstract implements Zend_Form_Decorator_Interface
{
@ -45,7 +45,7 @@ abstract class Zend_Form_Decorator_Abstract implements Zend_Form_Decorator_Inter
*/
protected $_placement = 'APPEND';
/**
/**
* @var Zend_Form_Element|Zend_Form
*/
protected $_element;
@ -64,8 +64,8 @@ abstract class Zend_Form_Decorator_Abstract implements Zend_Form_Decorator_Inter
/**
* Constructor
*
* @param array|Zend_Config $options
*
* @param array|Zend_Config $options
* @return void
*/
public function __construct($options = null)
@ -79,8 +79,8 @@ abstract class Zend_Form_Decorator_Abstract implements Zend_Form_Decorator_Inter
/**
* Set options
*
* @param array $options
*
* @param array $options
* @return Zend_Form_Decorator_Abstract
*/
public function setOptions(array $options)
@ -91,8 +91,8 @@ abstract class Zend_Form_Decorator_Abstract implements Zend_Form_Decorator_Inter
/**
* Set options from config object
*
* @param Zend_Config $config
*
* @param Zend_Config $config
* @return Zend_Form_Decorator_Abstract
*/
public function setConfig(Zend_Config $config)
@ -102,9 +102,9 @@ abstract class Zend_Form_Decorator_Abstract implements Zend_Form_Decorator_Inter
/**
* Set option
*
* @param string $key
* @param mixed $value
*
* @param string $key
* @param mixed $value
* @return Zend_Form_Decorator_Abstract
*/
public function setOption($key, $value)
@ -115,8 +115,8 @@ abstract class Zend_Form_Decorator_Abstract implements Zend_Form_Decorator_Inter
/**
* Get option
*
* @param string $key
*
* @param string $key
* @return mixed
*/
public function getOption($key)
@ -131,7 +131,7 @@ abstract class Zend_Form_Decorator_Abstract implements Zend_Form_Decorator_Inter
/**
* Retrieve options
*
*
* @return array
*/
public function getOptions()
@ -141,8 +141,8 @@ abstract class Zend_Form_Decorator_Abstract implements Zend_Form_Decorator_Inter
/**
* Remove single option
*
* @param mixed $key
*
* @param mixed $key
* @return void
*/
public function removeOption($key)
@ -157,7 +157,7 @@ abstract class Zend_Form_Decorator_Abstract implements Zend_Form_Decorator_Inter
/**
* Clear all options
*
*
* @return Zend_Form_Decorator_Abstract
*/
public function clearOptions()
@ -168,8 +168,8 @@ abstract class Zend_Form_Decorator_Abstract implements Zend_Form_Decorator_Inter
/**
* Set current form element
*
* @param Zend_Form_Element|Zend_Form $element
*
* @param Zend_Form_Element|Zend_Form $element
* @return Zend_Form_Decorator_Abstract
* @throws Zend_Form_Decorator_Exception on invalid element type
*/
@ -189,7 +189,7 @@ abstract class Zend_Form_Decorator_Abstract implements Zend_Form_Decorator_Inter
/**
* Retrieve current element
*
*
* @return Zend_Form_Element|Zend_Form
*/
public function getElement()
@ -199,7 +199,7 @@ abstract class Zend_Form_Decorator_Abstract implements Zend_Form_Decorator_Inter
/**
* Determine if decorator should append or prepend content
*
*
* @return string
*/
public function getPlacement()
@ -226,7 +226,7 @@ abstract class Zend_Form_Decorator_Abstract implements Zend_Form_Decorator_Inter
/**
* Retrieve separator to use between old and new content
*
*
* @return string
*/
public function getSeparator()
@ -241,7 +241,7 @@ abstract class Zend_Form_Decorator_Abstract implements Zend_Form_Decorator_Inter
/**
* Decorate content and/or element
*
*
* @param string $content
* @return string
* @throws Zend_Dorm_Decorator_Exception when unimplemented

View File

@ -25,28 +25,28 @@ require_once 'Zend/Form/Decorator/Abstract.php';
/**
* Zend_Form_Decorator_Callback
*
* Execute an arbitrary callback to decorate an element. Callbacks should take
* Execute an arbitrary callback to decorate an element. Callbacks should take
* three arguments, $content, $element, and $options:
*
* function mycallback($content, $element, array $options)
* {
* }
*
* and should return a string. ($options are whatever options were provided to
* and should return a string. ($options are whatever options were provided to
* the decorator.)
*
* To specify a callback, pass a valid callback as the 'callback' option.
*
* Callback results will be either appended, prepended, or replace the provided
* content. To replace the content, specify a placement of boolean false;
* content. To replace the content, specify a placement of boolean false;
* defaults to append content.
*
*
* @category Zend
* @package Zend_Form
* @subpackage Decorator
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Callback.php 16218 2009-06-21 19:44:04Z thomas $
* @version $Id: Callback.php 18951 2009-11-12 16:26:19Z alexander $
*/
class Zend_Form_Decorator_Callback extends Zend_Form_Decorator_Abstract
{
@ -58,8 +58,8 @@ class Zend_Form_Decorator_Callback extends Zend_Form_Decorator_Abstract
/**
* Set callback
*
* @param callback $callback
*
* @param callback $callback
* @return Zend_Form_Decorator_Callback
* @throws Zend_Form_Exception
*/
@ -76,9 +76,9 @@ class Zend_Form_Decorator_Callback extends Zend_Form_Decorator_Abstract
/**
* Get registered callback
*
* If not previously registered, checks to see if it exists in registered
* If not previously registered, checks to see if it exists in registered
* options.
*
*
* @return null|string|array
*/
public function getCallback()
@ -94,13 +94,13 @@ class Zend_Form_Decorator_Callback extends Zend_Form_Decorator_Abstract
}
/**
* Render
* Render
*
* If no callback registered, returns callback. Otherwise, gets return
* If no callback registered, returns callback. Otherwise, gets return
* value of callback and either appends, prepends, or replaces passed in
* content.
*
* @param string $content
* @param string $content
* @return string
*/
public function render($content)

View File

@ -24,7 +24,7 @@ require_once 'Zend/Form/Decorator/Abstract.php';
/**
* Captcha generic decorator
*
*
* Adds captcha adapter output
*
* @category Zend
@ -32,14 +32,14 @@ require_once 'Zend/Form/Decorator/Abstract.php';
* @subpackage Decorator
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Captcha.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Captcha.php 18951 2009-11-12 16:26:19Z alexander $
*/
class Zend_Form_Decorator_Captcha extends Zend_Form_Decorator_Abstract
{
/**
* Render captcha
*
* @param string $content
*
* @param string $content
* @return string
*/
public function render($content)

View File

@ -24,7 +24,7 @@ require_once 'Zend/Form/Decorator/Abstract.php';
/**
* Word-based captcha decorator
*
*
* Adds hidden field for ID and text input field for captcha text
*
* @category Zend
@ -32,14 +32,14 @@ require_once 'Zend/Form/Decorator/Abstract.php';
* @subpackage Element
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Word.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Word.php 18951 2009-11-12 16:26:19Z alexander $
*/
class Zend_Form_Decorator_Captcha_Word extends Zend_Form_Decorator_Abstract
{
/**
* Render captcha
*
* @param string $content
*
* @param string $content
* @return string
*/
public function render($content)
@ -54,10 +54,10 @@ class Zend_Form_Decorator_Captcha_Word extends Zend_Form_Decorator_Abstract
$hiddenName = $name . '[id]';
$textName = $name . '[input]';
$label = $element->getDecorator("Label");
if($label) {
$label->setOption("id", "$name-input");
$label->setOption("id", "$name-input");
}
$placement = $this->getPlacement();

View File

@ -33,13 +33,13 @@ require_once 'Zend/Form/Decorator/Abstract.php';
* - escape: whether or not to escape description (true by default)
*
* Any other options passed will be used as HTML attributes of the HTML tag used.
*
*
* @category Zend
* @package Zend_Form
* @subpackage Decorator
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Description.php 16218 2009-06-21 19:44:04Z thomas $
* @version $Id: Description.php 18951 2009-11-12 16:26:19Z alexander $
*/
class Zend_Form_Decorator_Description extends Zend_Form_Decorator_Abstract
{
@ -63,8 +63,8 @@ class Zend_Form_Decorator_Description extends Zend_Form_Decorator_Abstract
/**
* Set HTML tag with which to surround description
*
* @param string $tag
*
* @param string $tag
* @return Zend_Form_Decorator_Description
*/
public function setTag($tag)
@ -75,7 +75,7 @@ class Zend_Form_Decorator_Description extends Zend_Form_Decorator_Abstract
/**
* Get HTML tag, if any, with which to surround description
*
*
* @return string
*/
public function getTag()
@ -99,7 +99,7 @@ class Zend_Form_Decorator_Description extends Zend_Form_Decorator_Abstract
* Get class with which to define description
*
* Defaults to 'hint'
*
*
* @return string
*/
public function getClass()
@ -115,8 +115,8 @@ class Zend_Form_Decorator_Description extends Zend_Form_Decorator_Abstract
/**
* Set whether or not to escape description
*
* @param bool $flag
*
* @param bool $flag
* @return Zend_Form_Decorator_Description
*/
public function setEscape($flag)
@ -127,7 +127,7 @@ class Zend_Form_Decorator_Description extends Zend_Form_Decorator_Abstract
/**
* Get escape flag
*
*
* @return true
*/
public function getEscape()
@ -146,8 +146,8 @@ class Zend_Form_Decorator_Description extends Zend_Form_Decorator_Abstract
/**
* Render a description
*
* @param string $content
*
* @param string $content
* @return string
*/
public function render($content)

View File

@ -26,20 +26,20 @@ require_once 'Zend/Form/Decorator/Abstract.php';
* Zend_Form_Decorator_Errors
*
* Any options passed will be used as HTML attributes of the ul tag for the errors.
*
*
* @category Zend
* @package Zend_Form
* @subpackage Decorator
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Errors.php 16218 2009-06-21 19:44:04Z thomas $
* @version $Id: Errors.php 18951 2009-11-12 16:26:19Z alexander $
*/
class Zend_Form_Decorator_Errors extends Zend_Form_Decorator_Abstract
{
/**
* Render errors
*
* @param string $content
*
* @param string $content
* @return string
*/
public function render($content)
@ -57,7 +57,7 @@ class Zend_Form_Decorator_Errors extends Zend_Form_Decorator_Abstract
$separator = $this->getSeparator();
$placement = $this->getPlacement();
$errors = $view->formErrors($errors, $this->getOptions());
$errors = $view->formErrors($errors, $this->getOptions());
switch ($placement) {
case self::APPEND:

View File

@ -26,13 +26,13 @@ require_once 'Zend/Form/Decorator/Abstract.php';
* Zend_Form_Decorator_Fieldset
*
* Any options passed will be used as HTML attributes of the fieldset tag.
*
*
* @category Zend
* @package Zend_Form
* @subpackage Decorator
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Fieldset.php 16218 2009-06-21 19:44:04Z thomas $
* @version $Id: Fieldset.php 18951 2009-11-12 16:26:19Z alexander $
*/
class Zend_Form_Decorator_Fieldset extends Zend_Form_Decorator_Abstract
{
@ -64,7 +64,7 @@ class Zend_Form_Decorator_Fieldset extends Zend_Form_Decorator_Abstract
* Get options
*
* Merges in element attributes as well.
*
*
* @return array
*/
public function getOptions()
@ -80,8 +80,8 @@ class Zend_Form_Decorator_Fieldset extends Zend_Form_Decorator_Abstract
/**
* Set legend
*
* @param string $value
*
* @param string $value
* @return Zend_Form_Decorator_Fieldset
*/
public function setLegend($value)
@ -92,7 +92,7 @@ class Zend_Form_Decorator_Fieldset extends Zend_Form_Decorator_Abstract
/**
* Get legend
*
*
* @return string
*/
public function getLegend()
@ -114,8 +114,8 @@ class Zend_Form_Decorator_Fieldset extends Zend_Form_Decorator_Abstract
/**
* Render a fieldset
*
* @param string $content
*
* @param string $content
* @return string
*/
public function render($content)

View File

@ -25,7 +25,7 @@ require_once 'Zend/Form/Decorator/Abstract.php';
/**
* Zend_Form_Decorator_Form
*
* Render a Zend_Form object.
* Render a Zend_Form object.
*
* Accepts following options:
* - separator: Separator to use between elements
@ -33,13 +33,13 @@ require_once 'Zend/Form/Decorator/Abstract.php';
* arguments, string content, a name, and an array of attributes.
*
* Any other options passed will be used as HTML attributes of the form tag.
*
*
* @category Zend
* @package Zend_Form
* @subpackage Decorator
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Form.php 16218 2009-06-21 19:44:04Z thomas $
* @version $Id: Form.php 18951 2009-11-12 16:26:19Z alexander $
*/
class Zend_Form_Decorator_Form extends Zend_Form_Decorator_Abstract
{
@ -51,8 +51,8 @@ class Zend_Form_Decorator_Form extends Zend_Form_Decorator_Abstract
/**
* Set view helper for rendering form
*
* @param string $helper
*
* @param string $helper
* @return Zend_Form_Decorator_Form
*/
public function setHelper($helper)
@ -63,7 +63,7 @@ class Zend_Form_Decorator_Form extends Zend_Form_Decorator_Abstract
/**
* Get view helper for rendering form
*
*
* @return string
*/
public function getHelper()
@ -78,9 +78,9 @@ class Zend_Form_Decorator_Form extends Zend_Form_Decorator_Abstract
/**
* Retrieve decorator options
*
* Assures that form action and method are set, and sets appropriate
* Assures that form action and method are set, and sets appropriate
* encoding type if current method is POST.
*
*
* @return array
*/
public function getOptions()
@ -113,8 +113,8 @@ class Zend_Form_Decorator_Form extends Zend_Form_Decorator_Abstract
* Render a form
*
* Replaces $content entirely from currently set element.
*
* @param string $content
*
* @param string $content
* @return string
*/
public function render($content)
@ -129,6 +129,6 @@ class Zend_Form_Decorator_Form extends Zend_Form_Decorator_Abstract
$attribs = $this->getOptions();
$name = $form->getFullyQualifiedName();
$attribs['id'] = $form->getId();
return $view->$helper($name, $attribs, $content);
return $view->$helper($name, $attribs, $content);
}
}

View File

@ -37,7 +37,7 @@ require_once 'Zend/Form/Decorator/Abstract.php';
* @subpackage Decorator
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: FormElements.php 16218 2009-06-21 19:44:04Z thomas $
* @version $Id: FormElements.php 18951 2009-11-12 16:26:19Z alexander $
*/
class Zend_Form_Decorator_FormElements extends Zend_Form_Decorator_Abstract
{
@ -101,7 +101,7 @@ class Zend_Form_Decorator_FormElements extends Zend_Form_Decorator_Abstract
$items[] = $item->render();
if (($item instanceof Zend_Form_Element_File)
|| (($item instanceof Zend_Form)
|| (($item instanceof Zend_Form)
&& (Zend_Form::ENCTYPE_MULTIPART == $item->getEnctype()))
|| (($item instanceof Zend_Form_DisplayGroup)
&& (Zend_Form::ENCTYPE_MULTIPART == $item->getAttrib('enctype')))

View File

@ -28,13 +28,13 @@ require_once 'Zend/Form/Decorator/Abstract.php';
* Displays all form errors in one view.
*
* Any options passed will be used as HTML attributes of the ul tag for the errors.
*
*
* @category Zend
* @package Zend_Form
* @subpackage Decorator
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: FormErrors.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: FormErrors.php 18951 2009-11-12 16:26:19Z alexander $
*/
class Zend_Form_Decorator_FormErrors extends Zend_Form_Decorator_Abstract
{
@ -67,8 +67,8 @@ class Zend_Form_Decorator_FormErrors extends Zend_Form_Decorator_Abstract
/**
* Render errors
*
* @param string $content
*
* @param string $content
* @return string
*/
public function render($content)
@ -104,7 +104,7 @@ class Zend_Form_Decorator_FormErrors extends Zend_Form_Decorator_Abstract
/**
* Initialize options
*
*
* @return void
*/
public function initOptions()
@ -339,9 +339,9 @@ class Zend_Form_Decorator_FormErrors extends Zend_Form_Decorator_Abstract
/**
* Render element label
*
* @param Zend_Form_Element $element
* @param Zend_View_Interface $view
*
* @param Zend_Form_Element $element
* @param Zend_View_Interface $view
* @return string
*/
public function renderLabel(Zend_Form_Element $element, Zend_View_Interface $view)
@ -358,9 +358,9 @@ class Zend_Form_Decorator_FormErrors extends Zend_Form_Decorator_Abstract
/**
* Recurse through a form object, rendering errors
*
* @param Zend_Form $form
* @param Zend_View_Interface $view
*
* @param Zend_Form $form
* @param Zend_View_Interface $view
* @return string
*/
protected function _recurseForm(Zend_Form $form, Zend_View_Interface $view)

View File

@ -32,20 +32,20 @@ require_once 'Zend/Form/Decorator/Abstract.php';
* Options accepted are:
* - tag: tag to use in decorator
* - noAttribs: do not render attributes in the opening tag
* - placement: 'append' or 'prepend'. If 'append', renders opening and
* - placement: 'append' or 'prepend'. If 'append', renders opening and
* closing tag after content; if prepend, renders opening and closing tag
* before content.
* - openOnly: render opening tag only
* - closeOnly: render closing tag only
*
* Any other options passed are processed as HTML attributes of the tag.
*
*
* @category Zend
* @package Zend_Form
* @subpackage Decorator
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: HtmlTag.php 16218 2009-06-21 19:44:04Z thomas $
* @version $Id: HtmlTag.php 18951 2009-11-12 16:26:19Z alexander $
*/
class Zend_Form_Decorator_HtmlTag extends Zend_Form_Decorator_Abstract
{
@ -68,7 +68,7 @@ class Zend_Form_Decorator_HtmlTag extends Zend_Form_Decorator_Abstract
/**
* Convert options to tag attributes
*
*
* @return string
*/
protected function _htmlAttribs(array $attribs)
@ -89,8 +89,8 @@ class Zend_Form_Decorator_HtmlTag extends Zend_Form_Decorator_Abstract
* Normalize tag
*
* Ensures tag is alphanumeric characters only, and all lowercase.
*
* @param string $tag
*
* @param string $tag
* @return string
*/
public function normalizeTag($tag)
@ -108,8 +108,8 @@ class Zend_Form_Decorator_HtmlTag extends Zend_Form_Decorator_Abstract
/**
* Set tag to use
*
* @param string $tag
*
* @param string $tag
* @return Zend_Form_Decorator_HtmlTag
*/
public function setTag($tag)
@ -122,7 +122,7 @@ class Zend_Form_Decorator_HtmlTag extends Zend_Form_Decorator_Abstract
* Get tag
*
* If no tag is registered, either via setTag() or as an option, uses 'div'.
*
*
* @return string
*/
public function getTag()
@ -141,9 +141,9 @@ class Zend_Form_Decorator_HtmlTag extends Zend_Form_Decorator_Abstract
/**
* Get the formatted open tag
*
* @param string $tag
* @param array $attribs
*
* @param string $tag
* @param array $attribs
* @return string
*/
protected function _getOpenTag($tag, array $attribs = null)
@ -158,8 +158,8 @@ class Zend_Form_Decorator_HtmlTag extends Zend_Form_Decorator_Abstract
/**
* Get formatted closing tag
*
* @param string $tag
*
* @param string $tag
* @return string
*/
protected function _getCloseTag($tag)
@ -169,8 +169,8 @@ class Zend_Form_Decorator_HtmlTag extends Zend_Form_Decorator_Abstract
/**
* Render content wrapped in an HTML tag
*
* @param string $content
*
* @param string $content
* @return string
*/
public function render($content)
@ -197,8 +197,8 @@ class Zend_Form_Decorator_HtmlTag extends Zend_Form_Decorator_Abstract
if ($openOnly) {
return $content . $this->_getOpenTag($tag, $attribs);
}
return $content
. $this->_getOpenTag($tag, $attribs)
return $content
. $this->_getOpenTag($tag, $attribs)
. $this->_getCloseTag($tag);
case self::PREPEND:
if ($closeOnly) {

View File

@ -31,13 +31,13 @@ require_once 'Zend/Form/Decorator/Abstract.php';
* - tag: if set, used to wrap the label in an additional HTML tag
*
* Any other options passed will be used as HTML attributes of the image tag.
*
*
* @category Zend
* @package Zend_Form
* @subpackage Decorator
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Image.php 16218 2009-06-21 19:44:04Z thomas $
* @version $Id: Image.php 18951 2009-11-12 16:26:19Z alexander $
*/
class Zend_Form_Decorator_Image extends Zend_Form_Decorator_Abstract
{
@ -61,8 +61,8 @@ class Zend_Form_Decorator_Image extends Zend_Form_Decorator_Abstract
/**
* Set HTML tag with which to surround label
*
* @param string $tag
*
* @param string $tag
* @return Zend_Form_Decorator_Image
*/
public function setTag($tag)
@ -73,7 +73,7 @@ class Zend_Form_Decorator_Image extends Zend_Form_Decorator_Abstract
/**
* Get HTML tag, if any, with which to surround label
*
*
* @return void
*/
public function getTag()
@ -92,7 +92,7 @@ class Zend_Form_Decorator_Image extends Zend_Form_Decorator_Abstract
/**
* Get attributes to pass to image helper
*
*
* @return array
*/
public function getAttribs()
@ -115,8 +115,8 @@ class Zend_Form_Decorator_Image extends Zend_Form_Decorator_Abstract
/**
* Render a form image
*
* @param string $content
*
* @param string $content
* @return string
*/
public function render($content)
@ -134,7 +134,7 @@ class Zend_Form_Decorator_Image extends Zend_Form_Decorator_Abstract
$attribs = $this->getAttribs();
$attribs['id'] = $element->getId();
$image = $view->formImage($name, $element->getImageValue(), $attribs);
$image = $view->formImage($name, $element->getImageValue(), $attribs);
if (null !== $tag) {
require_once 'Zend/Form/Decorator/HtmlTag.php';

View File

@ -20,13 +20,13 @@
/**
* Zend_Form_Decorator_Interface
*
*
* @category Zend
* @package Zend_Form
* @subpackage Decorator
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Interface.php 16218 2009-06-21 19:44:04Z thomas $
* @version $Id: Interface.php 18951 2009-11-12 16:26:19Z alexander $
*/
interface Zend_Form_Decorator_Interface
{
@ -34,8 +34,8 @@ interface Zend_Form_Decorator_Interface
* Constructor
*
* Accept options during initialization.
*
* @param array|Zend_Config $options
*
* @param array|Zend_Config $options
* @return void
*/
public function __construct($options = null);
@ -43,79 +43,79 @@ interface Zend_Form_Decorator_Interface
/**
* Set an element to decorate
*
* While the name is "setElement", a form decorator could decorate either
* While the name is "setElement", a form decorator could decorate either
* an element or a form object.
*
* @param mixed $element
*
* @param mixed $element
* @return Zend_Form_Decorator_Interface
*/
public function setElement($element);
/**
* Retrieve current element
*
*
* @return mixed
*/
public function getElement();
/**
* Set decorator options from an array
*
* @param array $options
*
* @param array $options
* @return Zend_Form_Decorator_Interface
*/
public function setOptions(array $options);
/**
* Set decorator options from a config object
*
* @param Zend_Config $config
*
* @param Zend_Config $config
* @return Zend_Form_Decorator_Interface
*/
public function setConfig(Zend_Config $config);
/**
* Set a single option
*
* @param string $key
* @param mixed $value
*
* @param string $key
* @param mixed $value
* @return Zend_Form_Decorator_Interface
*/
public function setOption($key, $value);
/**
* Retrieve a single option
*
* @param string $key
*
* @param string $key
* @return mixed
*/
public function getOption($key);
/**
* Retrieve decorator options
*
*
* @return array
*/
public function getOptions();
/**
* Delete a single option
*
* @param string $key
*
* @param string $key
* @return bool
*/
public function removeOption($key);
/**
* Clear all options
*
*
* @return Zend_Form_Decorator_Interface
*/
public function clearOptions();
/**
* Render the element
*
*
* @param string $content Content to decorate
* @return string
*/

View File

@ -41,7 +41,7 @@ require_once 'Zend/Form/Decorator/Abstract.php';
* @subpackage Decorator
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Label.php 16218 2009-06-21 19:44:04Z thomas $
* @version $Id: Label.php 19050 2009-11-19 18:22:31Z matthew $
*/
class Zend_Form_Decorator_Label extends Zend_Form_Decorator_Abstract
{
@ -103,6 +103,9 @@ class Zend_Form_Decorator_Label extends Zend_Form_Decorator_Abstract
} else {
$this->_tag = (string) $tag;
}
$this->removeOption('tag');
return $this;
}

View File

@ -31,20 +31,20 @@ require_once 'Zend/Form/Decorator/FormElements.php';
* - separator: Separator to use between elements
*
* Any other options passed will be used as HTML attributes of the form tag.
*
*
* @category Zend
* @package Zend_Form
* @subpackage Decorator
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: PrepareElements.php 16218 2009-06-21 19:44:04Z thomas $
* @version $Id: PrepareElements.php 18951 2009-11-12 16:26:19Z alexander $
*/
class Zend_Form_Decorator_PrepareElements extends Zend_Form_Decorator_FormElements
{
/**
* Render form elements
*
* @param string $content
* @param string $content
* @return string
*/
public function render($content)

View File

@ -41,18 +41,18 @@ class Zend_Form_Decorator_Tooltip extends Zend_Form_Decorator_Abstract
* and if the translator is not disable on the element being rendered.
*
* @param string $content
* @return string
* @return string
*/
public function render($content)
public function render($content)
{
if (null !== ($title = $this->getElement()->getAttrib('title'))) {
if (null !== ($translator = $this->getElement()->getTranslator())) {
$title = $translator->translate($title);
}
}
if (null !== ($title = $this->getElement()->getAttrib('title'))) {
if (null !== ($translator = $this->getElement()->getTranslator())) {
$title = $translator->translate($title);
}
}
$this->getElement()->setAttrib('title', $title);
return $content;
return $content;
}
}

View File

@ -31,15 +31,15 @@ require_once 'Zend/Form/Decorator/Abstract.php';
* - placement: whether to append or prepend the generated content to the passed in content
* - helper: the name of the view helper to use
*
* Assumes the view helper accepts three parameters, the name, value, and
* Assumes the view helper accepts three parameters, the name, value, and
* optional attributes; these will be provided by the element.
*
*
* @category Zend
* @package Zend_Form
* @subpackage Decorator
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: ViewHelper.php 16218 2009-06-21 19:44:04Z thomas $
* @version $Id: ViewHelper.php 18951 2009-11-12 16:26:19Z alexander $
*/
class Zend_Form_Decorator_ViewHelper extends Zend_Form_Decorator_Abstract
{
@ -61,8 +61,8 @@ class Zend_Form_Decorator_ViewHelper extends Zend_Form_Decorator_Abstract
/**
* Set view helper to use when rendering
*
* @param string $helper
*
* @param string $helper
* @return Zend_Form_Decorator_Element_ViewHelper
*/
public function setHelper($helper)
@ -105,9 +105,9 @@ class Zend_Form_Decorator_ViewHelper extends Zend_Form_Decorator_Abstract
/**
* Get name
*
* If element is a Zend_Form_Element, will attempt to namespace it if the
* If element is a Zend_Form_Element, will attempt to namespace it if the
* element belongs to an array.
*
*
* @return string
*/
public function getName()
@ -139,7 +139,7 @@ class Zend_Form_Decorator_ViewHelper extends Zend_Form_Decorator_Abstract
* Retrieve element attributes
*
* Set id to element name and/or array item.
*
*
* @return array
*/
public function getElementAttribs()
@ -182,8 +182,8 @@ class Zend_Form_Decorator_ViewHelper extends Zend_Form_Decorator_Abstract
* Get value
*
* If element type is one of the button types, returns the label.
*
* @param Zend_Form_Element $element
*
* @param Zend_Form_Element $element
* @return string|null
*/
public function getValue($element)
@ -208,10 +208,10 @@ class Zend_Form_Decorator_ViewHelper extends Zend_Form_Decorator_Abstract
/**
* Render an element using a view helper
*
* Determine view helper from 'viewHelper' option, or, if none set, from
* the element type. Then call as
* Determine view helper from 'viewHelper' option, or, if none set, from
* the element type. Then call as
* helper($element->getName(), $element->getValue(), $element->getAttribs())
*
*
* @param string $content
* @return string
* @throws Zend_Form_Decorator_Exception if element or view are not registered

View File

@ -32,14 +32,14 @@ require_once 'Zend/Form/Decorator/Abstract.php';
* - placement: whether to append or prepend view script content to provided content (defaults to prepend)
* - viewScript: view script to use
*
* The view script is rendered as a partial; the element being decorated is
* The view script is rendered as a partial; the element being decorated is
* passed in as the 'element' variable:
* <code>
* // in view script:
* echo $this->element->getLabel();
* </code>
*
* Any options other than separator, placement, and viewScript are passed to
* Any options other than separator, placement, and viewScript are passed to
* the partial as local variables.
*
* @category Zend
@ -47,7 +47,7 @@ require_once 'Zend/Form/Decorator/Abstract.php';
* @subpackage Decorator
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: ViewScript.php 16218 2009-06-21 19:44:04Z thomas $
* @version $Id: ViewScript.php 18951 2009-11-12 16:26:19Z alexander $
*/
class Zend_Form_Decorator_ViewScript extends Zend_Form_Decorator_Abstract
{
@ -65,8 +65,8 @@ class Zend_Form_Decorator_ViewScript extends Zend_Form_Decorator_Abstract
/**
* Set view script
*
* @param string $script
*
* @param string $script
* @return Zend_Form_Decorator_ViewScript
*/
public function setViewScript($script)
@ -77,7 +77,7 @@ class Zend_Form_Decorator_ViewScript extends Zend_Form_Decorator_Abstract
/**
* Get view script
*
*
* @return string|null
*/
public function getViewScript()
@ -101,8 +101,8 @@ class Zend_Form_Decorator_ViewScript extends Zend_Form_Decorator_Abstract
/**
* Render a view script
*
* @param string $content
*
* @param string $content
* @return string
*/
public function render($content)

View File

@ -20,12 +20,12 @@
/**
* Zend_Form_DisplayGroup
*
*
* @category Zend
* @package Zend_Form
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: DisplayGroup.php 16218 2009-06-21 19:44:04Z thomas $
* @version $Id: DisplayGroup.php 18951 2009-11-12 16:26:19Z alexander $
*/
class Zend_Form_DisplayGroup implements Iterator,Countable
{
@ -107,10 +107,10 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Constructor
*
* @param string $name
* @param Zend_Loader_PluginLoader $loader
* @param array|Zend_Config $options
*
* @param string $name
* @param Zend_Loader_PluginLoader $loader
* @param array|Zend_Config $options
* @return void
*/
public function __construct($name, Zend_Loader_PluginLoader $loader, $options = null)
@ -133,7 +133,7 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Initialize object; used by extending classes
*
*
* @return void
*/
public function init()
@ -142,8 +142,8 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Set options
*
* @param array $options
*
* @param array $options
* @return Zend_Form_DisplayGroup
*/
public function setOptions(array $options)
@ -171,8 +171,8 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Set options from config object
*
* @param Zend_Config $config
*
* @param Zend_Config $config
* @return Zend_Form_DisplayGroup
*/
public function setConfig(Zend_Config $config)
@ -182,9 +182,9 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Set group attribute
*
* @param string $key
* @param mixed $value
*
* @param string $key
* @param mixed $value
* @return Zend_Form_DisplayGroup
*/
public function setAttrib($key, $value)
@ -196,8 +196,8 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Add multiple form attributes at once
*
* @param array $attribs
*
* @param array $attribs
* @return Zend_Form_DisplayGroup
*/
public function addAttribs(array $attribs)
@ -212,8 +212,8 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
* Set multiple form attributes at once
*
* Overwrites any previously set attributes.
*
* @param array $attribs
*
* @param array $attribs
* @return Zend_Form_DisplayGroup
*/
public function setAttribs(array $attribs)
@ -224,8 +224,8 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Retrieve a single form attribute
*
* @param string $key
*
* @param string $key
* @return mixed
*/
public function getAttrib($key)
@ -240,7 +240,7 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Retrieve all form attributes/metadata
*
*
* @return array
*/
public function getAttribs()
@ -250,8 +250,8 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Remove attribute
*
* @param string $key
*
* @param string $key
* @return bool
*/
public function removeAttrib($key)
@ -266,7 +266,7 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Clear all form attributes
*
*
* @return Zend_Form
*/
public function clearAttribs()
@ -277,8 +277,8 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Filter a name to only allow valid variable characters
*
* @param string $value
*
* @param string $value
* @return string
*/
public function filterName($value)
@ -288,8 +288,8 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Set group name
*
* @param string $name
*
* @param string $name
* @return Zend_Form_DisplayGroup
*/
public function setName($name)
@ -306,7 +306,7 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Retrieve group name
*
*
* @return string
*/
public function getName()
@ -318,7 +318,7 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
* Get fully qualified name
*
* Places name as subitem of array and/or appends brackets.
*
*
* @return string
*/
public function getFullyQualifiedName()
@ -328,7 +328,7 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Get element id
*
*
* @return string
*/
public function getId()
@ -357,8 +357,8 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Set group legend
*
* @param string $legend
*
* @param string $legend
* @return Zend_Form_DisplayGroup
*/
public function setLegend($legend)
@ -368,7 +368,7 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Retrieve group legend
*
*
* @return string
*/
public function getLegend()
@ -378,8 +378,8 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Set description
*
* @param string $value
*
* @param string $value
* @return Zend_Form_DisplayGroup
*/
public function setDescription($value)
@ -390,7 +390,7 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Get description
*
*
* @return string
*/
public function getDescription()
@ -400,8 +400,8 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Set group order
*
* @param int $order
*
* @param int $order
* @return Zend_Form_Element
*/
public function setOrder($order)
@ -412,7 +412,7 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Retrieve group order
*
*
* @return int
*/
public function getOrder()
@ -424,8 +424,8 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Add element to stack
*
* @param Zend_Form_Element $element
*
* @param Zend_Form_Element $element
* @return Zend_Form_DisplayGroup
*/
public function addElement(Zend_Form_Element $element)
@ -437,8 +437,8 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Add multiple elements at once
*
* @param array $elements
*
* @param array $elements
* @return Zend_Form_DisplayGroup
* @throws Zend_Form_Exception if any element is not a Zend_Form_Element
*/
@ -456,8 +456,8 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Set multiple elements at once (overwrites)
*
* @param array $elements
*
* @param array $elements
* @return Zend_Form_DisplayGroup
*/
public function setElements(array $elements)
@ -468,8 +468,8 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Retrieve element
*
* @param string $name
*
* @param string $name
* @return Zend_Form_Element|null
*/
public function getElement($name)
@ -493,8 +493,8 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Remove a single element
*
* @param string $name
*
* @param string $name
* @return boolean
*/
public function removeElement($name)
@ -511,7 +511,7 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Remove all elements
*
*
* @return Zend_Form_DisplayGroup
*/
public function clearElements()
@ -525,8 +525,8 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Set plugin loader
*
* @param Zend_Loader_PluginLoader $loader
*
* @param Zend_Loader_PluginLoader $loader
* @return Zend_Form_DisplayGroup
*/
public function setPluginLoader(Zend_Loader_PluginLoader $loader)
@ -537,7 +537,7 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Retrieve plugin loader
*
*
* @return Zend_Loader_PluginLoader
*/
public function getPluginLoader()
@ -547,9 +547,9 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Add a prefix path for the plugin loader
*
* @param string $prefix
* @param string $path
*
* @param string $prefix
* @param string $path
* @return Zend_Form_DisplayGroup
*/
public function addPrefixPath($prefix, $path)
@ -560,15 +560,15 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Add several prefix paths at once
*
* @param array $spec
*
* @param array $spec
* @return Zend_Form_DisplayGroup
*/
public function addPrefixPaths(array $spec)
{
if (isset($spec['prefix']) && isset($spec['path'])) {
return $this->addPrefixPath($spec['prefix'], $spec['path']);
}
}
foreach ($spec as $prefix => $paths) {
if (is_numeric($prefix) && is_array($paths)) {
$prefix = null;
@ -592,8 +592,8 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Set flag to disable loading default decorators
*
* @param bool $flag
*
* @param bool $flag
* @return Zend_Form_Element
*/
public function setDisableLoadDefaultDecorators($flag)
@ -604,7 +604,7 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Should we load the default decorators?
*
*
* @return bool
*/
public function loadDefaultDecoratorsIsDisabled()
@ -614,7 +614,7 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Load default decorators
*
*
* @return void
*/
public function loadDefaultDecorators()
@ -634,9 +634,9 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Instantiate a decorator based on class name or class name fragment
*
* @param string $name
* @param null|array $options
*
* @param string $name
* @param null|array $options
* @return Zend_Form_Decorator_Interface
*/
protected function _getDecorator($name, $options = null)
@ -653,8 +653,8 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Add a decorator for rendering the group
*
* @param string|Zend_Form_Decorator_Interface $decorator
*
* @param string|Zend_Form_Decorator_Interface $decorator
* @param array|Zend_Config $options Options with which to initialize decorator
* @return Zend_Form_DisplayGroup
*/
@ -696,8 +696,8 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Add many decorators at once
*
* @param array $decorators
*
* @param array $decorators
* @return Zend_Form_DisplayGroup
*/
public function addDecorators(array $decorators)
@ -740,8 +740,8 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Overwrite all decorators
*
* @param array $decorators
*
* @param array $decorators
* @return Zend_Form_DisplayGroup
*/
public function setDecorators(array $decorators)
@ -752,8 +752,8 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Retrieve a registered decorator
*
* @param string $name
*
* @param string $name
* @return false|Zend_Form_Decorator_Abstract
*/
public function getDecorator($name)
@ -784,7 +784,7 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Retrieve all decorators
*
*
* @return array
*/
public function getDecorators()
@ -799,8 +799,8 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Remove a single decorator
*
* @param string $name
*
* @param string $name
* @return bool
*/
public function removeDecorator($name)
@ -821,7 +821,7 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Clear all decorators
*
*
* @return Zend_Form_DisplayGroup
*/
public function clearDecorators()
@ -832,8 +832,8 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Set view
*
* @param Zend_View_Interface $view
*
* @param Zend_View_Interface $view
* @return Zend_Form_DisplayGroup
*/
public function setView(Zend_View_Interface $view = null)
@ -844,7 +844,7 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Retrieve view
*
*
* @return Zend_View_Interface
*/
public function getView()
@ -860,7 +860,7 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Render display group
*
*
* @return string
*/
public function render(Zend_View_Interface $view = null)
@ -878,7 +878,7 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* String representation of group
*
*
* @return string
*/
public function __toString()
@ -894,8 +894,8 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Set translator object
*
* @param Zend_Translate|Zend_Translate_Adapter|null $translator
*
* @param Zend_Translate|Zend_Translate_Adapter|null $translator
* @return Zend_Form_DisplayGroup
*/
public function setTranslator($translator = null)
@ -913,7 +913,7 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Retrieve translator object
*
*
* @return Zend_Translate_Adapter|null
*/
public function getTranslator()
@ -932,8 +932,8 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Indicate whether or not translation should be disabled
*
* @param bool $flag
*
* @param bool $flag
* @return Zend_Form_DisplayGroup
*/
public function setDisableTranslator($flag)
@ -944,7 +944,7 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Is translation disabled?
*
*
* @return bool
*/
public function translatorIsDisabled()
@ -956,9 +956,9 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
* Overloading: allow rendering specific decorators
*
* Call renderDecoratorName() to render a specific decorator.
*
* @param string $method
* @param array $args
*
* @param string $method
* @param array $args
* @return string
* @throws Zend_Form_Exception for invalid decorator or invalid method call
*/
@ -987,7 +987,7 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Current element
*
*
* @return Zend_Form_Element
*/
public function current()
@ -1000,7 +1000,7 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Current element
*
*
* @return string
*/
public function key()
@ -1011,7 +1011,7 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Move pointer to next element
*
*
* @return void
*/
public function next()
@ -1022,7 +1022,7 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Move pointer to beginning of element loop
*
*
* @return void
*/
public function rewind()
@ -1033,7 +1033,7 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Determine if current element/subform/display group is valid
*
*
* @return bool
*/
public function valid()
@ -1044,7 +1044,7 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Count of elements/subforms that are iterable
*
*
* @return int
*/
public function count()
@ -1054,7 +1054,7 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Sort items according to their order
*
*
* @return void
*/
protected function _sort()
@ -1088,7 +1088,7 @@ class Zend_Form_DisplayGroup implements Iterator,Countable
/**
* Lazy-load a decorator
*
*
* @param array $decorator Decorator type and options
* @param mixed $name Decorator name or alias
* @return Zend_Form_Decorator_Interface

View File

@ -32,7 +32,7 @@ require_once 'Zend/Validate/Interface.php';
* @subpackage Element
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Element.php 17506 2009-08-10 11:30:24Z yoshida@zend.co.jp $
* @version $Id: Element.php 19130 2009-11-20 19:28:00Z matthew $
*/
class Zend_Form_Element implements Zend_Validate_Interface
{
@ -97,6 +97,13 @@ class Zend_Form_Element implements Zend_Validate_Interface
*/
protected $_errors = array();
/**
* Separator to use when concatenating aggregate error messages (for
* elements having array values)
* @var string
*/
protected $_errorMessageSeparator = '; ';
/**
* Element filters
* @var array
@ -121,6 +128,12 @@ class Zend_Form_Element implements Zend_Validate_Interface
*/
protected $_isError = false;
/**
* Has the element been manually marked as invalid?
* @var bool
*/
protected $_isErrorForced = false;
/**
* Element label
* @var string
@ -197,6 +210,16 @@ class Zend_Form_Element implements Zend_Validate_Interface
*/
protected $_view;
/**
* Is a specific decorator being rendered via the magic renderDecorator()?
*
* This is to allow execution of logic inside the render() methods of child
* elements during the magic call while skipping the parent render() method.
*
* @var bool
*/
protected $_isPartialRendering = false;
/**
* Constructor
*
@ -900,6 +923,9 @@ class Zend_Form_Element implements Zend_Validate_Interface
public function __call($method, $args)
{
if ('render' == substr($method, 0, 6)) {
$this->_isPartialRendering = true;
$this->render();
$this->_isPartialRendering = false;
$decoratorName = substr($method, 6);
if (false !== ($decorator = $this->getDecorator($decoratorName))) {
$decorator->setElement($this);
@ -1339,6 +1365,11 @@ class Zend_Form_Element implements Zend_Validate_Interface
}
}
// If element manually flagged as invalid, return false
if ($this->_isErrorForced) {
return false;
}
return $result;
}
@ -1401,6 +1432,28 @@ class Zend_Form_Element implements Zend_Validate_Interface
return $this;
}
/**
* Get errorMessageSeparator
*
* @return string
*/
public function getErrorMessageSeparator()
{
return $this->_errorMessageSeparator;
}
/**
* Set errorMessageSeparator
*
* @param string $separator
* @return Zend_Form_Element
*/
public function setErrorMessageSeparator($separator)
{
$this->_errorMessageSeparator = $separator;
return $this;
}
/**
* Mark the element as being in a failed validation state
*
@ -1416,6 +1469,7 @@ class Zend_Form_Element implements Zend_Validate_Interface
} else {
$this->_messages = $messages;
}
$this->_isErrorForced = true;
return $this;
}
@ -1903,6 +1957,10 @@ class Zend_Form_Element implements Zend_Validate_Interface
*/
public function render(Zend_View_Interface $view = null)
{
if ($this->_isPartialRendering) {
return '';
}
if (null !== $view) {
$this->setView($view);
}
@ -2099,12 +2157,14 @@ class Zend_Form_Element implements Zend_Validate_Interface
if (null !== $translator) {
$message = $translator->translate($message);
}
if ($this->isArray() || is_array($value)) {
if (($this->isArray() || is_array($value))
&& !empty($value)
) {
$aggregateMessages = array();
foreach ($value as $val) {
$aggregateMessages[] = str_replace('%value%', $val, $message);
}
$messages[$key] = $aggregateMessages;
$messages[$key] = implode($this->getErrorMessageSeparator(), $aggregateMessages);
} else {
$messages[$key] = str_replace('%value%', $value, $message);
}

View File

@ -24,13 +24,13 @@ require_once 'Zend/Form/Element/Submit.php';
/**
* Button form element
*
*
* @category Zend
* @package Zend_Form
* @subpackage Element
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Button.php 16218 2009-06-21 19:44:04Z thomas $
* @version $Id: Button.php 18951 2009-11-12 16:26:19Z alexander $
*/
class Zend_Form_Element_Button extends Zend_Form_Element_Submit
{

View File

@ -24,13 +24,13 @@ require_once 'Zend/Form/Element/Xhtml.php';
/**
* Checkbox form element
*
*
* @category Zend
* @package Zend_Form
* @subpackage Element
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Checkbox.php 17716 2009-08-21 15:08:31Z matthew $
* @version $Id: Checkbox.php 18951 2009-11-12 16:26:19Z alexander $
*/
class Zend_Form_Element_Checkbox extends Zend_Form_Element_Xhtml
{
@ -76,10 +76,10 @@ class Zend_Form_Element_Checkbox extends Zend_Form_Element_Xhtml
/**
* Set options
*
* Intercept checked and unchecked values and set them early; test stored
* Intercept checked and unchecked values and set them early; test stored
* value against checked and unchecked values after configuration.
*
* @param array $options
*
* @param array $options
* @return Zend_Form_Element_Checkbox
*/
public function setOptions(array $options)
@ -109,11 +109,11 @@ class Zend_Form_Element_Checkbox extends Zend_Form_Element_Xhtml
* If value matches checked value, sets to that value, and sets the checked
* flag to true.
*
* Any other value causes the unchecked value to be set as the current
* Any other value causes the unchecked value to be set as the current
* value, and the checked flag to be set as false.
*
*
* @param mixed $value
*
* @param mixed $value
* @return Zend_Form_Element_Checkbox
*/
public function setValue($value)
@ -130,8 +130,8 @@ class Zend_Form_Element_Checkbox extends Zend_Form_Element_Xhtml
/**
* Set checked value
*
* @param string $value
*
* @param string $value
* @return Zend_Form_Element_Checkbox
*/
public function setCheckedValue($value)
@ -143,7 +143,7 @@ class Zend_Form_Element_Checkbox extends Zend_Form_Element_Xhtml
/**
* Get value when checked
*
*
* @return string
*/
public function getCheckedValue()
@ -153,8 +153,8 @@ class Zend_Form_Element_Checkbox extends Zend_Form_Element_Xhtml
/**
* Set unchecked value
*
* @param string $value
*
* @param string $value
* @return Zend_Form_Element_Checkbox
*/
public function setUncheckedValue($value)
@ -166,7 +166,7 @@ class Zend_Form_Element_Checkbox extends Zend_Form_Element_Xhtml
/**
* Get value when not checked
*
*
* @return string
*/
public function getUncheckedValue()
@ -176,8 +176,8 @@ class Zend_Form_Element_Checkbox extends Zend_Form_Element_Xhtml
/**
* Set checked flag
*
* @param bool $flag
*
* @param bool $flag
* @return Zend_Form_Element_Checkbox
*/
public function setChecked($flag)
@ -193,7 +193,7 @@ class Zend_Form_Element_Checkbox extends Zend_Form_Element_Xhtml
/**
* Get checked flag
*
*
* @return bool
*/
public function isChecked()

View File

@ -24,13 +24,13 @@ require_once 'Zend/Form/Element/Xhtml.php';
/**
* CSRF form protection
*
*
* @category Zend
* @package Zend_Form
* @subpackage Element
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Hash.php 16218 2009-06-21 19:44:04Z thomas $
* @version $Id: Hash.php 18951 2009-11-12 16:26:19Z alexander $
*/
class Zend_Form_Element_Hash extends Zend_Form_Element_Xhtml
{
@ -42,7 +42,7 @@ class Zend_Form_Element_Hash extends Zend_Form_Element_Xhtml
/**
* Actual hash used.
*
*
* @var mixed
*/
protected $_hash;
@ -67,11 +67,11 @@ class Zend_Form_Element_Hash extends Zend_Form_Element_Xhtml
/**
* Constructor
*
* Creates session namespace for CSRF token, and adds validator for CSRF
* Creates session namespace for CSRF token, and adds validator for CSRF
* token.
*
* @param string|array|Zend_Config $spec
* @param array|Zend_Config $options
*
* @param string|array|Zend_Config $spec
* @param array|Zend_Config $options
* @return void
*/
public function __construct($spec, $options = null)
@ -85,8 +85,8 @@ class Zend_Form_Element_Hash extends Zend_Form_Element_Xhtml
/**
* Set session object
*
* @param Zend_Session_Namespace $session
*
* @param Zend_Session_Namespace $session
* @return Zend_Form_Element_Hash
*/
public function setSession($session)
@ -99,7 +99,7 @@ class Zend_Form_Element_Hash extends Zend_Form_Element_Xhtml
* Get session object
*
* Instantiate session object if none currently exists
*
*
* @return Zend_Session_Namespace
*/
public function getSession()
@ -114,9 +114,9 @@ class Zend_Form_Element_Hash extends Zend_Form_Element_Xhtml
/**
* Initialize CSRF validator
*
* Creates Session namespace, and initializes CSRF token in session.
* Creates Session namespace, and initializes CSRF token in session.
* Additionally, adds validator for validating CSRF token.
*
*
* @return Zend_Form_Element_Hash
*/
public function initCsrfValidator()
@ -158,7 +158,7 @@ class Zend_Form_Element_Hash extends Zend_Form_Element_Xhtml
* Retrieve CSRF token
*
* If no CSRF token currently exists, generates one.
*
*
* @return string
*/
public function getHash()
@ -173,7 +173,7 @@ class Zend_Form_Element_Hash extends Zend_Form_Element_Xhtml
* Get session namespace for CSRF token
*
* Generates a session namespace based on salt, element name, and class.
*
*
* @return string
*/
public function getSessionName()
@ -183,8 +183,8 @@ class Zend_Form_Element_Hash extends Zend_Form_Element_Xhtml
/**
* Set timeout for CSRF session token
*
* @param int $ttl
*
* @param int $ttl
* @return Zend_Form_Element_Hash
*/
public function setTimeout($ttl)
@ -195,7 +195,7 @@ class Zend_Form_Element_Hash extends Zend_Form_Element_Xhtml
/**
* Get CSRF session token timeout
*
*
* @return int
*/
public function getTimeout()
@ -205,7 +205,7 @@ class Zend_Form_Element_Hash extends Zend_Form_Element_Xhtml
/**
* Override getLabel() to always be empty
*
*
* @return null
*/
public function getLabel()
@ -215,7 +215,7 @@ class Zend_Form_Element_Hash extends Zend_Form_Element_Xhtml
/**
* Initialize CSRF token in session
*
*
* @return void
*/
public function initCsrfToken()
@ -228,8 +228,8 @@ class Zend_Form_Element_Hash extends Zend_Form_Element_Xhtml
/**
* Render CSRF token in form
*
* @param Zend_View_Interface $view
*
* @param Zend_View_Interface $view
* @return string
*/
public function render(Zend_View_Interface $view = null)
@ -241,17 +241,17 @@ class Zend_Form_Element_Hash extends Zend_Form_Element_Xhtml
/**
* Generate CSRF token
*
* Generates CSRF token and stores both in {@link $_hash} and element
* Generates CSRF token and stores both in {@link $_hash} and element
* value.
*
*
* @return void
*/
protected function _generateHash()
{
$this->_hash = md5(
mt_rand(1,1000000)
. $this->getSalt()
. $this->getName()
mt_rand(1,1000000)
. $this->getSalt()
. $this->getName()
. mt_rand(1,1000000)
);
$this->setValue($this->_hash);

View File

@ -24,13 +24,13 @@ require_once 'Zend/Form/Element/Xhtml.php';
/**
* Hidden form element
*
*
* @category Zend
* @package Zend_Form
* @subpackage Element
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Hidden.php 16218 2009-06-21 19:44:04Z thomas $
* @version $Id: Hidden.php 18951 2009-11-12 16:26:19Z alexander $
*/
class Zend_Form_Element_Hidden extends Zend_Form_Element_Xhtml
{

View File

@ -24,13 +24,13 @@ require_once 'Zend/Form/Element/Xhtml.php';
/**
* Image form element
*
*
* @category Zend
* @package Zend_Form
* @subpackage Element
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Image.php 16218 2009-06-21 19:44:04Z thomas $
* @version $Id: Image.php 18951 2009-11-12 16:26:19Z alexander $
*/
class Zend_Form_Element_Image extends Zend_Form_Element_Xhtml
{
@ -54,7 +54,7 @@ class Zend_Form_Element_Image extends Zend_Form_Element_Xhtml
/**
* Load default decorators
*
*
* @return void
*/
public function loadDefaultDecorators()
@ -75,8 +75,8 @@ class Zend_Form_Element_Image extends Zend_Form_Element_Xhtml
/**
* Set image path
*
* @param string $path
*
* @param string $path
* @return Zend_Form_Element_Image
*/
public function setImage($path)
@ -87,7 +87,7 @@ class Zend_Form_Element_Image extends Zend_Form_Element_Xhtml
/**
* Get image path
*
*
* @return string
*/
public function getImage()
@ -97,8 +97,8 @@ class Zend_Form_Element_Image extends Zend_Form_Element_Xhtml
/**
* Set image value to use when submitted
*
* @param mixed $value
*
* @param mixed $value
* @return Zend_Form_Element_Image
*/
public function setImageValue($value)
@ -109,7 +109,7 @@ class Zend_Form_Element_Image extends Zend_Form_Element_Xhtml
/**
* Get image value to use when submitted
*
*
* @return mixed
*/
public function getImageValue()
@ -119,7 +119,7 @@ class Zend_Form_Element_Image extends Zend_Form_Element_Xhtml
/**
* Was this element used to submit the form?
*
*
* @return bool
*/
public function isChecked()
@ -127,5 +127,5 @@ class Zend_Form_Element_Image extends Zend_Form_Element_Xhtml
$imageValue = $this->getImageValue();
return ((null !== $imageValue) && ($this->getValue() == $imageValue));
}
}

View File

@ -25,16 +25,16 @@ require_once 'Zend/Form/Element/Multi.php';
/**
* MultiCheckbox form element
*
* Allows specifyinc a (multi-)dimensional associative array of values to use
* as labelled checkboxes; these will return an array of values for those
* Allows specifyinc a (multi-)dimensional associative array of values to use
* as labelled checkboxes; these will return an array of values for those
* checkboxes selected.
*
*
* @category Zend
* @package Zend_Form
* @subpackage Element
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: MultiCheckbox.php 16218 2009-06-21 19:44:04Z thomas $
* @version $Id: MultiCheckbox.php 18951 2009-11-12 16:26:19Z alexander $
*/
class Zend_Form_Element_MultiCheckbox extends Zend_Form_Element_Multi
{

View File

@ -24,13 +24,13 @@ require_once 'Zend/Form/Element/Select.php';
/**
* Multiselect form element
*
*
* @category Zend
* @package Zend_Form
* @subpackage Element
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Multiselect.php 16218 2009-06-21 19:44:04Z thomas $
* @version $Id: Multiselect.php 18951 2009-11-12 16:26:19Z alexander $
*/
class Zend_Form_Element_Multiselect extends Zend_Form_Element_Select
{

View File

@ -24,13 +24,13 @@ require_once 'Zend/Form/Element/Xhtml.php';
/**
* Password form element
*
*
* @category Zend
* @package Zend_Form
* @subpackage Element
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Password.php 16218 2009-06-21 19:44:04Z thomas $
* @version $Id: Password.php 18951 2009-11-12 16:26:19Z alexander $
*/
class Zend_Form_Element_Password extends Zend_Form_Element_Xhtml
{
@ -48,7 +48,7 @@ class Zend_Form_Element_Password extends Zend_Form_Element_Xhtml
/**
* Set flag indicating whether or not to render the password
* @param bool $flag
* @param bool $flag
* @return Zend_Form_Element_Password
*/
public function setRenderPassword($flag)
@ -59,7 +59,7 @@ class Zend_Form_Element_Password extends Zend_Form_Element_Xhtml
/**
* Get value of renderPassword flag
*
*
* @return bool
*/
public function renderPassword()
@ -71,9 +71,9 @@ class Zend_Form_Element_Password extends Zend_Form_Element_Xhtml
* Override isValid()
*
* Ensure that validation error messages mask password value.
*
* @param string $value
* @param mixed $context
*
* @param string $value
* @param mixed $context
* @return bool
*/
public function isValid($value, $context = null)

View File

@ -24,13 +24,13 @@ require_once 'Zend/Form/Element/Multi.php';
/**
* Radio form element
*
*
* @category Zend
* @package Zend_Form
* @subpackage Element
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Radio.php 16218 2009-06-21 19:44:04Z thomas $
* @version $Id: Radio.php 18951 2009-11-12 16:26:19Z alexander $
*/
class Zend_Form_Element_Radio extends Zend_Form_Element_Multi
{
@ -39,4 +39,19 @@ class Zend_Form_Element_Radio extends Zend_Form_Element_Multi
* @var string
*/
public $helper = 'formRadio';
/**
* Load default decorators
*
* Disables "for" attribute of label if label decorator enabled.
*
* @return void
*/
public function loadDefaultDecorators()
{
parent::loadDefaultDecorators();
if (false !== $decorator = $this->getDecorator('Label')) {
$decorator->setOption('disableFor', true);
}
}
}

View File

@ -24,13 +24,13 @@ require_once 'Zend/Form/Element/Submit.php';
/**
* Reset form element
*
*
* @category Zend
* @package Zend_Form
* @subpackage Element
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Reset.php 16218 2009-06-21 19:44:04Z thomas $
* @version $Id: Reset.php 18951 2009-11-12 16:26:19Z alexander $
*/
class Zend_Form_Element_Reset extends Zend_Form_Element_Submit
{

View File

@ -24,13 +24,13 @@ require_once 'Zend/Form/Element/Multi.php';
/**
* Select.php form element
*
*
* @category Zend
* @package Zend_Form
* @subpackage Element
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Select.php 16218 2009-06-21 19:44:04Z thomas $
* @version $Id: Select.php 18951 2009-11-12 16:26:19Z alexander $
*/
class Zend_Form_Element_Select extends Zend_Form_Element_Multi
{

View File

@ -24,13 +24,13 @@ require_once 'Zend/Form/Element/Xhtml.php';
/**
* Submit form element
*
*
* @category Zend
* @package Zend_Form
* @subpackage Element
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Submit.php 16218 2009-06-21 19:44:04Z thomas $
* @version $Id: Submit.php 18951 2009-11-12 16:26:19Z alexander $
*/
class Zend_Form_Element_Submit extends Zend_Form_Element_Xhtml
{
@ -42,7 +42,7 @@ class Zend_Form_Element_Submit extends Zend_Form_Element_Xhtml
/**
* Constructor
*
*
* @param string|array|Zend_Config $spec Element name or configuration
* @param string|array|Zend_Config $options Element value or configuration
* @return void
@ -62,7 +62,7 @@ class Zend_Form_Element_Submit extends Zend_Form_Element_Xhtml
* If no label is present, returns the currently set name.
*
* If a translator is present, returns the translated label.
*
*
* @return string
*/
public function getLabel()
@ -82,7 +82,7 @@ class Zend_Form_Element_Submit extends Zend_Form_Element_Xhtml
/**
* Has this submit button been selected?
*
*
* @return bool
*/
public function isChecked()
@ -103,7 +103,7 @@ class Zend_Form_Element_Submit extends Zend_Form_Element_Xhtml
* Default decorators
*
* Uses only 'Submit' and 'DtDdWrapper' decorators by default.
*
*
* @return void
*/
public function loadDefaultDecorators()

View File

@ -24,13 +24,13 @@ require_once 'Zend/Form/Element/Xhtml.php';
/**
* Text form element
*
*
* @category Zend
* @package Zend_Form
* @subpackage Element
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Text.php 16218 2009-06-21 19:44:04Z thomas $
* @version $Id: Text.php 18951 2009-11-12 16:26:19Z alexander $
*/
class Zend_Form_Element_Text extends Zend_Form_Element_Xhtml
{

View File

@ -24,13 +24,13 @@ require_once 'Zend/Form/Element/Xhtml.php';
/**
* Textarea form element
*
*
* @category Zend
* @package Zend_Form
* @subpackage Element
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Textarea.php 16218 2009-06-21 19:44:04Z thomas $
* @version $Id: Textarea.php 18951 2009-11-12 16:26:19Z alexander $
*/
class Zend_Form_Element_Textarea extends Zend_Form_Element_Xhtml
{

View File

@ -24,13 +24,13 @@ require_once 'Zend/Form/Element.php';
/**
* Base element for XHTML elements
*
*
* @category Zend
* @package Zend_Form
* @subpackage Element
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Xhtml.php 16218 2009-06-21 19:44:04Z thomas $
* @version $Id: Xhtml.php 18951 2009-11-12 16:26:19Z alexander $
*/
abstract class Zend_Form_Element_Xhtml extends Zend_Form_Element
{

View File

@ -23,12 +23,12 @@ require_once 'Zend/Form.php';
/**
* Zend_Form_SubForm
*
*
* @category Zend
* @package Zend_Form
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: SubForm.php 16218 2009-06-21 19:44:04Z thomas $
* @version $Id: SubForm.php 18951 2009-11-12 16:26:19Z alexander $
*/
class Zend_Form_SubForm extends Zend_Form
{
@ -40,7 +40,7 @@ class Zend_Form_SubForm extends Zend_Form
/**
* Load the default decorators
*
*
* @return void
*/
public function loadDefaultDecorators()