[DOCS] fixed code comment in one programlisting
[zend/radio.git] / library / Zend / Dojo.php
blobb1aa5b1bd8f08bb96f7135d171025eb6ea258140
1 <?php
2 /**
3 * Zend Framework
5 * LICENSE
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.
15 * @category Zend
16 * @package Zend_Dojo
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
21 /**
22 * Enable Dojo components
24 * @package Zend_Dojo
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
27 * @version $Id$
29 class Zend_Dojo
31 /**
32 * Base path to AOL CDN
34 const CDN_BASE_AOL = 'http://o.aolcdn.com/dojo/';
36 /**
37 * Path to dojo on AOL CDN (following version string)
39 const CDN_DOJO_PATH_AOL = '/dojo/dojo.xd.js';
41 /**
42 * Base path to Google CDN
44 const CDN_BASE_GOOGLE = 'http://ajax.googleapis.com/ajax/libs/dojo/';
46 /**
47 * Path to dojo on Google CDN (following version string)
49 const CDN_DOJO_PATH_GOOGLE = '/dojo/dojo.xd.js';
51 /**
52 * Dojo-enable a form instance
54 * @param Zend_Form $form
55 * @return void
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);
74 /**
75 * Dojo-enable a view instance
77 * @param Zend_View_Interface $view
78 * @return void
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');