diff -r 000000000000 -r 4eba9c11703f web/Zend/Dojo/View/Helper/CustomDijit.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/Zend/Dojo/View/Helper/CustomDijit.php Mon Dec 13 18:29:26 2010 +0100 @@ -0,0 +1,112 @@ +_defaultDojoType) + ) { + require_once 'Zend/Dojo/View/Exception.php'; + throw new Zend_Dojo_View_Exception('No dojoType specified; cannot create dijit'); + } elseif (array_key_exists('dojoType', $params)) { + $this->_dijit = $params['dojoType']; + $this->_module = $params['dojoType']; + unset($params['dojoType']); + } else { + $this->_dijit = $this->_defaultDojoType; + $this->_module = $this->_defaultDojoType; + } + + if (array_key_exists('rootNode', $params)) { + $this->setRootNode($params['rootNode']); + unset($params['rootNode']); + } + + return $this->_createLayoutContainer($id, $value, $params, $attribs); + } + + /** + * Begin capturing content. + * + * Requires that either the {@link $_defaultDojotype} property is set, or + * that you pass a value to the "dojoType" key of the $params argument. + * + * @param string $id + * @param array $params + * @param array $attribs + * @return void + */ + public function captureStart($id, array $params = array(), array $attribs = array()) + { + if (!array_key_exists('dojoType', $params) + && (null === $this->_defaultDojoType) + ) { + require_once 'Zend/Dojo/View/Exception.php'; + throw new Zend_Dojo_View_Exception('No dojoType specified; cannot create dijit'); + } elseif (array_key_exists('dojoType', $params)) { + $this->_dijit = $params['dojoType']; + $this->_module = $params['dojoType']; + unset($params['dojoType']); + } else { + $this->_dijit = $this->_defaultDojoType; + $this->_module = $this->_defaultDojoType; + } + + return parent::captureStart($id, $params, $attribs); + } +}