-
Notifications
You must be signed in to change notification settings - Fork 10
/
error_full.php
157 lines (139 loc) · 5.65 KB
/
error_full.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
<?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 JDocumentError $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';
HTMLHelper::_('bootstrap.framework');
// 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" />
<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">
<jdoc:include type="modules" name="menu" style="none" />
<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">
<jdoc:include type="modules" name="menu" style="none" />
</div>
<?php endif; ?>
<?php // Wrapper ?>
<div id="wrapper" class="d-flex">
<?php // container-fluid ?>
<div class="container-fluid container-main px-5">
<?php if (!$cpanel) : ?>
<?php // Subheader ?>
<button type="button" class="toggle-toolbar mx-auto btn btn-secondary my-2 d-md-none d-lg-none d-xl-none" data-bs-toggle="collapse" data-bs-target=".subhead"><?php echo Text::_('TPL_BETTUM_TOOLBAR'); ?>
<span class="icon-chevron-down" aria-hidden="true"></span></button>
<div id="subhead" class="subhead mb-3">
<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>
<?php endif; ?>
<section id="content" class="content">
<?php // Begin Content ?>
<jdoc:include type="modules" name="top" style="xhtml" />
<div class="row">
<div class="col-md-12">
<h1><?php echo Text::_('JERROR_AN_ERROR_HAS_OCCURRED'); ?></h1>
<blockquote class="blockquote">
<span class="badge bg-danger"><?php echo $this->error->getCode(); ?></span>
<?php echo htmlspecialchars($this->error->getMessage(), ENT_QUOTES, 'UTF-8'); ?>
</blockquote>
<?php if ($this->debug) : ?>
<div>
<?php echo $this->renderBacktrace(); ?>
<?php // Check if there are more Exceptions and render their data as well ?>
<?php if ($this->error->getPrevious()) : ?>
<?php $loop = true; ?>
<?php // Reference $this->_error here and in the loop as setError() assigns errors to this property and we need this for the backtrace to work correctly ?>
<?php // Make the first assignment to setError() outside the loop so the loop does not skip Exceptions ?>
<?php $this->setError($this->_error->getPrevious()); ?>
<?php while ($loop === true) : ?>
<p><strong><?php echo Text::_('JERROR_LAYOUT_PREVIOUS_ERROR'); ?></strong></p>
<p><?php echo htmlspecialchars($this->_error->getMessage(), ENT_QUOTES, 'UTF-8'); ?></p>
<?php echo $this->renderBacktrace(); ?>
<?php $loop = $this->setError($this->_error->getPrevious()); ?>
<?php endwhile; ?>
<?php // Reset the main error object to the base error ?>
<?php $this->setError($this->error); ?>
<?php endif; ?>
</div>
<?php endif; ?>
<p>
<a href="<?php echo $this->baseurl; ?>" class="btn btn-primary"><?php echo Text::_('JGLOBAL_TPL_CPANEL_LINK_TEXT'); ?></a>
</p>
</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>