* * This file is part of a Moko Consulting project. * * SPDX-License-Identifier: GPL-3.0-or-later * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see https://www.gnu.org/licenses/ . * ========================================================================= * FILE INFORMATION * DEFGROUP: Joomla * INGROUP: Moko-Cassiopeia * PATH: templates/moko-cassiopeia/offline.php * VERSION: 02.01.05-dev * BRIEF: Offline page template file for Moko-Cassiopeia * ========================================================================= */ 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(); $params = $this->params ?: $app->getTemplate(true)->params; $direction = $this->direction ?: 'ltr'; /* ----------------------- Load ONLY template.css + colors_*.css (with min toggle) ------------------------ */ $useMin = !((int) $params->get('development_mode', 0) === 1); $assetSuffix = $useMin ? '.min' : ''; $base = rtrim(Uri::root(true), '/') . '/templates/' . $this->template . '/css/'; $doc->addStyleSheet($base . 'template' . $assetSuffix . '.css', ['version' => 'auto'], ['id' => 'moko-template']); /* If you have a template param for color variant, set it here; defaults to 'standard' */ $colorKey = (string) ($params->get('colors', 'standard') ?: 'standard'); $colorKey = preg_replace('~[^a-z0-9_-]~i', '', $colorKey); $doc->addStyleSheet($base . 'colors_' . $colorKey . $assetSuffix . '.css', ['version' => 'auto'], ['id' => 'moko-colors']); /* Bootstrap CSS/JS for accordion behavior; safe to keep. */ HTMLHelper::_('bootstrap.loadCss', true, $doc); HTMLHelper::_('bootstrap.framework'); /* ----------------------- Title + Meta (Include Site Name in Page Titles) ------------------------ */ $sitename = (string) $app->get('sitename'); $baseTitle = Text::_('JGLOBAL_OFFLINE') ?: 'Offline'; $snSetting = (int) $app->get('sitename_pagetitles', 0); // 0=no, 1=before, 2=after if ($snSetting === 1) { $doc->setTitle(Text::sprintf('JPAGETITLE', $sitename, $baseTitle)); // Site Name BEFORE } elseif ($snSetting === 2) { $doc->setTitle(Text::sprintf('JPAGETITLE', $baseTitle, $sitename)); // Site Name AFTER } else { $doc->setTitle($baseTitle); } $doc->setMetaData('robots', 'noindex, nofollow'); /* ----------------------- Offline content from Global Config ------------------------ */ $displayOfflineMessage = (int) $app->get('display_offline_message', 1); // 0|1|2 $offlineMessage = trim((string) $app->get('offline_message', '')); /* ----------------------- Brand (mutually exclusive: logoFile OR siteTitle) ------------------------ */ if ($params->get('logoFile')) { $logo = HTMLHelper::_( 'image', Uri::root(false) . htmlspecialchars((string) $params->get('logoFile'), ENT_QUOTES, 'UTF-8'), $sitename, [ 'class' => 'logo d-inline-block', 'loading' => 'eager', 'decoding' => 'async', 'style' => 'max-height:64px;height:auto;width:auto;' ], false, 0 ); } elseif ($params->get('siteTitle')) { $logo = '' . htmlspecialchars((string) $params->get('siteTitle'), ENT_COMPAT, 'UTF-8') . ''; } else { $logo = HTMLHelper::_( 'image', 'full_logo.png', $sitename, [ 'class' => 'logo d-inline-block', 'loading' => 'eager', 'decoding' => 'async', 'style' => 'max-height:64px;height:auto;width:auto;' ], true, 0 ); } $brandTagline = (string) ($params->get('brand_tagline') ?: $params->get('siteDescription') ?: ''); $showTagline = (int) $params->get('show_brand_tagline', 0); $showSwitcher = (int) $params->get('show_theme_switcher', 1); /* ----------------------- Login routes & Users ------------------------ */ $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'); } ?>