This repository has been archived by the owner on Apr 28, 2022. It is now read-only.
/
Errors.template.php
212 lines (186 loc) · 10.3 KB
/
Errors.template.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
<?php
/**
* Simple Machines Forum (SMF)
*
* @package SMF
* Tema Echo Echo con boostrap v3.3.6 para SMF 2.0.11, en este entonces la más estable
* Autor: Dhayzon
* Contacto: Dhayzon.com
* Code licensed MIT, docs CC BY 3.0.
* @author Simple Machines
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0
*/
// !!!
/* This template file contains only the sub template fatal_error. It is
shown when an error occurs, and should show at least a back button and
$context['error_message'].
*/
// Show an error message.....
function template_fatal_error()
{
global $context, $settings, $options, $txt;
echo '
<div id="fatal_error">
<div class="alert alert-danger" role="alert">
<strong>', $context['error_title'], '</strong><br />
', $context['error_message'], '
</div></div>';
// Show a back button (using javascript.)
echo '
<div class="text-center"><a href="javascript:history.go(-1)" class="btn btn-danger">', $txt['back'], '</a></div>';
}
function template_error_log()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;
echo '
<form action="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', ';start=', $context['start'], $context['has_filter'] ? $context['filter']['href'] : '', '" method="post" accept-charset="', $context['character_set'], '" onsubmit="if (lastClicked == \'remove_all\' && !confirm(\'', $txt['sure_about_errorlog_remove'], '\')) return false; else return true;">
<script type="text/javascript"><!-- // --><![CDATA[
var lastClicked = "";
// ]]></script>
<div class="panel panel-danger">
<h3 class="panel-heading">
<span class="ie6_header">
<a href="', $scripturl, '?action=helpadmin;help=error_log" onclick="return reqWin(this.href);" ><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true" data-toggle="tooltip" title="', $txt['help'], '"></span> </a> ', $txt['errlog'], '
</span>
</h3>
<div class="panel-body">
', $txt['apply_filter_of_type'], ':';
$error_types = array();
foreach ($context['error_types'] as $type => $details)
$error_types[] = ($details['is_selected'] ? '<img src="' . $settings['images_url'] . '/selected.gif" alt="" /> ' : '') . '<a href="' . $details['url'] . '" ' . ($details['is_selected'] ? 'style="font-weight: bold;"' : '') . ' title="' . $details['description'] . '">' . $details['label'] . '</a>';
echo '
', implode(' | ', $error_types), '
</div>
<div class="table-responsive">
<table class="table table-striped" id="error_log">
<tr>
<td colspan="3" class="panel-body">
', $txt['pages'], ': ', $context['page_index'], '
</td>
</tr>';
if ($context['has_filter'])
echo '
<tr>
<td colspan="3" class="panel-body">
<strong>', $txt['applying_filter'], ':</strong> ', $context['filter']['entity'], ' ', $context['filter']['value']['html'], ' (<a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', '">', $txt['clear_filter'], '</a>)
</td>
</tr>';
if (!empty($context['errors']))
echo '
<tr class="titlebg">
<td colspan="3" class="lefttext">
<div class="pull-right"><input type="submit" value="', $txt['remove_selection'], '" onclick="lastClicked = \'remove_selection\';" class="btn btn-default" /> <input type="submit" name="delall" value="', $context['has_filter'] ? $txt['remove_filtered_results'] : $txt['remove_all'], '" onclick="lastClicked = \'remove_all\';" class="btn btn-default" /></div>
<label for="check_all1"><input type="checkbox" id="check_all1" onclick="invertAll(this, this.form, \'delete[]\'); this.form.check_all2.checked = this.checked;" class="input_check" /><strong>', $txt['check_all'], '</strong></label>
</td>
</tr>';
foreach ($context['errors'] as $error)
{
echo '
<tr>
<td rowspan="2" class="checkbox_column">
<input type="checkbox" name="delete[]" value="', $error['id'], '" class="input_check" />
</td>
<td>
<a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', ';filter=id_member;value=', $error['member']['id'], '" title="', $txt['apply_filter'], ': ', $txt['filter_only_member'], '"><img src="', $settings['images_url'], '/filter.gif" alt="', $txt['apply_filter'], ': ', $txt['filter_only_member'], '" /></a>
<strong>', $error['member']['link'], '</strong><br />
<a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', ';filter=ip;value=', $error['member']['ip'], '" title="', $txt['apply_filter'], ': ', $txt['filter_only_ip'], '"><img src="', $settings['images_url'], '/filter.gif" alt="', $txt['apply_filter'], ': ', $txt['filter_only_ip'], '" /></a>
<strong><a href="', $scripturl, '?action=trackip;searchip=', $error['member']['ip'], '">', $error['member']['ip'], '</a></strong>
<br />
</td>
<td>
<a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? '' : ';desc', $context['has_filter'] ? $context['filter']['href'] : '', '" title="', $txt['reverse_direction'], '"><img src="', $settings['images_url'], '/sort_', $context['sort_direction'], '.gif" alt="', $txt['reverse_direction'], '" /></a>
', $error['time'], '
<br />';
if ($error['member']['session'] != '')
echo '
<a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', ';filter=session;value=', $error['member']['session'], '" title="', $txt['apply_filter'], ': ', $txt['filter_only_session'], '"><img src="', $settings['images_url'], '/filter.gif" alt="', $txt['apply_filter'], ': ', $txt['filter_only_session'], '" /></a>
', $error['member']['session'], '
<br />';
echo '
<a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', ';filter=error_type;value=', $error['error_type']['type'], '" title="', $txt['apply_filter'], ': ', $txt['filter_only_type'], '"><img src="', $settings['images_url'], '/filter.gif" alt="', $txt['apply_filter'], ': ', $txt['filter_only_type'], '" /></a>
', $txt['error_type'], ': ', $error['error_type']['name'], '
</td>
</tr>
<tr>
<td colspan="2">
<div class="pull-left">
<a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', ';filter=url;value=', $error['url']['href'], '" title="', $txt['apply_filter'], ': ', $txt['filter_only_url'], '">
<img src="', $settings['images_url'], '/filter.gif" alt="', $txt['apply_filter'], ': ', $txt['filter_only_url'], '" /></a>
<a href="', $error['url']['html'], '">', $error['url']['html'], '</a><br />
<a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', ';filter=message;value=', $error['message']['href'], '" title="', $txt['apply_filter'], ': ', $txt['filter_only_message'], '">
<img src="', $settings['images_url'], '/filter.gif" alt="', $txt['apply_filter'], ': ', $txt['filter_only_message'], '" /></a>
', $error['message']['html'], '<br />';
if (!empty($error['file']))
echo '
<a href="', $scripturl, '?action=admin;area=logs;sa=errorlog', $context['sort_direction'] == 'down' ? ';desc' : '', ';filter=file;value=', $error['file']['search'], '" title="', $txt['apply_filter'], ': ', $txt['filter_only_file'], '">
<img src="', $settings['images_url'], '/filter.gif" alt="', $txt['apply_filter'], ': ', $txt['filter_only_file'], '" /></a>
', $txt['file'], ': ', $error['file']['link'], '<br />
', $txt['line'], ': ', $error['file']['line'], '
';
echo ' </div>
</td>
</tr>';
}
if (!empty($context['errors']))
echo '
<tr class="titlebg">
<td colspan="3" class="lefttext">
<div class="pull-right"><input type="submit" value="', $txt['remove_selection'], '" onclick="lastClicked = \'remove_selection\';" class="btn btn-default" /> <input type="submit" name="delall" value="', $context['has_filter'] ? $txt['remove_filtered_results'] : $txt['remove_all'], '" onclick="lastClicked = \'remove_all\';" class="btn btn-default" /></div>
<label for="check_all2"><input type="checkbox" id="check_all2" onclick="invertAll(this, this.form, \'delete[]\'); this.form.check_all1.checked = this.checked;" class="input_check" /><strong>', $txt['check_all'], '</strong></label>
</td>
</tr>';
else
echo '
<tr>
<td colspan="3" class="panel-body">', $txt['errlog_no_entries'], '</td>
</tr>';
echo '
<tr>
<td colspan="3" class="panel-body">
', $txt['pages'], ': ', $context['page_index'], '
</td>
</tr>
</table>
</div></div>
<!--tabla responsiva--><br />';
if ($context['sort_direction'] == 'down')
echo '
<input type="hidden" name="desc" value="1" />';
echo '
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
</form>';
}
function template_show_file()
{
global $context, $settings;
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '>
<head>
<title>', $context['file_data']['file'], '</title>
<meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/index.css" />
</head>
<body>
<div class="table-responsive">
<table border="0" cellpadding="0" cellspacing="3">';
foreach ($context['file_data']['contents'] as $index => $line)
{
$line_num = $index+$context['file_data']['min'];
$is_target = $line_num == $context['file_data']['target'];
echo '
<tr>
<td align="right"', $is_target ? ' style="font-weight: bold; border: 1px solid black;border-width: 1px 0 1px 1px;">==>' : '>', $line_num , ':</td>
<td style="white-space: nowrap;', $is_target ? ' border: 1px solid black;border-width: 1px 1px 1px 0;':'','">', $line, '</td>
</tr>';
}
echo '
</table>
</div>
<!--tabla responsiva-->
</body>
</html>';
}
?>