forked from construct-framework/bootstruct
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patherror.php
373 lines (346 loc) · 16.2 KB
/
error.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
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
<?php defined('_JEXEC') or die;
/**
* @package Template Framework for Joomla!+
* @author Cristina Solana http://nightshiftcreative.com
* @author Matt Thomas http://construct-framework.com | http://betweenbrain.com
* @copyright Copyright (C) 2009 - 2013 Matt Thomas. All rights reserved.
* @license GNU/GPL v2 or later http://www.gnu.org/licenses/gpl-2.0.html
*/
// Load Joomla filesystem package
jimport('joomla.filesystem.file');
// To get an application object
$app = JFactory::getApplication();
// Returns a reference to the global document object
$doc = JFactory::getDocument();
// Get the offline status of the website
$offLine = $app->getCfg('offline');
// Define relative path to the current template directory
$template = 'templates/' . $this->template;
// Get language and direction
$this->language = $doc->language;
$this->direction = $doc->direction;
// Send the user to the home page if the website is offline
if ($offLine) {
$app->redirect($this->baseurl);
}
// Manually define layout and module counts
$columnLayout = 'alpha-1-main-beta-1';
$headerAboveClass = 'count-1';
$headerBelowClass = 'count-6';
$navBelowClass = 'count-4';
$contentAboveClass = 'count-1';
$contentBelowClass = '';
$columnGroupAlphaClass = 'count-1';
$columnGroupBetaClass = '';
$footerAboveClass = 'count-1';
// Access template parameters
$params = JFactory::getApplication()->getTemplate(true)->params;
$customStyleSheet = $params->get('customStyleSheet');
$fluidMedia = $params->get('fluidMedia');
$fullWidth = $params->get('fullWidth');
$googleWebFont = $params->get('googleWebFont');
$googleWebFontTargets = $params->get('googleWebFontTargets');
$googleWebFont2 = $params->get('googleWebFont2');
$googleWebFontTargets2 = $params->get('googleWebFontTargets2');
$googleWebFont3 = $params->get('googleWebFont3');
$googleWebFontTargets3 = $params->get('googleWebFontTargets3');
$gridSystem = $params->get('gridSystem');
$IECSS3 = $params->get('IECSS3');
$IECSS3Targets = $params->get('IECSS3Targets');
$inheritLayout = $params->get('inheritLayout');
$inheritStyle = $params->get('inheritStyle');
$loadMoo = $params->get('loadMoo');
$setGeneratorTag = $params->get('setGeneratorTag');
$showDiagnostics = $params->get('showDiagnostics');
$siteWidth = $params->get('siteWidth');
$siteWidthType = $params->get('siteWidthType');
$siteWidthUnit = $params->get('siteWidthUnit');
$stickyFooterHeight = $params->get('stickyFooterHeight');
$useStickyFooter = $params->get('useStickyFooter');
// Render module positions
$renderer = $doc->loadRenderer('modules');
$raw = array('style' => 'raw');
$xhtml = array('style' => 'xhtml');
$jexhtml = array('style' => 'jexhtml');
// Check for layout override
if (JFile::exists($template . '/layouts/error.php')) {
include_once $template . '/layouts/error.php';
} else {
?>
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="<?php echo substr($this->language, 0, 2) ?>" dir="<?php echo $this->direction ?>"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="<?php echo substr($this->language, 0, 2) ?>" dir="<?php echo $this->direction ?>"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="<?php echo substr($this->language, 0, 2) ?>" dir="<?php echo $this->direction ?>"> <![endif]-->
<!--[if gt IE 8]> <!--> <html class="no-js" lang="<?php echo substr($this->language, 0, 2) ?>" dir="<?php echo $this->direction ?>"> <!--<![endif]-->
<head>
<meta name="copyright" content="<?php echo htmlspecialchars($app->getCfg('sitename')) ?>" />
<link rel="shortcut icon" href="<?php echo $this->baseurl . '/templates/' . $this->template ?>/favicon.ico" type="image/x-icon" />
<link rel="icon" href="<?php echo $this->baseurl . '/templates/' . $this->template ?>/favicon.png" type="image/png" />
<link rel="stylesheet" href="<?php echo $this->baseurl . '/templates/' . $this->template ?>/css/screen.css" type="text/css" media="screen" />
<link rel="stylesheet" href="<?php echo $this->baseurl . '/templates/' . $this->template ?>/css/print.css" type="text/css" media="print" />
<?php
if ($customStyleSheet > -1)
echo '<link rel="stylesheet" href="' . $this->baseurl . '/templates/' . $this->template . '/css/' . $customStyleSheet . '" type="text/css" media="screen" />';
if ($gridSystem != '-1')
echo '<link rel="stylesheet" href="' . $this->baseurl . '/templates/' . $this->template . '/css/grids/' . $gridSystem . '" type="text/css" media="screen" />';
if ($this->direction == 'rtl')
echo '<link rel="stylesheet" href="' . $this->baseurl . '/templates/' . $this->template . '/css/rtl.css" type="text/css" media="screen" />';
if (isset($cssFile))
echo "\n" . $cssFile;
if ($googleWebFont != "")
echo '<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=' . $googleWebFont . '">
<style type="text/css">' . $googleWebFontTargets . '{font-family:' . $googleWebFont . ', serif !important;} </style>';
if ($googleWebFont2 != "")
echo '<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=' . $googleWebFont2 . '">
<style type="text/css">' . $googleWebFontTargets2 . '{font-family:' . $googleWebFont2 . ', serif !important;} </style>';
if ($googleWebFont3 != "")
echo '<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=' . $googleWebFont3 . '">
<style type="text/css">' . $googleWebFontTargets3 . '{font-family:' . $googleWebFont3 . ', serif !important;} </style>';
if ($siteWidth)
echo '<style type="text/css"> #body-container, #header-above {' . $siteWidthType . ':' . $siteWidth . $siteWidthUnit . ' !important}</style>';
if ($siteWidth && !$fullWidth)
echo '<style type="text/css"> #header, #footer {' . $siteWidthType . ':' . $siteWidth . $siteWidthUnit . ';margin:0 auto}</style>';
if (($siteWidthType == 'max-width') && $fluidMedia)
echo '<style type="text/css"> img, object {max-width:100%}</style>';
?>
<?php if ($useStickyFooter) {
echo ' <style type="text/css">.sticky-footer #body-container{padding-bottom:' . $stickyFooterHeight . 'px;}
.sticky-footer #footer{margin-top:-' . $stickyFooterHeight . 'px;height:' . $stickyFooterHeight . 'px;}
</style>
<!--[if !IE 7]>
<style type="text/css">.sticky-footer #footer-push {display:table;height:100%}</style>
<![endif]-->';
} ?>
<?php if ($IECSS3) {
echo ' <!--[if !IE 9]>
<style type="text/css">' . $IECSS3Targets . '"{behavior:url("' . $this->baseurl . '/templates/' . $this->template . '/js/PIE.htc)</style>
<![endif]-->';
}
echo "\n" ?>
</head>
<body id="page-top" class="<?php echo $columnLayout; if ($useStickyFooter) echo ' sticky-footer' ?> error">
<div id="footer-push">
<?php if ($headerAboveClass) : ?>
<div id="header-above" class="clearfix">
<div id="header-above-1" class="<?php echo $headerAboveClass ?>">
<?php echo $renderer->render('header-above-1', $jexhtml, null) ?>
</div>
<div id="header-above-2" class="<?php echo $headerAboveClass ?>">
<?php echo $renderer->render('header-above-2', $jexhtml, null) ?>
</div>
<div id="header-above-3" class="<?php echo $headerAboveClass ?>">
<?php echo $renderer->render('header-above-3', $jexhtml, null) ?>
</div>
<div id="header-above-4" class="<?php echo $headerAboveClass ?>">
<?php echo $renderer->render('header-above-4', $jexhtml, null) ?>
</div>
<div id="header-above-5" class="<?php echo $headerAboveClass ?>">
<?php echo $renderer->render('header-above-5', $jexhtml, null) ?>
</div>
<div id="header-above-6" class="<?php echo $headerAboveClass ?>">
<?php echo $renderer->render('header-above-6', $jexhtml, null) ?>
</div>
</div>
<?php endif ?>
<header id="header" class="clear clearfix">
<div class="gutter">
<h1 id="logo">
<a href="<?php echo $this->baseurl ?>/" title="<?php echo htmlspecialchars($app->getCfg('sitename')) ?>"><?php echo $this->baseurl ?></a>
</h1>
<?php echo $renderer->render('header', $jexhtml, null) ?>
<nav>
<ul id="access">
<li>Jump to:</li>
<li><a href="<?php echo $this->baseurl ?>/index.php#content" class="to-content">Content</a></li>
<li><a href="<?php echo $this->baseurl ?>/index.php#nav" class="to-nav">Navigation</a></li>
<li><a href="<?php echo $this->baseurl ?>/index.php#additional" class="to-additional">Additional Information</a></li>
</ul>
</nav>
</div>
</header>
<section id="body-container">
<?php if ($headerBelowClass) : ?>
<div id="header-below" class="clearfix">
<div id="header-below-1" class="<?php echo $headerBelowClass ?>">
<?php echo $renderer->render('header-below-1', $jexhtml, null) ?>
</div>
<div id="header-below-2" class="<?php echo $headerBelowClass ?>">
<?php echo $renderer->render('header-below-2', $jexhtml, null) ?>
</div>
<div id="header-below-3" class="<?php echo $headerBelowClass ?>">
<?php echo $renderer->render('header-below-3', $jexhtml, null) ?>
</div>
<div id="header-below-4" class="<?php echo $headerBelowClass ?>">
<?php echo $renderer->render('header-below-4', $jexhtml, null) ?>
</div>
<div id="header-below-5" class="<?php echo $headerBelowClass ?>">
<?php echo $renderer->render('header-below-5', $jexhtml, null) ?>
</div>
<div id="header-below-6" class="<?php echo $headerBelowClass ?>">
<?php echo $renderer->render('header-below-6', $jexhtml, null) ?>
</div>
</div>
<?php endif ?>
<?php echo $renderer->render('breadcrumbs', $raw, null) ?>
<nav id="nav" class="clear">
<?php echo $renderer->render('nav', $raw, null) ?>
</nav>
<div id="content-container" class="clear clearfix">
<?php if ($navBelowClass) : ?>
<div id="nav-below" class="clearfix">
<div id="nav-below-1" class="<?php echo $navBelowClass ?>">
<?php echo $renderer->render('nav-below-1', $jexhtml, null) ?>
</div>
<div id="nav-below-2" class="<?php echo $navBelowClass ?>">
<?php echo $renderer->render('nav-below-2', $jexhtml, null) ?>
</div>
<div id="nav-below-3" class="<?php echo $navBelowClass ?>">
<?php echo $renderer->render('nav-below-3', $jexhtml, null) ?>
</div>
<div id="nav-below-4" class="<?php echo $navBelowClass ?>">
<?php echo $renderer->render('nav-below-4', $jexhtml, null) ?>
</div>
<div id="nav-below-5" class="<?php echo $navBelowClass ?>">
<?php echo $renderer->render('nav-below-5', $jexhtml, null) ?>
</div>
<div id="nav-below-6" class="<?php echo $navBelowClass ?>">
<?php echo $renderer->render('nav-below-6', $jexhtml, null) ?>
</div>
</div>
<?php endif ?>
<div id="load-first" class="clearfix">
<div id="content-main">
<div class="gutter">
<?php if ($contentAboveClass) : ?>
<div id="content-above" class="clearfix">
<div id="content-above-1" class="<?php echo $contentAboveClass ?>">
<?php echo $renderer->render('content-above-1', $jexhtml, null) ?>
</div>
<div id="content-above-2" class="<?php echo $contentAboveClass ?>">
<?php echo $renderer->render('content-above-2', $jexhtml, null) ?>
</div>
<div id="content-above-3" class="<?php echo $contentAboveClass ?>">
<?php echo $renderer->render('content-above-3', $jexhtml, null) ?>
</div>
<div id="content-above-4" class="<?php echo $contentAboveClass ?>">
<?php echo $renderer->render('content-above-4', $jexhtml, null) ?>
</div>
<div id="content-above-5" class="<?php echo $contentAboveClass ?>">
<?php echo $renderer->render('content-above-5', $jexhtml, null) ?>
</div>
<div id="content-above-6" class="<?php echo $contentAboveClass ?>">
<?php echo $renderer->render('content-above-6', $jexhtml, null) ?>
</div>
</div>
<?php endif ?>
<div id="error-message">
<?php echo $this->error->getCode() ?> - <?php echo $this->error->getMessage() ?>
<p><strong><?php echo JText::_('You may not be able to visit this page because of:') ?></strong>
</p>
<ol>
<li><?php echo JText::_('An out-of-date bookmark/favourite') ?></li>
<li><?php echo JText::_('A search engine that has an out-of-date listing for this site') ?></li>
<li><?php echo JText::_('A mis-typed address') ?></li>
<li><?php echo JText::_('You have no access to this page') ?></li>
<li><?php echo JText::_('The requested resource was not found') ?></li>
<li><?php echo JText::_('An error has occurred while processing your request.') ?></li>
</ol>
<p><strong><?php echo JText::_('Please try one of the following pages:') ?></strong></p>
<ul>
<li>
<a href="<?php echo $this->baseurl ?>/" title="<?php echo JText::_('Go to the home page') ?>"><?php echo JText::_('Home Page') ?></a>
</li>
</ul>
<p><?php echo JText::_('If difficulties persist, please contact the system administrator of this site.') ?></p>
<p><?php echo $this->error->getMessage() ?></p>
<p>
<?php if ($this->debug) :
echo $this->renderBacktrace();
endif ?>
</p>
</div>
<?php if ($contentBelowClass) : ?>
<div id="content-below" class="clearfix">
<div id="content-below-1" class="<?php echo $contentBelowClass ?>">
<?php echo $renderer->render('content-below-1', $jexhtml, null) ?>
</div>
<div id="content-below-2" class="<?php echo $contentBelowClass ?>">
<?php echo $renderer->render('content-below-2', $jexhtml, null) ?>
</div>
<div id="content-below-3" class="<?php echo $contentBelowClass ?>">
<?php echo $renderer->render('content-below-3', $jexhtml, null) ?>
</div>
<div id="content-below-4" class="<?php echo $contentBelowClass ?>">
<?php echo $renderer->render('content-below-4', $jexhtml, null) ?>
</div>
<div id="content-below-5" class="<?php echo $contentBelowClass ?>">
<?php echo $renderer->render('content-below-5', $jexhtml, null) ?>
</div>
<div id="content-below-6" class="<?php echo $contentBelowClass ?>">
<?php echo $renderer->render('content-below-6', $jexhtml, null) ?>
</div>
</div>
<?php endif ?>
</div>
</div>
<?php if ($columnGroupAlphaClass) : ?>
<div id="column-group-alpha">
<div class="gutter clearfix">
<div id="column-1" class="<?php echo $columnGroupAlphaClass ?>">
<?php echo $renderer->render('column-1', $jexhtml, null) ?>
</div>
<div id="column-2" class="<?php echo $columnGroupAlphaClass ?>">
<?php echo $renderer->render('column-2', $jexhtml, null) ?>
</div>
</div>
</div>
<?php endif ?>
</div>
<?php if ($columnGroupBetaClass) : ?>
<div id="column-group-beta">
<div class="gutter clearfix">
<div id="column-3" class="<?php echo $columnGroupBetaClass ?>">
<?php echo $renderer->render('column-3', $jexhtml, null) ?>
</div>
<div id="column-4" class="<?php echo $columnGroupBetaClass ?>">
<?php echo $renderer->render('column-4', $jexhtml, null) ?>
</div>
</div>
</div>
<?php endif ?>
<?php if ($footerAboveClass) : ?>
<div id="footer-above" class="clearfix">
<div id="footer-above-1" class="<?php echo $footerAboveClass ?>">
<?php echo $renderer->render('footer-above-1', $jexhtml, null) ?>
</div>
<div id="footer-above-2" class="<?php echo $footerAboveClass ?>">
<?php echo $renderer->render('footer-above-2', $jexhtml, null) ?>
</div>
<div id="footer-above-3" class="<?php echo $footerAboveClass ?>">
<?php echo $renderer->render('footer-above-3', $jexhtml, null) ?>
</div>
<div id="footer-above-4" class="<?php echo $footerAboveClass ?>">
<?php echo $renderer->render('footer-above-4', $jexhtml, null) ?>
</div>
<div id="footer-above-5" class="<?php echo $footerAboveClass ?>">
<?php echo $renderer->render('footer-above-5', $jexhtml, null) ?>
</div>
<div id="footer-above-6" class="<?php echo $footerAboveClass ?>">
<?php echo $renderer->render('footer-above-6', $jexhtml, null) ?>
</div>
</div>
<?php endif ?>
</div>
</section>
</div>
<footer id="footer" class="clear clearfix">
<div class="gutter clearfix">
<a id="to-page-top" href="<?php echo $this->baseurl ?>/index.php#page-top">Back to Top</a>
<?php echo $renderer->render('syndicate', $jexhtml, null) ?>
<?php echo $renderer->render('footer', $jexhtml, null) ?>
</div>
</footer>
<?php echo $renderer->render('analytics', $raw, null) ?>
</body>
</html>
<?php }