Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 24 additions & 10 deletions administrator/templates/atum/error_full.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,18 @@
$themeModeAttr = $themeModes[$userColorScheme];
} else {
// Check parameters first (User and Template), then look if we have detected the OS color scheme (if it set to 'os')
$colorScheme = $app->getIdentity()->getParam('colorScheme', $colorScheme);
$colorScheme = $app->getIdentity()?->getParam('colorScheme', $colorScheme) ?? 'os';
$osColorScheme = $colorScheme === 'os' ? $app->getInput()->cookie->get('osColorScheme', '') : '';
$themeModeAttr = ($themeModes[$colorScheme] ?? '') . ($themeModes[$osColorScheme] ?? '');
}
}

// @see administrator/templates/atum/html/layouts/status.php
$statusModules = LayoutHelper::render('status', ['modules' => 'status']);
// The module renderer will not work properly due to incomplete Application initialisation
$renderModules = $app->getIdentity() && $app->getLanguage();

// @see administrator/templates/atum/html/layouts/status.php
$statusModules = $renderModules ? LayoutHelper::render('status', ['modules' => 'status']) : '';

?>
<!DOCTYPE html>
<html lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>"<?php echo $themeModeAttr; ?>>
Expand All @@ -122,9 +126,13 @@
<?php echo HTMLHelper::_('image', $logoBrandSmall, $logoBrandSmallAlt, ['class' => 'logo-collapsed', 'loading' => 'eager', 'decoding' => 'async'], false, 0); ?>
</div>
</div>
<jdoc:include type="modules" name="title" />
<?php if ($renderModules) : ?>
<jdoc:include type="modules" name="title" />
<?php endif; ?>
</div>
<?php echo $statusModules; ?>
<?php if ($renderModules) : ?>
<?php echo $statusModules; ?>
<?php endif; ?>
</header>

<div id="wrapper" class="d-flex wrapper<?php echo $hiddenMenu ? '0' : ''; ?>">
Expand All @@ -137,14 +145,18 @@
<div id="container-collapse" class="container-collapse"></div>
<div class="row">
<div class="col-md-12">
<jdoc:include type="modules" name="toolbar" style="none" />
<?php if ($renderModules) : ?>
<jdoc:include type="modules" name="toolbar" style="none" />
<?php endif; ?>
</div>
</div>
</div>
<?php endif; ?>
<section id="content" class="content">
<jdoc:include type="message" />
<jdoc:include type="modules" name="top" style="html5" />
<?php if ($renderModules) : ?>
<jdoc:include type="modules" name="top" style="html5" />
<?php endif; ?>
<div class="row">
<div class="col-md-12">
<h1><?php echo Text::_('JERROR_AN_ERROR_HAS_OCCURRED'); ?></h1>
Expand Down Expand Up @@ -179,14 +191,14 @@
</p>
</div>

<?php if ($this->countModules('bottom')) : ?>
<?php if ($renderModules && $this->countModules('bottom')) : ?>
<jdoc:include type="modules" name="bottom" style="html5" />
<?php endif; ?>
</div>
</section>
</div>

<?php if (!$hiddenMenu) : ?>
<?php if ($renderModules && !$hiddenMenu) : ?>
<button class="navbar-toggler toggler-burger collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#sidebar-wrapper" aria-controls="sidebar-wrapper" aria-expanded="false" aria-label="<?php echo Text::_('JTOGGLE_SIDEBAR_MENU'); ?>">
<span class="navbar-toggler-icon"></span>
</button>
Expand All @@ -204,6 +216,8 @@
</div>
<?php endif; ?>
</div>
<jdoc:include type="modules" name="debug" style="none" />
<?php if ($renderModules) : ?>
<jdoc:include type="modules" name="debug" style="none" />
<?php endif; ?>
</body>
</html>
19 changes: 14 additions & 5 deletions administrator/templates/atum/error_login.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,17 @@
$themeModeAttr = $themeModes[$userLastMode];
} else {
// Check parameters first (User and Template), then look if we have detected the OS color scheme (if it set to 'os')
$colorScheme = $app->getIdentity()->getParam('colorScheme', $colorScheme);
$colorScheme = $app->getIdentity()?->getParam('colorScheme', $colorScheme) ?? 'os';
$lastMode = $colorScheme === 'os' ? $app->getInput()->cookie->get('osColorScheme', '') : '';
$themeModeAttr = ($colorScheme === 'os' ? $themeModes['os'] : '') . ($themeModes[$lastMode] ?? '');
}
}

