Beispiel #1
0
 /**
  * Processing to clear JS,Css cache and rendering quick button
  */
 function onBeforeRender()
 {
     $mainframe = JFactory::getApplication();
     if ($mainframe->isAdmin() || JDEBUG) {
         if (JRequest::getVar("leoclear") == "cache") {
             require_once dirname(__FILE__) . DS . "libs" . DS . "compress" . DS . "compress.php";
             LeoCompressHelper::clearCache();
             echo JText::_("Clear JS, CSS Successfull!");
             $mainframe->close();
         }
         $document = JFactory::getDocument();
         $document->addScript(JURI::root() . "plugins/system/leofw/assets/script.js");
         $document->addStyleSheet(JURI::root() . "plugins/system/leofw/assets/style.css");
     }
 }
 public function renderCssJSFiles()
 {
     $document = JFactory::getDocument();
     foreach ($this->_siteCss as $css) {
         $document->addStyleSheet($css);
     }
     foreach ($this->_siteJS as $css) {
         $document->addScript($css);
     }
     if ($this->getParam('compress_css_template', 0)) {
         $cssFiles = $document->_styleSheets;
         LeoCompressHelper::compressCss($cssFiles, $document);
     }
     if ($this->getParam('compress_js_template', 0)) {
         $jsFiles = $document->_scripts;
         LeoCompressHelper::compressJS($jsFiles, $document, $this->getParam('exclude_js_files', "core.js,mootools-core.js,mootools-more.js,jquery.js"));
     }
 }