-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
159 lines (146 loc) · 6.4 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
<?php
/**
* @package Qhtml5
* @subpackage Templates.qhtml5
* @author Quantility
* @copyright Copyright (C) 2019. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// no direct access
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
// Caricamento classi da helpers/qhtml5.php
JLoader::import('qhtml5.helpers.qhtml5', JPATH_THEMES);
//Inizializzo le variabili per Joomla
$app = JFactory::getApplication();
$user = JFactory::getUser();
// Output come HTML5
$this->setHtml5(true);
// Disabilita Generator
$this->setGenerator(null);
//Imposta Meta
$this->setMetaData('viewport', 'width=device-width,initial-scale=1');
// Inizializzo i paramentri dalla configurazione del template
$params = $app->getTemplate(true)->params;
// Controllo le variabili attive (POST e GET) - Come su template Protostar
$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 = $app->get('sitename');
// Variabili di QHTML5
$itemidMenu = JRequest::getVar('Itemid');
$menu = $app->getMenu()->getActive();
$active = $app->getMenu()->getItem($itemidMenu);
$pageclass = '';
$contentwidth = '';
if (is_object($menu)) {
$pageclass = $menu->params->get('pageclass_sfx');
}
$qhtml5_bs4_grid_min = 'templates/' . $this->template . '/css/bootstrap4/bootstrap-grid.min.css';
$qhtml5_bs4_grid = 'templates/' . $this->template . '/css/bootstrap4/bootstrap-grid.css';
$qhtml5_template = 'templates/' . $this->template . '/css/template.css';
$qhtml5_magento = 'templates/' . $this->template . '/css/magento.css';
$qhtml5_responsive = 'templates/' . $this->template . '/css/responsive.css';
$qhtml5_customjs = 'templates/' . $this->template . '/js/custom.js';
// array di classi per il body
$bodyclass = 'site ' . $option . ' view-' . $view
. ($layout ? ' layout-' . $layout : ' no-layout')
. ($task ? ' task-' . $task : ' no-task')
. ($itemid ? ' itemid-' . $itemid : '')
. ($pageclass ? $pageclass : '')
. ($this->direction === 'rtl' ? ' rtl' : '');
// ---------- caricamento CSS Styles ---------------- //
if ($params->get('bootstrapcss') == '1') {
HTMLHelper::_('stylesheet', 'media/jui/css/bootstrap.min.css', false, false);
HTMLHelper::_('bootstrap.loadCss', false, $this->direction);
} else if ($params->get('bootstrapcss') == '2') {
HTMLHelper::_('stylesheet', 'media/jui/css/bootstrap.min.css', false, false);
HTMLHelper::_('stylesheet', 'media/jui/css/bootstrap-responsive.min.css', false, false);
HTMLHelper::_('bootstrap.loadCss', false, $this->direction);
} else if ($params->get('bootstrapcss') == '3') {
HTMLHelper::_('stylesheet', 'media/jui/css/bootstrap.min.css', false, false);
HTMLHelper::_('stylesheet', 'media/jui/css/bootstrap-responsive.min.css', false, false);
HTMLHelper::_('stylesheet', 'media/jui/css/bootstrap-extended.css', false, false);
HTMLHelper::_('bootstrap.loadCss', false, $this->direction);
}
if ($params->get('bootstrapcss4grid') == '1') {
if(file_exists($qhtml5_bs4_grid_min)){
HTMLHelper::_('stylesheet', $qhtml5_bs4_grid_min, false, false);
} else if(file_exists($qhtml5_bs4_grid)){
HTMLHelper::_('stylesheet', $qhtml5_bs4_grid, false, false);
}
}
if(file_exists($qhtml5_template)){
HTMLHelper::_('stylesheet', $qhtml5_template, false, false);
}
if(file_exists($qhtml5_magento)){
HTMLHelper::_('stylesheet', $qhtml5_magento, false, false);
}
if(file_exists($qhtml5_responsive)){
HTMLHelper::_('stylesheet', $qhtml5_responsive, false, false);
}
// -------------------------------------------------- //
// ---------- caricamento JS Scripts ---------------- //
// Caricamento jquery UI core o sortable
if($params->get('jquery') == 1):
HTMLHelper::_('jquery.framework');
endif;
if($params->get('jqueryui') == 1):
HTMLHelper::_('jquery.ui', array('core', 'sortable'));
endif;
if ($params->get('bootstrap') == '1') {
HTMLHelper::_('bootstrap.framework');
} else if ($params->get('bootstrap') == '2') {
// Bootstrap Custom
}
// Add template js
HTMLHelper::_('script', 'template.js', array('version' => 'auto', 'relative' => true));
// -------------------------------------------------- //
// ---------- calcoli template ---------------------- //
//span per left e right: dimensioni fisse per migliore user interface span3 | span6 | span3
if ($this -> countModules('left')) {
$leftspan = 'span3';
}
if ($this -> countModules('right')) {
$rightspan = 'span3';
}
if ($this -> countModules('left or right')) {
$contentwidth = "span9";
if ($this -> countModules('left and right')) {
$contentwidth = "span6";
}
} else {
$contentwidth = "span12";
}
// -------------------------------------------------- //
?>
<!DOCTYPE html>
<html lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
<head>
<?php if ($params->get('after_head_open')) echo "<!-- after_head_open start -->"."\r\n".$params->get('after_head_open')."\r\n"."<!-- after_head_open end -->"."\r\n"; ?>
<?php if ($params->get('favicon_code')) echo "<!-- favicon_code start -->"."\r\n".$params->get('favicon_code')."\r\n"."<!-- favicon_code end -->"."\r\n";?>
<!-- Head Start -->
<jdoc:include type="head" />
<!-- Head End -->
<!-- Extra Styles Start -->
<!-- Extra Styles End -->
<!-- Extra Scripts Start -->
<!-- Extra Scripts End -->
<?php if ($this->countModules('head')): ?><jdoc:include type="modules" name="head" style="raw" /><?php endif; ?>
<?php if ($params->get('before_head_close')) echo "<!-- before_head_close start -->"."\r\n".$params->get('before_head_close')."\r\n"."<!-- before_head_close end -->"."\r\n"; ?>
</head>
<body class="<?php echo $bodyclass; ?>">
<?php if ($params->get('after_body_open')) echo "<!-- after_body_open start -->"."\r\n".$params->get('after_body_open')."\r\n"."<!-- after_body_open end -->"."\r\n"; ?>
<?php if ($params->get('browserupgrade') == '1') : ?>
<?php include 'includes/browserupgrade.php'; ?>
<?php endif; ?>
<?php include 'template.php'; ?>
<?php if ($params->get('before_body_close')) echo "<!-- before_body_close start -->"."\r\n".$params->get('before_body_close')."\r\n"."<!-- before_body_close end -->"."\r\n"; ?>
<jdoc:include type="modules" name="debug" style="none" />
<?php if(file_exists($qhtml5_customjs)): ?>
<script src="<?php echo $qhtml5_customjs; ?>"></script>
<?php endif; ?>
</body>
</html>