* @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; use Joomla\CMS\Factory; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\Uri\Uri; /** @var Joomla\CMS\Document\HtmlDocument $this */ $app = Factory::getApplication(); $input = $app->getInput(); $wa = $this->getWebAssetManager(); $params_ColorName = $this->params->get('colorName', 'colors_standard'); $params_GoogleTagManager = $this->params->get('googletagmanager', false); $params_GoogleTagManagerID = $this->params->get('googletagmanagerid', null); $params_custom_head_start = $this->params->get('custom_head_start', null); $params_custom_head_end = $this->params->get('custom_head_end', null); $params_leftIcon = htmlspecialchars( $this->params->get('drawerLeftIcon', 'fa-solid fa-chevron-right'), ENT_COMPAT, 'UTF-8' ); $params_rightIcon = htmlspecialchars( $this->params->get('drawerRightIcon', 'fa-solid fa-chevron-left'), ENT_COMPAT, 'UTF-8' ); if($params_GoogleTagManager && $params_GoogleTagManagerID) { ?> addHeadLink(HTMLHelper::_('image', '../media/templates/site/moko-cassiopeia/images/favicon/favicon.svg', '', [], true, 1), 'icon', 'rel', ['type' => 'image/svg+xml']); $this->addHeadLink(HTMLHelper::_('image', '../media/templates/site/moko-cassiopeia/images/favicon/favicon.ico', '', [], true, 1), 'alternate icon', 'rel', ['type' => 'image/vnd.microsoft.icon']); ?> getCmd('option', ''); $view = $input->getCmd('view', ''); $layout = $input->getCmd('layout', ''); $task = $input->getCmd('task', ''); $itemid = $input->getCmd('Itemid', ''); $sitename = htmlspecialchars($app->get('sitename'), ENT_QUOTES, 'UTF-8'); $menu = $app->getMenu()->getActive(); $pageclass = $menu !== null ? $menu->getParams()->get('pageclass_sfx', '') : ''; // Template path $templatePath = 'media/templates/site/moko-cassiopeia'; // Color Theme $assetColorName = 'theme.' . $params_ColorName; $wa->registerAndUseStyle($assetColorName, $templatePath . '/css/global/' . $params_ColorName . '.css'); // Use a font scheme if set in the template style options $params_FontScheme = $this->params->get('useFontScheme', false); $fontStyles = ''; if ($params_FontScheme) { if (stripos($params_FontScheme, 'https://') === 0) { $this->getPreloadManager()->preconnect('https://fonts.googleapis.com/', ['crossorigin' => 'anonymous']); $this->getPreloadManager()->preconnect('https://fonts.gstatic.com/', ['crossorigin' => 'anonymous']); $this->getPreloadManager()->preload($params_FontScheme, ['as' => 'style', 'crossorigin' => 'anonymous']); $wa->registerAndUseStyle('fontscheme.current', $params_FontScheme, [], ['media' => 'print', 'rel' => 'lazy-stylesheet', 'onload' => 'this.media=\'all\'', 'crossorigin' => 'anonymous']); if (preg_match_all('/family=([^?:]*):/i', $params_FontScheme, $matches) > 0) { $fontStyles = '--moko-cassiopeia-font-family-body: "' . str_replace('+', ' ', $matches[1][0]) . '", sans-serif; --moko-cassiopeia-font-family-headings: "' . str_replace('+', ' ', isset($matches[1][1]) ? $matches[1][1] : $matches[1][0]) . '", sans-serif; --moko-cassiopeia-font-weight-normal: 400; --moko-cassiopeia-font-weight-headings: 700;'; } } else { $wa->registerAndUseStyle('fontscheme.current', $params_FontScheme, ['version' => 'auto'], ['media' => 'print', 'rel' => 'lazy-stylesheet', 'onload' => 'this.media=\'all\'']); $this->getPreloadManager()->preload($wa->getAsset('style', 'fontscheme.current')->getUri() . '?' . $this->getMediaVersion(), ['as' => 'style']); } } // Enable assets $wa->usePreset('template.MOKO-CASSIOPEIA.' . ($this->direction === 'rtl' ? 'rtl' : 'ltr')) ->useStyle('template.active.language') ->useStyle('template.user') ->useScript('template.user') ->addInlineStyle(":root { --hue: 214; --template-bg-light: #f0f4fb; --template-text-dark: #495057; --template-text-light: #ffffff; --template-link-color: #2a69b8; --template-special-color: #001B4C; $fontStyles }"); // Override 'template.active' asset to set correct ltr/rtl dependency $wa->registerStyle('template.active', '', [], [], ['template.MOKO-CASSIOPEIA.' . ($this->direction === 'rtl' ? 'rtl' : 'ltr')]); // Logo file or site title param if ($this->params->get('logoFile')) { $logo = HTMLHelper::_('image', Uri::root(false) . htmlspecialchars($this->params->get('logoFile'), ENT_QUOTES), $sitename, ['loading' => 'eager', 'decoding' => 'async'], false, 0); } elseif ($this->params->get('siteTitle')) { $logo = '' . htmlspecialchars($this->params->get('siteTitle'), ENT_COMPAT, 'UTF-8') . ''; } else { $logo = HTMLHelper::_('image', 'full_logo.png', $sitename, ['class' => 'logo d-inline-block', 'loading' => 'eager', 'decoding' => 'async'], true, 0); } $hasClass = ''; if ($this->countModules('sidebar-left', true)) { $hasClass .= ' has-sidebar-left'; } if ($this->countModules('sidebar-right', true)) { $hasClass .= ' has-sidebar-right'; } if ($this->countModules('drawer-left', true)) { $hasClass .= ' has-drawer-left'; } if ($this->countModules('drawer-right', true)) { $hasClass .= ' has-drawer-right'; } // Container $wrapper = $this->params->get('fluidContainer') ? 'wrapper-fluid' : 'wrapper-static'; $this->setMetaData('viewport', 'width=device-width, initial-scale=1'); $stickyHeader = $this->params->get('stickyHeader') ? 'position-sticky sticky-top' : ''; if($this->params->get('fA6KitCode')){ //build unique kit embed code $fa6Kit="https://kit.fontawesome.com/".$this->params->get('fA6KitCode').".js"; //adding FontAwesome V6 Kit Code JHtml::_('script', $fa6Kit, array('crossorigin' => 'anonymous')); } else { // Defer fontawesome for increased performance. Once the page is loaded javascript changes it to a stylesheet. $wa->getAsset('style', 'fontawesome')->setAttribute('rel', 'lazy-stylesheet'); } ?>