* @license GNU General Public License version 2 or later; see LICENSE.txt * @since 3.0 */ defined('_JEXEC') or die; /** @var JDocumentHtml $this */ $app = JFactory::getApplication(); $lang = JFactory::getLanguage(); $input = $app->input; $user = JFactory::getUser(); // Output as HTML5 $this->setHtml5(true); // Gets the FrontEnd Main page Uri $frontEndUri = JUri::getInstance(JUri::root()); $frontEndUri->setScheme(((int) $app->get('force_ssl', 0) === 2) ? 'https' : 'http'); $mainPageUri = $frontEndUri->toString(); // Add JavaScript Frameworks JHtml::_('bootstrap.framework'); // Add filter polyfill for IE8 JHtml::_('behavior.polyfill', array('filter'), 'lte IE 9'); // Add template js JHtml::_('script', 'template.js', array('version' => 'auto', 'relative' => true)); // Add html5 shiv JHtml::_('script', 'jui/html5.js', array('version' => 'auto', 'relative' => true, 'conditional' => 'lt IE 9')); // Add Stylesheets JHtml::_('stylesheet', 'template' . ($this->direction === 'rtl' ? '-rtl' : '') . '.css', array('version' => 'auto', 'relative' => true)); // Load specific language related CSS JHtml::_('stylesheet', 'administrator/language/' . $lang->getTag() . '/' . $lang->getTag() . '.css', array('version' => 'auto')); // Load custom.css JHtml::_('stylesheet', 'custom.css', array('version' => 'auto', 'relative' => true)); JHtml::_('stylesheet', 'responsive.css', array('version' => 'auto', 'relative' => true)); // Detecting Active Variables $option = $input->get('option', ''); $view = $input->get('view', ''); $layout = $input->get('layout', ''); $task = $input->get('task', ''); $itemid = $input->get('Itemid', 0, 'int'); $sitename = htmlspecialchars($app->get('sitename', ''), ENT_QUOTES, 'UTF-8'); $cpanel = $option === 'com_cpanel'; $hidden = $app->input->get('hidemainmenu'); $showSubmenu = false; $this->submenumodules = JModuleHelper::getModules('submenu'); foreach ($this->submenumodules as $submenumodule) { $output = JModuleHelper::renderModule($submenumodule); if ($output !== '') { $showSubmenu = true; break; } } // Template Parameters $displayHeader = $this->params->get('displayHeader', '1'); $statusFixed = $this->params->get('statusFixed', '1'); $stickyToolbar = $this->params->get('stickyToolbar', '1'); // Header classes $navbar_color = $this->params->get('templateColor') ?: ''; $header_color = $displayHeader && $this->params->get('headerColor') ? $this->params->get('headerColor') : ''; $navbar_is_light = $navbar_color && colorIsLight($navbar_color); $header_is_light = $header_color && colorIsLight($header_color); if ($displayHeader) { // Logo file if ($this->params->get('logoFile')) { $logo = JUri::root() . htmlspecialchars($this->params->get('logoFile'), ENT_QUOTES); } else { $logo = $this->baseurl . '/templates/' . $this->template . '/images/logo' . ($header_is_light ? '-inverse' : '') . '.png'; } } function colorIsLight($color) { $r = hexdec(substr($color, 1, 2)); $g = hexdec(substr($color, 3, 2)); $b = hexdec(substr($color, 5, 2)); $yiq = (($r * 299) + ($g * 587) + ($b * 114)) / 1000; return $yiq >= 200; } // Pass some values to javascript $offset = 20; if ($displayHeader || !$statusFixed) { $offset = 30; } $stickyBar = 0; if ($stickyToolbar) { $stickyBar = 'true'; } // Template color if ($navbar_color) { $this->addStyleDeclaration(' .navbar-inner, .navbar-inverse .navbar-inner, .dropdown-menu li > a:hover, .dropdown-menu .active > a, .dropdown-menu .active > a:hover, .navbar-inverse .nav li.dropdown.open > .dropdown-toggle, .navbar-inverse .nav li.dropdown.active > .dropdown-toggle, .navbar-inverse .nav li.dropdown.open.active > .dropdown-toggle, #status.status-top { background: ' . $navbar_color . '; }'); } // Template header color if ($header_color) { $this->addStyleDeclaration(' .header { background: ' . $header_color . '; }'); } // Sidebar background color if ($this->params->get('sidebarColor')) { $this->addStyleDeclaration(' .nav-list > .active > a, .nav-list > .active > a:hover { background: ' . $this->params->get('sidebarColor') . '; }'); } // Link color if ($this->params->get('linkColor')) { $this->addStyleDeclaration(' a, .j-toggle-sidebar-button { color: ' . $this->params->get('linkColor') . '; }'); } ?>