public function onPreRender($param)
 {
     parent::onPreRender($param);
     if ($this->getPage()->getClientScript()->isEndScriptRegistered('protect_unsave_form') == false) {
         $this->getPage()->getClientScript()->registerEndScript('protect_unsave_form', $this->getJavaScriptCode());
     }
 }
 /**
  *
  */
 function onPreRender($param)
 {
     parent::onPreRender($param);
     $page = $this->getPage();
     if (!$page->isScriptFileRegistered('TJSTemplate')) {
         $scriptFile = $this->Application->getResourceLocator()->getJsPath() . '/' . self::JS;
         $page->registerScriptFile('TJSTemplate', $scriptFile);
     }
 }
 /**
  *
  */
 function onPreRender($param)
 {
     parent::onPreRender($param);
     $page = $this->getPage();
     if (!$page->isScriptFileRegistered('TAJAXScript')) {
         $scriptFile = $_SERVER['SCRIPT_NAME'] . '?__AJAX&client';
         $page->registerScriptFile('TAJAXScript', $scriptFile);
     }
 }
 /**
  * Calls the client script manager to add each of the requested client
  * script libraries.
  * @param mixed event parameter
  */
 public function onPreRender($param)
 {
     parent::onPreRender($param);
     $scripts = preg_split('/,|\\s+/', $this->getPradoScripts());
     $cs = $this->getPage()->getClientScript();
     foreach ($scripts as $script) {
         if (($script = trim($script)) !== '') {
             $cs->registerPradoScript($script);
         }
     }
 }
Example #5
0
 public function onPreRender($param)
 {
     if ($decorator = $this->getDecorator(false)) {
         $decorator->instantiate();
     }
     parent::onPreRender($param);
 }
Example #6
0
 /**
  * Registers the needed javascripts & css files
  * @param TEventParameter $param
  */
 public function onPreRender($param)
 {
     parent::onPreRender($param);
     if ($this->getItems()->count() > 0) {
         $cs = $this->getPage()->getClientScript();
         if (!$cs->isScriptFileRegistered('proto-menu')) {
             $cs->registerScriptFile('proto-menu', $this->publishAsset('assets/' . self::DEFAULT_JS_NAME, __CLASS__));
         }
         if (!$cs->isScriptFileRegistered('CContextMenu')) {
             $cs->registerScriptFile('CContextMenu', $this->publishAsset('assets/CContextMenu.js', __CLASS__));
         }
         if (($css = $this->getCssUrl()) === '') {
             $css = $this->publishAsset('assets/' . self::DEFAULT_CSS_NAME, __CLASS__);
         }
         $cs->registerStyleSheetFile('proto-css', $css);
         $this->renderClientControlScript();
     }
 }
Example #7
0
 public function onPreRender($param)
 {
     parent::onPreRender($param);
     MyJavascriptLib::registerPackage($this, $this->_class);
 }