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.
17 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
18 * @license http://framework.zend.com/license/new-bsd New BSD License
22 * Enable Dojo components
25 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
26 * @license http://framework.zend.com/license/new-bsd New BSD License
32 * Base path to AOL CDN
34 const CDN_BASE_AOL
= 'http://o.aolcdn.com/dojo/';
37 * Path to dojo on AOL CDN (following version string)
39 const CDN_DOJO_PATH_AOL
= '/dojo/dojo.xd.js';
42 * Base path to Google CDN
44 const CDN_BASE_GOOGLE
= 'http://ajax.googleapis.com/ajax/libs/dojo/';
47 * Path to dojo on Google CDN (following version string)
49 const CDN_DOJO_PATH_GOOGLE
= '/dojo/dojo.xd.js';
52 * Dojo-enable a form instance
54 * @param Zend_Form $form
57 public static function enableForm(Zend_Form
$form)
59 $form->addPrefixPath('Zend_Dojo_Form_Decorator', 'Zend/Dojo/Form/Decorator', 'decorator')
60 ->addPrefixPath('Zend_Dojo_Form_Element', 'Zend/Dojo/Form/Element', 'element')
61 ->addElementPrefixPath('Zend_Dojo_Form_Decorator', 'Zend/Dojo/Form/Decorator', 'decorator')
62 ->addDisplayGroupPrefixPath('Zend_Dojo_Form_Decorator', 'Zend/Dojo/Form/Decorator')
63 ->setDefaultDisplayGroupClass('Zend_Dojo_Form_DisplayGroup');
65 foreach ($form->getSubForms() as $subForm) {
66 self
::enableForm($subForm);
69 if (null !== ($view = $form->getView())) {
70 self
::enableView($view);
75 * Dojo-enable a view instance
77 * @param Zend_View_Interface $view
80 public static function enableView(Zend_View_Interface
$view)
82 if (false === $view->getPluginLoader('helper')->getPaths('Zend_Dojo_View_Helper')) {
83 $view->addHelperPath('Zend/Dojo/View/Helper', 'Zend_Dojo_View_Helper');