web/lib/Zend/Form/Element/Radio.php
changeset 807 877f952ae2bd
parent 207 621fa6caec0c
child 1230 68c69c656a2c
equal deleted inserted replaced
805:5e7a0fedabdf 807:877f952ae2bd
    13  * to license@zend.com so we can send you a copy immediately.
    13  * to license@zend.com so we can send you a copy immediately.
    14  *
    14  *
    15  * @category   Zend
    15  * @category   Zend
    16  * @package    Zend_Form
    16  * @package    Zend_Form
    17  * @subpackage Element
    17  * @subpackage Element
    18  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    18  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    20  */
    20  */
    21 
    21 
    22 /** Zend_Form_Element_Multi */
    22 /** Zend_Form_Element_Multi */
    23 require_once 'Zend/Form/Element/Multi.php';
    23 require_once 'Zend/Form/Element/Multi.php';
    26  * Radio form element
    26  * Radio form element
    27  *
    27  *
    28  * @category   Zend
    28  * @category   Zend
    29  * @package    Zend_Form
    29  * @package    Zend_Form
    30  * @subpackage Element
    30  * @subpackage Element
    31  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    31  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    32  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    32  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    33  * @version    $Id: Radio.php 22328 2010-05-30 15:09:06Z bittarman $
    33  * @version    $Id: Radio.php 25109 2012-11-07 20:48:04Z rob $
    34  */
    34  */
    35 class Zend_Form_Element_Radio extends Zend_Form_Element_Multi
    35 class Zend_Form_Element_Radio extends Zend_Form_Element_Multi
    36 {
    36 {
    37     /**
    37     /**
    38      * Use formRadio view helper by default
    38      * Use formRadio view helper by default
    43     /**
    43     /**
    44      * Load default decorators
    44      * Load default decorators
    45      *
    45      *
    46      * Disables "for" attribute of label if label decorator enabled.
    46      * Disables "for" attribute of label if label decorator enabled.
    47      *
    47      *
    48      * @return void
    48      * @return Zend_Form_Element_Radio
    49      */
    49      */
    50     public function loadDefaultDecorators()
    50     public function loadDefaultDecorators()
    51     {
    51     {
    52         if ($this->loadDefaultDecoratorsIsDisabled()) {
    52         if ($this->loadDefaultDecoratorsIsDisabled()) {
    53             return $this;
    53             return $this;
    54         }
    54         }
    55         parent::loadDefaultDecorators();
    55         parent::loadDefaultDecorators();
    56         $this->addDecorator('Label', array('tag' => 'dt',
    56 
    57                                            'disableFor' => true));
    57         // Disable 'for' attribute
       
    58         if (isset($this->_decorators['Label'])
       
    59             && !isset($this->_decorators['Label']['options']['disableFor']))
       
    60         {
       
    61              $this->_decorators['Label']['options']['disableFor'] = true;
       
    62         }
       
    63 
    58         return $this;
    64         return $this;
    59     }
    65     }
    60 }
    66 }