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:
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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();
|
||||
|
@ -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)
|
||||
|
@ -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:
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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')))
|
||||
|
@ -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)
|
||||
|
@ -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) {
|
||||
|
@ -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';
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -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
|
||||
|
@ -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)
|
||||
|
Reference in New Issue
Block a user