// The module renderer will not work properly due to incomplete Application initialisation
$renderModules = $app->getIdentity() && $app->getLanguage();

// @see administrator/templates/atum/html/layouts/status.php
$statusModules = LayoutHelper::render('status', ['modules' => 'status']);
$statusModules = $renderModules ? LayoutHelper::render('status', ['modules' => 'status']) : '';
?>
<!DOCTYPE html>
<html lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>"<?php echo $themeModeAttr; ?>>
Expand All @@ -126,7 +129,9 @@
<?php echo HTMLHelper::_('image', $logoBrandSmall, $logoBrandSmallAlt, ['class' => 'logo-collapsed', 'loading' => 'eager', 'decoding' => 'async'], false, 0); ?>
</div>
</div>
<jdoc:include type="modules" name="title" />
<?php if ($renderModules) : ?>
<jdoc:include type="modules" name="title" />
<?php endif; ?>
</div>
<?php echo $statusModules; ?>
</header>
Expand Down Expand Up @@ -178,10 +183,14 @@
<a href="<?php echo Uri::root(); ?>"><?php echo Text::_('TPL_ATUM_LOGIN_SIDEBAR_VIEW_WEBSITE'); ?></a>
</div>
<div id="sidebar">
<jdoc:include type="modules" name="sidebar" style="body" />
<?php if ($renderModules) : ?>
<jdoc:include type="modules" name="sidebar" style="body" />
<?php endif; ?>
</div>
</div>
</div>
<jdoc:include type="modules" name="debug" style="none" />
<?php if ($renderModules) : ?>
<jdoc:include type="modules" name="debug" style="none" />
<?php endif; ?>
</body>
</html>
6 changes: 5 additions & 1 deletion libraries/src/WebAsset/AssetItem/LangActiveAssetItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,13 @@ public function __construct(
parent::__construct($name, $uri, $options, $attributes, $dependencies);

// Prepare Uri depend from the active language
$langTag = Factory::getApplication()->getLanguage()->getTag();
$langTag = Factory::getApplication()->getLanguage()?->getTag();
$client = $this->getOption('client');

if (!$langTag) {
return;
}

// Create Uri <client>/language/<langTag>/<langTag>.css
if ($client) {
$this->uri = $client . '/language/' . $langTag . '/' . $langTag . '.css';
Expand Down
13 changes: 9 additions & 4 deletions templates/cassiopeia/error.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@

// Get the error code
$errorCode = $this->error->getCode();

// The module renderer will not work properly due to incomplete Application initialisation
$renderModules = $app->getIdentity() && $app->getLanguage();
?>
<!DOCTYPE html>
<html lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
Expand Down Expand Up @@ -132,7 +135,7 @@
</div>
</div>
<?php endif; ?>
<?php if ($this->countModules('menu') || $this->countModules('search')) : ?>
<?php if ($renderModules && ($this->countModules('menu') || $this->countModules('search'))) : ?>
<div class="grid-child container-nav">
<?php if ($this->countModules('menu')) : ?>
<jdoc:include type="modules" name="menu" style="none" />
Expand All @@ -148,7 +151,7 @@

<div class="site-grid">
<div class="grid-child container-component">
<?php if ($this->countModules('error-' . $errorCode)) : ?>
<?php if ($renderModules && $this->countModules('error-' . $errorCode)) : ?>
<div class="container">
<jdoc:include type="message" />
<main>
Expand Down Expand Up @@ -202,14 +205,16 @@
<?php endif; ?>
</div>
</div>
<?php if ($this->countModules('footer')) : ?>
<?php if ($renderModules && $this->countModules('footer')) : ?>
<footer class="container-footer footer full-width">
<div class="grid-child">
<jdoc:include type="modules" name="footer" style="none" />
</div>
</footer>
<?php endif; ?>

<jdoc:include type="modules" name="debug" style="none" />
<?php if ($renderModules) : ?>
<jdoc:include type="modules" name="debug" style="none" />
<?php endif; ?>
</body>
</html>