-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathindex.php
183 lines (164 loc) · 7.64 KB
/
index.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<?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\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Uri\Uri;
/** @var JDocumentHtml $this */
$app = Factory::getApplication();
$lang = $app->getLanguage();
$input = $app->input;
// Detecting Active Variables
$option = $input->get('option', '');
$view = $input->get('view', '');
$layout = $input->get('layout', 'default');
$task = $input->get('task', 'display');
$cpanel = $option === 'com_cpanel';
$hideLinks = $app->input->getBool('hidemainmenu');
$href = $hideLinks ? '' : ' href="' . Route::_('index.php') . '"';
$logo = $this->params->get('siteLogo')
? Uri::root() . htmlspecialchars($this->params->get('siteLogo'), ENT_QUOTES, 'UTF-8')
: Uri::root(true) . '/administrator/templates/' . $this->template . '/images/logo-sm.svg';
// Set some meta data
$this->setMetaData('viewport', 'width=device-width, initial-scale=1');
$this->setMetaData('theme-color', '#38383d');
HTMLHelper::_('stylesheet', 'fontawesome.css', ['version' => 'auto', 'relative' => true]);
HTMLHelper::_('stylesheet', 'custom.css', ['version' => 'auto', 'relative' => true]);
HTMLHelper::_('stylesheet', 'administrator/language/' . $lang->getTag() . '/' . $lang->getTag() . '.css', ['version' => 'auto']);
$cachesStyleSheets = json_encode(array_keys($this->_styleSheets));
foreach (array_keys($this->_styleSheets) as $style)
{
unset($this->_styleSheets[$style]);
}
$isSidebarNav = $this->params->get('menu', 1) ? true : false;
$css = file_get_contents(__DIR__ . '/css/template' . ($this->direction === 'rtl' ? '-rtl' : '') . '.css');
?>
<!DOCTYPE html>
<html lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
<head>
<jdoc:include type="metas" />
<?php
/**<link href="/administrator/templates/<?php echo $this->template; ?>/css/template.css" rel="preload" as="style" media="(prefers-color-scheme: no-preference)">
<link href="/administrator/templates/<?php echo $this->template; ?>/css/template.css" rel="stylesheet" media="(prefers-color-scheme: no-preference)">
<link href="/administrator/templates/<?php echo $this->template; ?>/css/template-light.css" rel="preload" as="style" media="(prefers-color-scheme: light)">
<link href="/administrator/templates/<?php echo $this->template; ?>/css/template-light.css" rel="stylesheet" media="(prefers-color-scheme: light)">
<link href="/administrator/templates/<?php echo $this->template; ?>/css/template.css" rel="preload" as="style" media="(prefers-color-scheme: dark)">
<link href="/administrator/templates/<?php echo $this->template; ?>/css/template.css" rel="stylesheet" media="(prefers-color-scheme: dark)">
*/
?>
<style><?php echo $css; ?></style>
<jdoc:include type="styles" />
</head>
<body class="admin tpl-bettum <?php echo $option . ' view-' . $view . ' layout-' . $layout . ($task ? ' task-' . $task : ''); ?>">
<div class="bettum-grid">
<?php if (!$isSidebarNav) : ?>
<?php // Header ?>
<header id="header" class="header">
<nav class="navbar navbar-expand-lg navbar-dark" aria-label="<?php echo Text::_('MOD_MENU_ARIA_MAIN_MENU'); ?>">
<div class="container-fluid">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#topMenu" aria-controls="topMenu"
aria-expanded="false" aria-label="<?php echo Text::_('JTOGGLE_SIDEBAR_MENU'); ?>"><span class="navbar-toggler-icon"></span></button>
<a class="navbar-brand"<?php echo $href; ?>>
<img src="<?php echo $logo; ?>" alt="<?php echo Text::_('TPL_BETTUM_SITE_LOGO_LABEL'); ?>">
</a>
<jdoc:include type="modules" name="menu" style="none" />
</div>
</nav>
<div class="nav-scroller">
<nav class="nav nav-underline justify-content-between mb-3">
<jdoc:include type="modules" name="title" />
<div class="d-flex justify-content-end top-nav">
<jdoc:include type="modules" name="status" style="none" />
</div>
</nav>
</div>
</header>
<?php else : ?>
<div id="bettum-sidebar" class="sidebar">
<nav id="menu" aria-label="<?php echo Text::_('MOD_MENU_ARIA_MAIN_MENU'); ?>">
<a class="navbar-brand text-center"<?php echo $href; ?>>
<img src="<?php echo $logo; ?>" alt="<?php echo Text::_('TPL_BETTUM_SITE_LOGO_LABEL'); ?>">
</a>
<jdoc:include type="modules" name="menu" style="none" />
</nav>
</div>
<?php endif; ?>
<?php // Wrapper ?>
<div id="wrapper" class="wrapper<?php $isSidebarNav ? '' : ' d-flex'; ?>">
<?php if ($isSidebarNav) : ?>
<?php // Header ?>
<header id="header" class="header">
<div class="nav-scroller">
<nav class="nav nav-underline justify-content-between mb-3">
<jdoc:include type="modules" name="title" />
<div class="d-flex justify-content-end top-nav">
<jdoc:include type="modules" name="status" style="none" />
<button id="navbar-toggler" class="btn nav-link d-inline-flex d-lg-none align-items-center" type="button" aria-controls="topMenu" aria-expanded="false" aria-label="Toggle navigation"><svg aria-hidden="true" width="1em" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"/></svg></button>
</div>
</nav>
</div>
</header>
<?php endif; ?>
<?php // container-fluid ?>
<div class="container-fluid container-main px-4">
<?php if (!$cpanel) : ?>
<?php // Subheader ?>
<div class="mb-3 d-unset">
<button type="button" class="btn btn-primary my-2 d-md-none d-lg-none d-xl-none" data-bs-toggle="collapse" data-bs-target=".subhead"><?php echo Text::_('JTOOLBAR'); ?>
<span class="icon-chevron-down" aria-hidden="true"></span></button>
<div id="subhead" class="subhead sticky-top show">
<div id="container-collapse" class="container-collapse"></div>
<div class="row">
<div class="col-md-12">
<jdoc:include type="modules" name="toolbar" style="no" />
</div>
</div>
</div>
</div>
<?php endif; ?>
<section id="content" class="content">
<?php // Begin Content ?>
<jdoc:include type="modules" name="top" style="xhtml" />
<div class="row">
<?php if ($cpanel) : ?>
<div class="col-md-4">
<?php if ($this->countModules('cpanel-left')) : ?>
<jdoc:include type="modules" name="cpanel-left" style="well" />
<?php endif; ?>
</div>
<?php endif; ?>
<div class="<?php echo $cpanel && $this->countModules('cpanel-left') ? 'col-md-8' : 'col-md-12'; ?>">
<main>
<jdoc:include type="component" />
</main>
</div>
<?php if ($this->countModules('bottom')) : ?>
<jdoc:include type="modules" name="bottom" style="xhtml" />
<?php endif; ?>
</div>
<?php // End Content ?>
</section>
<div class="notify-alerts">
<jdoc:include type="message" />
</div>
</div>
</div>
</div>
<jdoc:include type="modules" name="debug" style="none" />
<jdoc:include type="scripts" />
<script>
const styles = <?php echo $cachesStyleSheets; ?>;
styles.forEach(file => {
const link = document.body.appendChild(document.createElement('link'));
link.rel = 'stylesheet';
link.href = file;
});
</script>
</body>
</html>