Ejemplo n.º 1
0
 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());
     }
 }
Ejemplo n.º 2
0
 /**
  *
  */
 function onPreRender($param)
 {
     parent::onPreRender($param);
     $page = $this->getPage();
     if (!$page->isScriptFileRegistered('TJSTemplate')) {
         $scriptFile = $this->Application->getResourceLocator()->getJsPath() . '/' . self::JS;
         $page->registerScriptFile('TJSTemplate', $scriptFile);
     }
 }
Ejemplo n.º 3
0
 /**
  *
  */
 function onPreRender($param)
 {
     parent::onPreRender($param);
     $page = $this->getPage();
     if (!$page->isScriptFileRegistered('TAJAXScript')) {
         $scriptFile = $_SERVER['SCRIPT_NAME'] . '?__AJAX&client';
         $page->registerScriptFile('TAJAXScript', $scriptFile);
     }
 }
Ejemplo n.º 4
0
 /**
  * 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);
         }
     }
 }
Ejemplo n.º 5
0
 public function onPreRender($param)
 {
     if ($decorator = $this->getDecorator(false)) {
         $decorator->instantiate();
     }
     parent::onPreRender($param);
 }
Ejemplo n.º 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();
     }
 }
Ejemplo n.º 7
0
 public function onPreRender($param)
 {
     parent::onPreRender($param);
     MyJavascriptLib::registerPackage($this, $this->_class);
 }