web/lib/Zend/Form/Element/Submit.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_Xhtml */
    22 /** Zend_Form_Element_Xhtml */
    23 require_once 'Zend/Form/Element/Xhtml.php';
    23 require_once 'Zend/Form/Element/Xhtml.php';
    26  * Submit form element
    26  * Submit 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: Submit.php 22328 2010-05-30 15:09:06Z bittarman $
    33  * @version    $Id: Submit.php 24593 2012-01-05 20:35:02Z matthew $
    34  */
    34  */
    35 class Zend_Form_Element_Submit extends Zend_Form_Element_Xhtml
    35 class Zend_Form_Element_Submit extends Zend_Form_Element_Xhtml
    36 {
    36 {
    37     /**
    37     /**
    38      * Default view helper to use
    38      * Default view helper to use
    50     public function __construct($spec, $options = null)
    50     public function __construct($spec, $options = null)
    51     {
    51     {
    52         if (is_string($spec) && ((null !== $options) && is_string($options))) {
    52         if (is_string($spec) && ((null !== $options) && is_string($options))) {
    53             $options = array('label' => $options);
    53             $options = array('label' => $options);
    54         }
    54         }
    55         
    55 
    56         if (!isset($options['ignore'])) {
    56         if (!isset($options['ignore'])) {
    57             $options['ignore'] = true;
    57             $options['ignore'] = true;
    58         }
    58         }
    59 
    59 
    60         parent::__construct($spec, $options);
    60         parent::__construct($spec, $options);
    73     {
    73     {
    74         $value = parent::getLabel();
    74         $value = parent::getLabel();
    75 
    75 
    76         if (null === $value) {
    76         if (null === $value) {
    77             $value = $this->getName();
    77             $value = $this->getName();
    78         }
       
    79 
    78 
    80         if (null !== ($translator = $this->getTranslator())) {
    79             if (null !== ($translator = $this->getTranslator())) {
    81             return $translator->translate($value);
    80                 return $translator->translate($value);
       
    81             }
    82         }
    82         }
    83 
    83 
    84         return $value;
    84         return $value;
    85     }
    85     }
    86 
    86 
   106     /**
   106     /**
   107      * Default decorators
   107      * Default decorators
   108      *
   108      *
   109      * Uses only 'Submit' and 'DtDdWrapper' decorators by default.
   109      * Uses only 'Submit' and 'DtDdWrapper' decorators by default.
   110      *
   110      *
   111      * @return void
   111      * @return Zend_Form_Element_Submit
   112      */
   112      */
   113     public function loadDefaultDecorators()
   113     public function loadDefaultDecorators()
   114     {
   114     {
   115         if ($this->loadDefaultDecoratorsIsDisabled()) {
   115         if ($this->loadDefaultDecoratorsIsDisabled()) {
   116             return $this;
   116             return $this;