-
Notifications
You must be signed in to change notification settings - Fork 10
/
component.php
52 lines (42 loc) · 1.48 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
<?php
/**
* @package Bettum
* @copyright Copyright (C) 2020 Charlie Lodder. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Uri\Uri;
/** @var JDocumentHtml $this */
// Add JavaScript Frameworks
HTMLHelper::_('script', 'vendor/focus-visible/focus-visible.min.js', ['version' => 'auto', 'relative' => true], ['type' => 'module']);
HTMLHelper::_('stylesheet', 'template' . ($this->direction === 'rtl' ? '-rtl' : '') . '.css', ['version' => 'auto', 'relative' => true]);
HTMLHelper::_('stylesheet', 'fontawesome.css', ['version' => 'auto', 'relative' => true]);
HTMLHelper::_('stylesheet', 'custom.css', ['version' => 'auto', 'relative' => true]);
$cachesStyleSheets = json_encode(array_keys($this->_styleSheets));
foreach (array_keys($this->_styleSheets) as $style)
{
unset($this->_styleSheets[$style]);
}
?>
<!DOCTYPE html>
<html lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
<head>
<jdoc:include type="head" />
</head>
<body class="contentpane component">
<div class="container-fluid">
<jdoc:include type="message" />
<jdoc:include type="component" />
<script>
const styles = <?php echo $cachesStyleSheets; ?>;
styles.forEach(file => {
const link = document.body.appendChild(document.createElement('link'));
link.rel = 'stylesheet';
link.href = file;
});
</script>
</div>
</body>
</html>