7
* This source file is subject to the new BSD license that is bundled
8
* with this package in the file LICENSE.txt.
9
* It is also available through the world-wide-web at this URL:
10
* http://framework.zend.com/license/new-bsd
11
* If you did not receive a copy of the license and are unable to
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.
18
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
19
* @license http://framework.zend.com/license/new-bsd New BSD License
22
/** Zend_Form_SubForm */
23
require_once 'Zend/Form/SubForm.php';
26
* Dijit-enabled SubForm
28
* @uses Zend_Form_SubForm
31
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
32
* @license http://framework.zend.com/license/new-bsd New BSD License
33
* @version $Id: SubForm.php 10038 2008-07-10 21:45:16Z matthew $
35
class Zend_Dojo_Form_SubForm extends Zend_Form_SubForm
38
* Has the dojo view helper path been registered?
41
protected $_dojoViewPathRegistered = false;
46
* @param array|Zend_Config|null $options
49
public function __construct($options = null)
51
$this->addPrefixPath('Zend_Dojo_Form_Decorator', 'Zend/Dojo/Form/Decorator', 'decorator')
52
->addPrefixPath('Zend_Dojo_Form_Element', 'Zend/Dojo/Form/Element', 'element')
53
->addElementPrefixPath('Zend_Dojo_Form_Decorator', 'Zend/Dojo/Form/Decorator', 'decorator')
54
->addDisplayGroupPrefixPath('Zend_Dojo_Form_Decorator', 'Zend/Dojo/Form/Decorator')
55
->setDefaultDisplayGroupClass('Zend_Dojo_Form_DisplayGroup');
56
parent::__construct($options);
60
* Load the default decorators
64
public function loadDefaultDecorators()
66
if ($this->loadDefaultDecoratorsIsDisabled()) {
70
$decorators = $this->getDecorators();
71
if (empty($decorators)) {
72
$this->addDecorator('FormElements')
73
->addDecorator('HtmlTag', array('tag' => 'dl'))
74
->addDecorator('ContentPane');
81
* @return Zend_View_Interface
83
public function getView()
85
$view = parent::getView();
86
if (!$this->_dojoViewPathRegistered) {
87
if (false === $view->getPluginLoader('helper')->getPaths('Zend_Dojo_View_Helper')) {
88
$view->addHelperPath('Zend/Dojo/View/Helper', 'Zend_Dojo_View_Helper');
90
$this->_dojoViewPathRegistered = true;