-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
286 lines (230 loc) · 8.35 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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
<?php
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Uri\Uri;
/** @var Joomla\CMS\Document\HtmlDocument $this */
$app = Factory::getApplication();
$wa = $this->getWebAssetManager();
// Browsers support SVG favicons
$this->addHeadLink(HTMLHelper::_('image', 'joomla-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', 'joomla-favicon-pinned.svg', '', [], true, 1), 'mask-icon', 'rel', ['color' => '#000']);
// Detecting Active Variables
$option = $app->input->getCmd('option', '');
$view = $app->input->getCmd('view', '');
$layout = $app->input->getCmd('layout', '');
$task = $app->input->getCmd('task', '');
$itemid = $app->input->getCmd('Itemid', '');
$sitename = htmlspecialchars($app->get('sitename'), ENT_QUOTES, 'UTF-8');
$menu = $app->getMenu()->getActive();
$pageclass = $menu !== null ? $menu->getParams()->get('pageclass_sfx', '') : '';
// Enable assets
$wa->useStyle('template.jshop4'.($this->direction == 'rtl' ? '.rtl' : ''))
->useScript('template.bootstrap');
// Disable foobar from being attached
$wa->disableStyle('bootstrap.css');
#$wa->disableScript('jquery-noconflict');
// override wa
/*
$templatePath = 'templates/' . $this->template;
$wa->registerAndUseStyle('bootstrap', $templatePath . '/css/bootstrap.min.css');
$wa->registerAndUseStyle('jshop4', $templatePath . '/css/jshop4.css');
*/
$right = $this->countModules('right');
$left = $this->countModules('left');
$articleCol = "";
if($right !== true && $left == true){
$articleCol="col-12 col-md-10";
}elseif($right == true && $left !== true){
$articleCol="col-12 col-md-10";
}elseif($right == true && $left == true){
$articleCol="col-12 col-md-8";
}else{
$articleCol = "col-12";
}
// Logo file or site title param
if ($this->params->get('logoFile'))
{
$logo = '<img src="' . Uri::root(true) . '/' . htmlspecialchars($this->params->get('logoFile'), ENT_QUOTES) . '" alt="' . $sitename . '">';
}
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'], true, 0);
}
// Container
$container = $this->params->get('fluidContainer') ? 'container-fluid' : 'container';
$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" />
<jdoc:include type="styles" />
<jdoc:include type="scripts" />
</head>
<body class="site <?php echo $option
. ' '
. ' view-' . $view
. ($layout ? ' layout-' . $layout : ' no-layout')
. ($task ? ' task-' . $task : ' no-task')
. ($itemid ? ' itemid-' . $itemid : '')
. ($pageclass ? ' ' . $pageclass : '')
. ($this->direction == 'rtl' ? ' rtl' : '');
?>">
<header class="clearfix">
<?php if ($this->countModules('topbar',true)) : ?>
<div id="topbar" class="py-1 mb-2 clearfix">
<div class="<?php echo $container; ?> clearfix">
<div class="row">
<jdoc:include type="modules" name="topbar" style="html5" />
</div>
</div>
</div>
<?php endif; ?>
<div class="<?php echo $container; ?> clearfix">
<div class="row clearfix">
<?php if ($this->params->get('brand', 1)) : ?>
<div class="col-6 col-md-3 clearfix">
<a class="brand-logo d-md-inline-block" href="<?php echo $this->baseurl; ?>/">
<?php echo $logo; ?>
</a>
<?php if ($this->params->get('siteDescription')) : ?>
<span class="site-description h5 d-block d-md-inline-block"><?php echo htmlspecialchars($this->params->get('siteDescription')); ?></span>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if ($this->countModules('header',true)) : ?>
<jdoc:include type="modules" name="header" style="html5" />
<?php endif; ?>
</div>
</div>
<?php if ($this->countModules('menu', true)) : ?>
<nav id="menu" class="<?php echo $container; ?> clearfix">
<div class="row clearfix">
<jdoc:include type="modules" name="menu" style="html5" />
</div>
</nav>
<?php endif; ?>
</header>
<?php if ($this->countModules('banner', true)) : ?>
<div id="banner" class="clearfix">
<div class="<?php echo $container; ?> clearfix">
<div class="row clearfix">
<jdoc:include type="modules" name="banner" style="html5" />
</div>
</div>
</div>
<?php endif; ?>
<?php if ($this->countModules('custom-a', true)) : ?>
<div id="custom-a" class="<?php echo $container; ?> my-5 clearfix">
<div class="row g-0 clearfix">
<jdoc:include type="modules" name="custom-a" style="html5" />
</div>
</div>
<?php endif; ?>
<?php if ($this->countModules('custom-b', true)) : ?>
<div id="custom-b" class="<?php echo $container; ?> my-5 clearfix">
<div class="row g-0 clearfix">
<jdoc:include type="modules" name="custom-b" style="html5" />
</div>
</div>
<?php endif; ?>
<?php if ($this->countModules('custom-c', true)) : ?>
<div id="custom-c" class="<?php echo $container; ?> my-5 clearfix">
<div class="row g-0 clearfix">
<jdoc:include type="modules" name="custom-c" style="html5" />
</div>
</div>
<?php endif; ?>
<?php if ($this->countModules('custom-d', true)) : ?>
<div id="custom-d" class="<?php echo $container; ?> my-5 clearfix">
<div class="row g-0 clearfix">
<jdoc:include type="modules" name="custom-d" style="html5" />
</div>
</div>
<?php endif; ?>
<main class="<?php echo $container; ?> clearfix">
<div class="row clearfix">
<?php if ($this->countModules('right', true)) : ?>
<div id="right" class="col-12 col-md-2 clearfix">
<jdoc:include type="modules" name="right" style="html5" />
</div>
<?php endif; ?>
<article class="<?php echo $articleCol; ?> clearfix">
<div class="row clearfix">
<?php if ($this->countModules('main-top', true)) : ?>
<div class="main-top">
<jdoc:include type="modules" name="main-top" style="html5" />
</div>
<?php endif; ?>
<jdoc:include type="message" />
<div id="content" class="clearfix">
<jdoc:include type="component" />
</div>
<?php if ($this->countModules('main-bottom', true)) : ?>
<div class="main-bottom">
<jdoc:include type="modules" name="main-bottom" style="html5" />
</div>
<?php endif; ?>
</div>
</article>
<?php if ($this->countModules('left', true)) : ?>
<div id="left" class="col-12 col-md-2 clearfix">
<jdoc:include type="modules" name="left" style="html5" />
</div>
<?php endif; ?>
</div>
</main>
<div id="bottom" class="<?php echo $container; ?> clearfix">
<?php if ($this->countModules('bottom-a', true)) : ?>
<div class="bottom-a">
<jdoc:include type="modules" name="bottom-a" style="html5" />
</div>
<?php endif; ?>
<?php if ($this->countModules('bottom-b', true)) : ?>
<div class="grid-child container-bottom-b">
<jdoc:include type="modules" name="bottom-b" style="html5" />
</div>
<?php endif; ?>
</div>
<?php if ($this->countModules('breadcrumbs', true)) : ?>
<div id="breadcrumbs" class="clearfix">
<div class="<?php echo $container; ?> clearfix">
<div class="row clearfix">
<jdoc:include type="modules" name="breadcrumbs" style="html5" />
</div>
</div>
</div>
<?php endif; ?>
<?php if ($this->countModules('footer', true)) : ?>
<footer id="footer" class="clearfix">
<div class="<?php echo $container; ?> clearfix">
<div class="row clearfix">
<jdoc:include type="modules" name="footer" style="html5" />
</div>
</div>
<?php if ($this->countModules('copyright', true)) : ?>
<div id="copyright" class="clearfix">
<div class="<?php echo $container; ?> clearfix">
<div class="row clearfix">
<jdoc:include type="modules" name="copyright" style="html5" />
</div>
</div>
</div>
<?php endif; ?>
</footer>
<?php endif; ?>
<?php if ($this->params->get('backTop') == 1) : ?>
<a href="#top" id="back-top" class="back-to-top-link" aria-label="<?php echo Text::_('TPL_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>