/**
  * Attach css, javascript files to document
  * @return void
  */
 private function _addAssets()
 {
     $this->_getDefaultStyles();
     $file = dirname(__FILE__) . '/assets/js/supports/' . $this->_defaultStyles['admin']->template . '.js';
     if (!is_file($file)) {
         return;
     }
     require_once JPATH_ADMINISTRATOR . '/components/com_poweradmin/helpers/poweradmin.php';
     $currentVersion = PoweradminHelper::getVersion();
     $config = $this->_getJSConfiguration();
     $language = $this->_getJSLanguage();
     $uri = JUri::root(true);
     $template = $this->_defaultStyles['admin']->template;
     $this->_document->addStyleSheet(JSN_FRAMEWORK_ASSETS . '/joomlashine/css/jsn-bootstrap.css');
     $this->_document->addStylesheet($uri . '/plugins/system/jsnpoweradmin/assets/css/adminbar.css?v=' . $currentVersion);
     $this->_document->addStylesheet($uri . '/plugins/system/jsnpoweradmin/assets/css/window.css?v=' . $currentVersion);
     $this->_document->addStylesheet($uri . '/plugins/system/jsnpoweradmin/assets/css/print.css?v=' . $currentVersion, 'text/css', 'print');
     if (in_array($template, array('minima', 'aplite'))) {
         $this->_document->addStylesheet($uri . '/plugins/system/jsnpoweradmin/assets/css/adminbar.menu.css?v=' . $currentVersion);
     }
     if ($template == 'hathor') {
         $this->_document->addStylesheet($uri . '/plugins/system/jsnpoweradmin/assets/css/adminbar.hathor.css?v=' . $currentVersion);
     }
     $this->_document->addScript($uri . '/plugins/system/jsnpoweradmin/assets/js/jquery.noconflict.js?v=' . $currentVersion);
     if (file_exists('../media/system/js/mootools-core.js')) {
         $this->_document->addScript($uri . '/media/system/js/mootools-core.js');
         $this->_document->addScript($uri . '/media/system/js/core.js');
         $this->_document->addScript($uri . '/media/system/js/mootools-more.js');
         $this->_document->addScript($uri . '/plugins/system/jsnpoweradmin/assets/js/mootool.conflict.js?v=' . $currentVersion);
     } else {
         JHtml::_('behavior.framework', true);
         $this->_document->addScript($uri . '/plugins/system/jsnpoweradmin/assets/js/mootool.conflict.js?v=' . $currentVersion);
     }
     $this->_document->addScript($uri . '/plugins/system/jsnpoweradmin/assets/js/mootools/mooml.js?v=' . $currentVersion);
     $this->_document->addScript($uri . '/plugins/system/jsnpoweradmin/assets/js/scrollbar.js?v=' . $currentVersion);
     $this->_document->addScript($uri . '/plugins/system/jsnpoweradmin/assets/js/window.js?v=' . $currentVersion);
     $this->_document->addScript($uri . '/plugins/system/jsnpoweradmin/assets/js/supports/' . $template . '.js?v=' . $currentVersion);
     $this->_document->addScript($uri . '/plugins/system/jsnpoweradmin/assets/js/adminbar.js?v=' . $currentVersion);
     $this->_document->addScript($uri . '/plugins/system/jsnpoweradmin/assets/js/history.js?v=' . $currentVersion);
     $this->_document->addScriptDeclaration("\n\t\t\tif (JoomlaShine === undefined) { var JoomlaShine = {}; }\n\t\t\tif (typeof(jQuery) !== 'undefined') { jQuery.noConflict(); }\n\n\t\t\tJoomlaShine.language = {$language};\n\t\t\twindow.addEvent('domready', function () {\n\t\t\t\tif(!document.getElementById('jsn-adminbar-wrapper')){\n\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\t\tnew JSNAdminBar({$config});\n\t\t\t\t\t\t\tnew JSNHistory();\n\t\t\t\t\t\t}, 500);\t\t\t\t\n\t\t\t\t\t}\n\t\t\t});\n\t\t");
 }
Exemplo n.º 2
0
 /**
  *
  * Queue store style file to array
  *
  * @param String $filename
  */
 public function addStyleSheet($filename)
 {
     if (!in_array($filename, $this->_styles)) {
         JSNFactory::localimport('helpers.poweradmin');
         $currentVersion = PoweradminHelper::getVersion();
         $filename .= '?v=' . $currentVersion;
         $this->_styles[] = $filename;
     }
 }
Exemplo n.º 3
0
 /**
  * Proceed positions rendering
  *
  * Remove default tp=1 layout, replace by jsn style to
  * show page positions
  *
  * @return  void
  */
 public function onAfterDispatch()
 {
     if (!JSNVersion::isJoomlaCompatible(JSN_FRAMEWORK_REQUIRED_JOOMLA_VER)) {
         return;
     }
     // Keep this for joomla 2.5. Will be deprecated.
     if (JSNVersion::isJoomlaCompatible('2.5') and !JSNVersion::isJoomlaCompatible('3.0')) {
         if (self::$_app->isAdmin() and self::$_app->input->getVar('format', '') != 'raw' and self::$_app->input->getVar('option', '') == 'com_poweradmin' and self::$_app->input->getVar('view') != 'update' and self::$_app->input->getVar('view') != 'changeposition') {
             $version = PoweradminHelper::getVersion();
             if (version_compare($version, '1.1.3', '>=')) {
                 $JSNMedia = JSNFactory::getMedia();
                 $JSNMedia->addMedia();
             }
         }
     }
     if (self::$_app->input->getCmd('poweradmin', 0) == 1) {
         $jsnHelper = JSNPositionsModel::_getInstance();
         $jsnHelper->renderEmptyComponent();
         $jsnHelper->renderEmptyModule();
     }
 }