This file is part of a Moko Consulting project. SPDX-License-Identifier: GPL-3.0-or-later */ declare(strict_types=1); defined('_JEXEC') or die; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Factory; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\Router\Route; use Joomla\CMS\Uri\Uri; /** * @var \Joomla\CMS\Document\HtmlDocument $this * @var \Joomla\Registry\Registry $this->params * @var string $this->language * @var string $this->direction */ $app = Factory::getApplication(); $doc = Factory::getDocument(); $wa = $doc->getWebAssetManager(); $params = $this->params ?: $app->getTemplate(true)->params; $direction = $this->direction ?: 'ltr'; // Register the template's asset manifest (not auto-loaded in offline context) $manifestPath = JPATH_ROOT . '/media/templates/site/' . $this->template . '/joomla.asset.json'; if (is_file($manifestPath)) { $wa->getRegistry()->addRegistryFile($manifestPath); } // Load language files (not auto-loaded in offline context) $lang = Factory::getLanguage(); $lang->load('tpl_' . $this->template, JPATH_ROOT . '/templates/' . $this->template); $lang->load('tpl_' . $this->template, JPATH_ROOT); $lang->load('com_users', JPATH_ROOT); $lang->load('com_users', JPATH_ROOT . '/components/com_users'); $lang->load('', JPATH_ROOT); /* ----------------------- Load assets via WebAssetManager (matches index.php pattern) ------------------------ */ $params_developmentmode = (bool) $params->get('developmentmode', false) || (bool) $app->get('debug', false); $suffix = $params_developmentmode ? '' : '.min'; // Core template CSS + offline overlay CSS $wa->useStyle('template.base' . $suffix); $wa->useStyle('template.offline' . $suffix); // Osaka font $wa->useStyle('template.font.osaka'); // Font Awesome 7 Free $wa->useStyle('vendor.fa7free.all' . $suffix); // Theme palettes $wa->useStyle('template.light.standard' . $suffix); $wa->useStyle('template.dark.standard' . $suffix); // Custom palettes (if selected and files exist) $params_LightColorName = (string) $params->get('colorLightName', 'standard'); $params_DarkColorName = (string) $params->get('colorDarkName', 'standard'); if ($params_LightColorName === 'custom' && file_exists(JPATH_ROOT . '/media/templates/site/mokoonyx/css/theme/light.custom.css')) { $wa->useStyle('template.light.custom' . $suffix); } if ($params_DarkColorName === 'custom' && file_exists(JPATH_ROOT . '/media/templates/site/mokoonyx/css/theme/dark.custom.css')) { $wa->useStyle('template.dark.custom' . $suffix); } // User overrides (loaded last) $wa->useStyle('template.user'); // Accessibility high-contrast stylesheet $wa->useStyle('template.a11y-high-contrast'); // Template JS (theme switcher, a11y toolbar, var-copy, etc.) if ($params_developmentmode) { $wa->useScript('template.js'); } else { $wa->useScript('template.js.min'); } $wa->useScript('user.js'); // Bootstrap CSS + JS (accordion, responsive grid, utilities) try { $wa->useStyle('bootstrap.css'); } catch (\Exception $e) { // Fallback: load via HTMLHelper HTMLHelper::_('bootstrap.loadCss', true, $doc); } HTMLHelper::_('bootstrap.framework'); /* ----------------------- Title + Meta ------------------------ */ $sitename = (string) $app->get('sitename'); $baseTitle = Text::_('JGLOBAL_OFFLINE') ?: 'Offline'; $snSetting = (int) $app->get('sitename_pagetitles', 0); if ($snSetting === 1) { $doc->setTitle(Text::sprintf('JPAGETITLE', $sitename, $baseTitle)); } elseif ($snSetting === 2) { $doc->setTitle(Text::sprintf('JPAGETITLE', $baseTitle, $sitename)); } else { $doc->setTitle($baseTitle); } $doc->setMetaData('robots', 'noindex, nofollow'); /* ----------------------- Offline content from Global Config ------------------------ */ $displayOfflineMessage = (int) $app->get('display_offline_message', 1); $offlineMessage = trim((string) $app->get('offline_message', '')); /* ----------------------- Offline image from Joomla Global Config (System > Global Configuration > Site > Offline Image) Used as the full-viewport background image. ------------------------ */ $offlineImage = trim((string) $app->get('offline_image', '')); $bgStyle = ''; if ($offlineImage !== '') { $bgStyle = 'background-image: url(\'' . htmlspecialchars(Uri::root(false) . $offlineImage, ENT_QUOTES, 'UTF-8') . '\');'; } /* ----------------------- Brand: logo from template params OR siteTitle ------------------------ */ $brandHtml = ''; $logoFile = (string) $params->get('logoFile'); if ($logoFile !== '') { $brandHtml = HTMLHelper::_( 'image', Uri::root(false) . htmlspecialchars($logoFile, ENT_QUOTES, 'UTF-8'), $sitename, ['class' => 'logo d-inline-block', 'loading' => 'eager', 'decoding' => 'async'], false, 0 ); } else { $siteTitle = $params->get('siteTitle', 'MokoOnyx'); $brandHtml = '' . htmlspecialchars($siteTitle, ENT_COMPAT, 'UTF-8') . ''; } $brandTagline = (string) ($params->get('brand_tagline') ?: $params->get('siteDescription') ?: ''); $showTagline = (int) $params->get('show_brand_tagline', 0); // Favicon $params_favicon_source = (string) $params->get('favicon_source', ''); $faviconHeadTags = ''; if ($params_favicon_source) { require_once JPATH_ROOT . '/templates/' . $this->template . '/helper/favicon.php'; $faviconSourceAbs = JPATH_ROOT . '/' . ltrim($params_favicon_source, '/'); $faviconOutputDir = JPATH_ROOT . '/images/favicons'; $faviconUrlBase = Uri::root(true) . '/images/favicons'; if (MokoFaviconHelper::generate($faviconSourceAbs, $faviconOutputDir)) { $faviconHeadTags = MokoFaviconHelper::getHeadTags($faviconUrlBase); } } // Theme params $params_theme_enabled = (int) $params->get('theme_enabled', 1); $params_theme_fab_enabled = (int) $params->get('theme_fab_enabled', 1); $params_theme_fab_pos = 'br'; // Accessibility params $params_a11y_toolbar = (int) $params->get('a11y_toolbar_enabled', 1); $params_a11y_resize = (int) $params->get('a11y_text_resize', 1); $params_a11y_invert = (int) $params->get('a11y_color_inversion', 1); $params_a11y_contrast = (int) $params->get('a11y_high_contrast', 1); $params_a11y_links = (int) $params->get('a11y_highlight_links', 1); $params_a11y_font = (int) $params->get('a11y_readable_font', 1); $params_a11y_animations = (int) $params->get('a11y_pause_animations', 1); $params_a11y_pos = 'br'; // Analytics params $params_googletagmanager = $params->get('googletagmanager', false); $params_googletagmanagerid = $params->get('googletagmanagerid', null); $params_googleanalytics = $params->get('googleanalytics', false); $params_googleanalyticsid = $params->get('googleanalyticsid', null); $params_googlesitekey = $params->get('googlesitekey', null); if (!empty($params_googlesitekey)) { $doc->setMetaData('google-site-verification', htmlspecialchars($params_googlesitekey, ENT_QUOTES, 'UTF-8')); } /* ----------------------- Login routes ------------------------ */ $action = Route::_('index.php', true); $return = base64_encode(Uri::base()); $allowRegistration = (bool) ComponentHelper::getParams('com_users')->get('allowUserRegistration', 0); if (class_exists('\Joomla\Component\Users\Site\Helper\RouteHelper')) { $resetUrl = \Joomla\Component\Users\Site\Helper\RouteHelper::getResetRoute(); $remindUrl = \Joomla\Component\Users\Site\Helper\RouteHelper::getRemindRoute(); $registrationUrl = \Joomla\Component\Users\Site\Helper\RouteHelper::getRegistrationRoute(); } else { $resetUrl = Route::_('index.php?option=com_users&view=reset'); $remindUrl = Route::_('index.php?option=com_users&view=remind'); $registrationUrl = Route::_('index.php?option=com_users&view=registration'); } ?> style="">

countModules('offline')) : ?>

countModules('offline-footer')) : ?>