-
Notifications
You must be signed in to change notification settings - Fork 9
/
component.php
67 lines (55 loc) · 2.3 KB
/
component.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
/** @var Joomla\CMS\Document\HtmlDocument $this */
$app = Factory::getApplication();
$document = $app->getDocument();
$wa = $this->getWebAssetManager();
$params = $this->params;
// Template path
$templatePath = 'media/templates/site/nature';
// Load Icons
if ($params->get('icons') == 1)
{
$wa->useStyle('fontawesome');
$this->getPreloadManager()->preload($wa->getAsset('style', 'fontawesome')->getUri() . '?' . $this->getMediaVersion(), ['as' => 'style']);
}
elseif ($params->get('icons') == 2)
{
$wa->registerAndUseStyle('bi-icons', $templatePath . '/css/bootstrap-icons.css');
$wa->registerAndUseStyle('icons', $templatePath . '/css/icons.css');
$this->getPreloadManager()->preload($wa->getAsset('style', 'bi-icons')->getUri() . '?' . $this->getMediaVersion(), ['as' => 'style']);
$this->getPreloadManager()->preload($wa->getAsset('style', 'icons')->getUri() . '?' . $this->getMediaVersion(), ['as' => 'style']);
}
// Use a font scheme if set in the template style options
$paramsFontScheme = $params->get('useFontScheme', false);
if ($paramsFontScheme)
{
$assetFontScheme = 'fontscheme.' . $paramsFontScheme;
$wa->registerAndUseStyle($assetFontScheme, $templatePath . '/css/global/' . $paramsFontScheme . '.css');
$this->getPreloadManager()->preload($wa->getAsset('style', $assetFontScheme)->getUri() . '?' . $this->getMediaVersion(), ['as' => 'style']);
}
// Enable assets
$wa->useStyle('template.nature')
->useScript('template.nature')
->useStyle('template.user')
->useScript('template.user');
$this->getPreloadManager()->preload($wa->getAsset('style', 'template.nature')->getUri() . '?' . $this->getMediaVersion(), ['as' => 'style']);
/// Favicons
include 'includes/favicons.php';
$this->setMetaData('viewport', 'width=device-width, initial-scale=1');
?>
<!DOCTYPE html>
<html lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
<head>
<jdoc:include type="metas" />
<?php include "includes/style.php";?>
<jdoc:include type="styles" />
<jdoc:include type="scripts" />
</head>
<body class="<?php echo $this->direction === 'rtl' ? 'rtl' : ''; ?>">
<jdoc:include type="message" />
<jdoc:include type="component" />
</body>
</html>