- Fixed CSS - Cleaned up Table of Contents - Deleted conflicting default.php in com_content
262 lines
13 KiB
PHP
262 lines
13 KiB
PHP
<?php
|
|
/**
|
|
* @package Joomla.Site
|
|
* @subpackage Templates.moko-cassiopeia
|
|
* @file /templates/moko-cassiopeia/offline.php
|
|
*
|
|
* @copyright © 2025 Moko Consulting — All Rights Reserved
|
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
|
*
|
|
* Website: https://mokoconsulting.tech
|
|
* Email: hello@mokoconsulting.tech
|
|
* Phone: +1 (931) 279-6313
|
|
*/
|
|
|
|
defined('_JEXEC') or die;
|
|
|
|
use Joomla\CMS\Factory;
|
|
use Joomla\CMS\Helper\AuthenticationHelper;
|
|
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 */
|
|
|
|
$extraButtons = AuthenticationHelper::getLoginButtons('form-login');
|
|
$app = Factory::getApplication();
|
|
$wa = $this->getWebAssetManager();
|
|
|
|
|
|
if ($this->params->get('offlineEmbed')) {
|
|
$fullWidth = 1;
|
|
} else {
|
|
$fullWidth = 0;
|
|
}
|
|
|
|
// Template path
|
|
$templatePath = 'media/templates/site/moko-cassiopeia';
|
|
|
|
// Color Theme
|
|
$paramsColorName = $this->params->get('colorName', 'colors_standard');
|
|
$assetColorName = 'theme.' . $paramsColorName;
|
|
$wa->registerAndUseStyle($assetColorName, $templatePath . '/css/global/' . $paramsColorName . '.css');
|
|
|
|
// Use a font scheme if set in the template style options
|
|
$paramsFontScheme = $this->params->get('useFontScheme', false);
|
|
$fontStyles = '';
|
|
|
|
if ($paramsFontScheme) {
|
|
if (stripos($paramsFontScheme, 'https://') === 0) {
|
|
$this->getPreloadManager()->preconnect('https://fonts.googleapis.com/', ['crossorigin' => 'anonymous']);
|
|
$this->getPreloadManager()->preconnect('https://fonts.gstatic.com/', ['crossorigin' => 'anonymous']);
|
|
$this->getPreloadManager()->preload($paramsFontScheme, ['as' => 'style', 'crossorigin' => 'anonymous']);
|
|
$wa->registerAndUseStyle('fontscheme.current', $paramsFontScheme, [], ['media' => 'print', 'rel' => 'lazy-stylesheet', 'onload' => 'this.media=\'all\'', 'crossorigin' => 'anonymous']);
|
|
|
|
if (preg_match_all('/family=([^?:]*):/i', $paramsFontScheme, $matches) > 0) {
|
|
$fontStyles = '--font-family-body: "' . str_replace('+', ' ', $matches[1][0]) . '", sans-serif;
|
|
--font-family-headings: "' . str_replace('+', ' ', isset($matches[1][1]) ? $matches[1][1] : $matches[1][0]) . '", sans-serif;
|
|
--font-weight-normal: 400;
|
|
--font-weight-headings: 700;';
|
|
}
|
|
} else {
|
|
$wa->registerAndUseStyle('fontscheme.current', $paramsFontScheme, ['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.offline')
|
|
->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')]);
|
|
$this->addStyleSheet('//cdn-images.mailchimp.com/embedcode/classic-061523.css');
|
|
// Logo file or site title param
|
|
$sitename = htmlspecialchars($app->get('sitename'), ENT_QUOTES, 'UTF-8');
|
|
|
|
// Browsers support SVG favicons
|
|
$this->addHeadLink(HTMLHelper::_('image', 'favicon.svg', '', [], true, 1), 'icon', 'rel', ['type' => 'image/svg+xml']);
|
|
$this->addHeadLink(HTMLHelper::_('image', 'favicon.ico', '', [], true, 1), 'alternate icon', 'rel', ['type' => 'image/vnd.microsoft.icon']);
|
|
$this->addHeadLink(HTMLHelper::_('image', 'favicon.svg', '', [], true, 1), 'mask-icon', 'rel', ['color' => '#fff']);
|
|
|
|
|
|
//add Bootsrap 5 Support
|
|
HTMLHelper::_('bootstrap.alert');
|
|
HTMLHelper::_('bootstrap.button');
|
|
HTMLHelper::_('bootstrap.carousel');
|
|
HTMLHelper::_('bootstrap.collapse');
|
|
HTMLHelper::_('bootstrap.dropdown');
|
|
HTMLHelper::_('bootstrap.modal');
|
|
HTMLHelper::_('bootstrap.offcanvas');
|
|
HTMLHelper::_('bootstrap.popover');
|
|
HTMLHelper::_('bootstrap.scrollspy');
|
|
HTMLHelper::_('bootstrap.tab');
|
|
HTMLHelper::_('bootstrap.tooltip');
|
|
HTMLHelper::_('bootstrap.toast');
|
|
|
|
|
|
if ($this->params->get('logoFile')) {
|
|
$logo = HTMLHelper::_('image', Uri::root(false) . htmlspecialchars($this->params->get('logoFile'), ENT_QUOTES), $sitename, ['class' => 'logo d-inline-block', 'loading' => 'eager', 'decoding' => 'async'], false, 0);
|
|
} elseif ($this->params->get('siteTitle')) {
|
|
$logo = '<span title="' . $sitename . '">' . htmlspecialchars($this->params->get('siteTitle'), ENT_COMPAT, 'UTF-8') . '</span>';
|
|
} else {
|
|
$logo = HTMLHelper::_('image', 'logo.svg', $sitename, ['class' => 'logo d-inline-block', 'loading' => 'eager', 'decoding' => 'async'], true, 0);
|
|
}
|
|
|
|
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');
|
|
}
|
|
|
|
if ($app->get('offline_image')){
|
|
//echo HTMLHelper::_('image', $app->get('offline_image'), $sitename, ['class' => 'offline-image'], false, 0);
|
|
$backgroundstyle='
|
|
body {
|
|
background-image: url('.$app->get('offline_image').');
|
|
background-repeat: no-repeat;
|
|
background-attachment: fixed;
|
|
background-size: cover;
|
|
}';
|
|
$this->addStyleDeclaration($backgroundstyle);
|
|
}
|
|
|
|
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
|
|
<head>
|
|
<jdoc:include type="metas" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<jdoc:include type="styles" />
|
|
<jdoc:include type="scripts" />
|
|
|
|
</head>
|
|
<body class="site">
|
|
<div class="outer">
|
|
<div class="offline-card">
|
|
<div class="header">
|
|
<?php if (!empty($logo)) : ?>
|
|
<h1><?php echo $logo; ?></h1>
|
|
<?php else : ?>
|
|
<h1><?php echo $sitename; ?></h1>
|
|
<?php endif; ?>
|
|
<?php if ($this->countModules('offline-header')) : ?>
|
|
<jdoc:include type="modules" name="offline-header" style="none" />
|
|
<?php endif; ?></div><div class="offline-message">
|
|
<?php if ($app->get('display_offline_message', 1) == 1 && str_replace(' ', '', $app->get('offline_message')) != '') : ?>
|
|
<p><?php echo $app->get('offline_message'); ?></p>
|
|
<?php elseif ($app->get('display_offline_message', 1) == 2) : ?>
|
|
<p><?php echo Text::_('JOFFLINE_MESSAGE'); ?></p>
|
|
<?php endif; ?></div>
|
|
<?php if ($this->countModules('offline')) : ?>
|
|
<jdoc:include type="modules" name="offline" style="none" />
|
|
<?php endif; ?></div>
|
|
|
|
</div>
|
|
<a id="offline-login-link" data-bs-toggle="collapse" href="#collapseLogin" role="button" aria-expanded="false" aria-controls="collapseLogin">
|
|
<div class="logo-icon">
|
|
<svg version="1.1" xmlns="https://www.w3.org/2000/svg" x="0px" y="0px"
|
|
viewBox="0 0 74.8 74.8" enable-background="new 0 0 74.8 74.8" xml:space="preserve">
|
|
<title>Login Override</title>
|
|
<g id="brandmark">
|
|
<path id="j-green" fill="#1C3D5C" d="M13.5,37.7L12,36.3c-4.5-4.5-5.8-10.8-4.2-16.5c-4.5-1-7.8-5-7.8-9.8c0-5.5,4.5-10,10-10 c5,0,9.1,3.6,9.9,8.4c5.4-1.3,11.3,0.2,15.5,4.4l0.6,0.6l-7.4,7.4l-0.6-0.6c-2.4-2.4-6.3-2.4-8.7,0c-2.4,2.4-2.4,6.3,0,8.7l1.4,1.4 l7.4,7.4l7.8,7.8l-7.4,7.4l-7.8-7.8L13.5,37.7L13.5,37.7z"/>
|
|
<path id="j-orange" fill="#1C3D5C" d="M21.8,29.5l7.8-7.8l7.4-7.4l1.4-1.4C42.9,8.4,49.2,7,54.8,8.6C55.5,3.8,59.7,0,64.8,0 c5.5,0,10,4.5,10,10c0,5.1-3.8,9.3-8.7,9.9c1.6,5.6,0.2,11.9-4.2,16.3l-0.6,0.6l-7.4-7.4l0.6-0.6c2.4-2.4,2.4-6.3,0-8.7 c-2.4-2.4-6.3-2.4-8.7,0l-1.4,1.4L37,29l-7.8,7.8L21.8,29.5L21.8,29.5z"/>
|
|
<path id="j-red" fill="#1C3D5C" d="M55,66.8c-5.7,1.7-12.1,0.4-16.6-4.1l-0.6-0.6l7.4-7.4l0.6,0.6c2.4,2.4,6.3,2.4,8.7,0 c2.4-2.4,2.4-6.3,0-8.7L53,45.1l-7.4-7.4l-7.8-7.8l7.4-7.4l7.8,7.8l7.4,7.4l1.5,1.5c4.2,4.2,5.7,10.2,4.4,15.7 c4.9,0.7,8.6,4.9,8.6,9.9c0,5.5-4.5,10-10,10C60,74.8,56,71.3,55,66.8L55,66.8z"/>
|
|
<path id="j-blue" fill="#1C3D5C" d="M52.2,46l-7.8,7.8L37,61.2l-1.4,1.4c-4.3,4.3-10.3,5.7-15.7,4.4c-1,4.5-5,7.8-9.8,7.8 c-5.5,0-10-4.5-10-10C0,60,3.3,56.1,7.7,55C6.3,49.5,7.8,43.5,12,39.2l0.6-0.6L20,46l-0.6,0.6c-2.4,2.4-2.4,6.3,0,8.7 c2.4,2.4,6.3,2.4,8.7,0l1.4-1.4l7.4-7.4l7.8-7.8L52.2,46L52.2,46z"/>
|
|
</g>
|
|
</svg>
|
|
</div></a>
|
|
<div class="collapse" id="collapseLogin">
|
|
<div class="login">
|
|
<jdoc:include type="message" />
|
|
<form action="<?php echo Route::_('index.php', true); ?>" method="post" id="form-login">
|
|
<fieldset>
|
|
<label for="username"><?php echo Text::_('JGLOBAL_USERNAME'); ?></label>
|
|
<input name="username" class="form-control" id="username" type="text">
|
|
|
|
<label for="password"><?php echo Text::_('JGLOBAL_PASSWORD'); ?></label>
|
|
<input name="password" class="form-control" id="password" type="password">
|
|
|
|
<?php foreach ($extraButtons as $button) :
|
|
$dataAttributeKeys = array_filter(array_keys($button), function ($key) {
|
|
return substr($key, 0, 5) == 'data-';
|
|
});
|
|
?>
|
|
<div class="mod-login__submit form-group">
|
|
<button type="button"
|
|
class="btn btn-secondary w-100 mt-4 <?php echo $button['class'] ?? '' ?>"
|
|
<?php foreach ($dataAttributeKeys as $key) : ?>
|
|
<?php echo $key ?>="<?php echo $button[$key] ?>"
|
|
<?php endforeach; ?>
|
|
<?php if ($button['onclick']) : ?>
|
|
onclick="<?php echo $button['onclick'] ?>"
|
|
<?php endif; ?>
|
|
title="<?php echo Text::_($button['label']) ?>"
|
|
id="<?php echo $button['id'] ?>"
|
|
>
|
|
<?php if (!empty($button['icon'])) : ?>
|
|
<span class="<?php echo $button['icon'] ?>"></span>
|
|
<?php elseif (!empty($button['image'])) : ?>
|
|
<?php echo $button['image']; ?>
|
|
<?php elseif (!empty($button['svg'])) : ?>
|
|
<?php echo $button['svg']; ?>
|
|
<?php endif; ?>
|
|
<?php echo Text::_($button['label']) ?>
|
|
</button>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
|
|
<button type="submit" name="Submit" class="btn btn-primary"><?php echo Text::_('JLOGIN'); ?></button>
|
|
|
|
<input type="hidden" name="option" value="com_users">
|
|
<input type="hidden" name="task" value="user.login">
|
|
<input type="hidden" name="return" value="<?php echo base64_encode(Uri::base()); ?>">
|
|
<?php echo HTMLHelper::_('form.token'); ?>
|
|
</fieldset>
|
|
</form>
|
|
</div>
|
|
</div></div>
|
|
<?php if ($this->countModules('offline-footer')) : ?>
|
|
<jdoc:include type="modules" name="offline-footer" style="none" />
|
|
<?php endif; ?>
|
|
<footer class="container-footer footer full-width">
|
|
<?php if ($this->countModules('footer-menu', true)) : ?>
|
|
<div class="grid-child footer-menu">
|
|
<jdoc:include type="modules" name="footer-menu" />
|
|
</div>
|
|
<?php endif; ?>
|
|
<?php if ($this->countModules('footer')) : ?>
|
|
<jdoc:include type="modules" name="footer" style="none" />
|
|
<?php endif; ?>
|
|
</footer>
|
|
</div>
|
|
</div>
|
|
<?php if ($this->params->get('backTop') == 1) : ?>
|
|
<a href="#top" id="back-top" class="back-to-top-link" aria-label="<?php echo Text::_('TPL_MOKO-CASSIOPEIA_BACKTOTOP'); ?>">
|
|
<span class="icon-arrow-up icon-fw" aria-hidden="true"></span>
|
|
</a>
|
|
<?php endif; ?>
|
|
|
|
<jdoc:include type="modules" name="debug" style="none" />
|
|
</body>
|
|
</html>
|