equal
deleted
inserted
replaced
12 * obtain it through the world-wide-web, please send an email |
12 * obtain it through the world-wide-web, please send an email |
13 * to license@zend.com so we can send you a copy immediately. |
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 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
17 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
18 * @license http://framework.zend.com/license/new-bsd New BSD License |
18 * @license http://framework.zend.com/license/new-bsd New BSD License |
19 */ |
19 */ |
20 |
20 |
21 /** |
21 /** |
22 * Zend_Form_DisplayGroup |
22 * Zend_Form_DisplayGroup |
23 * |
23 * |
24 * @category Zend |
24 * @category Zend |
25 * @package Zend_Form |
25 * @package Zend_Form |
26 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
26 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
27 * @license http://framework.zend.com/license/new-bsd New BSD License |
27 * @license http://framework.zend.com/license/new-bsd New BSD License |
28 * @version $Id: DisplayGroup.php 22930 2010-09-09 18:45:18Z matthew $ |
28 * @version $Id: DisplayGroup.php 25093 2012-11-07 20:08:05Z rob $ |
29 */ |
29 */ |
30 class Zend_Form_DisplayGroup implements Iterator,Countable |
30 class Zend_Form_DisplayGroup implements Iterator,Countable |
31 { |
31 { |
32 /** |
32 /** |
33 * Group attributes |
33 * Group attributes |
65 */ |
65 */ |
66 protected $_elements = array(); |
66 protected $_elements = array(); |
67 |
67 |
68 /** |
68 /** |
69 * Form object to which the display group is currently registered |
69 * Form object to which the display group is currently registered |
70 * |
70 * |
71 * @var Zend_Form |
71 * @var Zend_Form |
72 */ |
72 */ |
73 protected $_form; |
73 protected $_form; |
74 |
74 |
75 /** |
75 /** |
282 return $this; |
282 return $this; |
283 } |
283 } |
284 |
284 |
285 /** |
285 /** |
286 * Set form object to which the display group is attached |
286 * Set form object to which the display group is attached |
287 * |
287 * |
288 * @param Zend_Form $form |
288 * @param Zend_Form $form |
289 * @return Zend_Form_DisplayGroup |
289 * @return Zend_Form_DisplayGroup |
290 */ |
290 */ |
291 public function setForm(Zend_Form $form) |
291 public function setForm(Zend_Form $form) |
292 { |
292 { |
293 $this->_form = $form; |
293 $this->_form = $form; |
294 |
294 |
295 // Ensure any elements attached prior to setting the form are now |
295 // Ensure any elements attached prior to setting the form are now |
296 // removed from iteration by the form |
296 // removed from iteration by the form |
297 foreach ($this->getElements() as $element) { |
297 foreach ($this->getElements() as $element) { |
298 $form->removeFromIteration($element->getName()); |
298 $form->removeFromIteration($element->getName()); |
299 } |
299 } |
300 |
300 |
301 return $this; |
301 return $this; |
302 } |
302 } |
303 |
303 |
304 /** |
304 /** |
305 * Get form object to which the group is attached |
305 * Get form object to which the group is attached |
306 * |
306 * |
307 * @return Zend_Form|null |
307 * @return Zend_Form|null |
308 */ |
308 */ |
309 public function getForm() |
309 public function getForm() |
310 { |
310 { |
311 return $this->_form; |
311 return $this->_form; |
655 } |
655 } |
656 |
656 |
657 /** |
657 /** |
658 * Load default decorators |
658 * Load default decorators |
659 * |
659 * |
660 * @return void |
660 * @return Zend_Form_DisplayGroup |
661 */ |
661 */ |
662 public function loadDefaultDecorators() |
662 public function loadDefaultDecorators() |
663 { |
663 { |
664 if ($this->loadDefaultDecoratorsIsDisabled()) { |
664 if ($this->loadDefaultDecoratorsIsDisabled()) { |
665 return $this; |
665 return $this; |
975 |
975 |
976 return $this->_translator; |
976 return $this->_translator; |
977 } |
977 } |
978 |
978 |
979 /** |
979 /** |
|
980 * Does this display group have its own specific translator? |
|
981 * |
|
982 * @return bool |
|
983 */ |
|
984 public function hasTranslator() |
|
985 { |
|
986 return (bool) $this->getTranslator(); |
|
987 } |
|
988 |
|
989 /** |
980 * Indicate whether or not translation should be disabled |
990 * Indicate whether or not translation should be disabled |
981 * |
991 * |
982 * @param bool $flag |
992 * @param bool $flag |
983 * @return Zend_Form_DisplayGroup |
993 * @return Zend_Form_DisplayGroup |
984 */ |
994 */ |