/** * Adds a stylesheet based on the dojo path (local or cdn). * Method is static for situations where you need the stylesheets * to render even if even the dijits haven't been called but * will during execution (AJAX calls). * * @param string $stylesheet Path to stylesheet from base path. */ public static function addStylesheet($path) { // Set static view if necessary if (null === self::$_view) { $viewRenderer = SZend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer'); self::$_view = $viewRenderer->view; self::$_dojo = self::$_view->dojo(); } // Determine path to use if (null === self::getScriptBase()) { if (self::$_dojo->useLocalPath()) { self::setScriptBase(self::$_dojo->getLocalPath()); } else { self::setScriptBase(self::$_dojo->getCdnBase() . self::$_dojo->getCdnVersion()); } } self::$_dojo->addStylesheet(self::getScriptBase() . $path); }
/** * Renders stylesheets. Static method so they can be rendered once * in a page with delayed execution (AJAX calls). */ public static function renderStylesheets() { SZend_Dojo_View_Helper_Dojo_Extended::addStylesheet('/dojox/grid/resource/Grid.css'); SZend_Dojo_View_Helper_Dojo_Extended::addStylesheet('/dojox/grid/resources/' . self::getTheme() . 'Grid.css'); }
/** * Setup the dialog type and add stylesheets if needed. */ protected function _setup($params) { $this->_module = self::$_dialogType; if (array_key_exists('enhanced', $params)) { switch ($params['enhanced']) { case self::DIALOG_DOJOX: SZend_Dojo_View_Helper_Dojo_Extended::addStylesheet('/dojox/widget/Dialog/Dialog.css'); $this->_module = self::DIALOG_DOJOX; break; default: $this->_module = self::DIALOG_DOJO; } unset($params['enhanced']); } $this->_dijit = $this->_module; }