This repository has been archived by the owner on Jun 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathPostHistory.template.php
212 lines (182 loc) · 5.72 KB
/
PostHistory.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
/**
*
* @package PostHistory
* @version 1.0.1
*/
/**
*
*/
function template_list_edits()
{
global $context, $settings, $options, $scripturl, $txt;
if ($context['is_popup'])
template_ph_popup_above();
echo '
<div class="title_bar">
<h3 class="titlebg">
', $context['ph_topic']['msg_subject'], '
</h3>
</div>
<form action="', $scripturl, '?action=posthistory;msg=', $_REQUEST['msg'], ';topic=', $context['current_topic'], '.0', $context['is_popup'] ? ';popup' : '', '" method="post">
<table class="table_grid" cellspacing="0" width="100%">
<thead>
<tr class="catbg">
<th scope="col" class="smalltext first_th" colspan="2"></td>
<th scope="col" class="smalltext">', $txt['ph_last_edit'], '</td>
<th scope="col" class="smalltext">', $txt['ph_last_time'], '</td>
<th scope="col" class="smalltext last_th"</td>
</tr>';
// First we check if moderators have been lazy
if (empty($context['post_history']))
echo '
<tr>
<th scope="col" class="smalltext first_th"></td>
<th scope="col" class="smalltext">', $txt['ph_no_edits'], '</td>
<th scope="col" class="smalltext last_th"></td>
</tr>
</thead>';
else
{
echo '
</thead>
<tbody>';
$alternate = false;
foreach ($context['post_history'] as $edit)
{
echo '
<tr class="windowbg', $alternate ? '2' : '', '">
<td><input type="radio" name="compare_to" value="', $edit['id'], '" /></td>
<td>', !empty($edit['id_prev']) ? '<input type="radio" name="edit" value="' . $edit['id'] . '" />' : '', '</td>
<td>', $edit['name'], '</td>
<td>
', $edit['time'], '
', $edit['is_current'] || $edit['is_original'] ? '(' . $txt['ph_' . ($edit['is_current'] ? 'current_' : '') . ($edit['is_original'] ? 'original_' : '') . 'edit'] . ')' : '', '
</td>
<td>
<a href="', $edit['href'], '">', $txt['ph_view_edit'], '</a>';
if (!empty($edit['restore_href']))
echo ' | <a href="', $edit['restore_href'], '" ', $context['is_popup'] ? ' onclick="return gotoAndClose(this.href);"' : '', '>', $txt['restore'], '</a>';
echo '
</td>
</tr>';
$alternate = !$alternate;
}
echo '
<tr class="titlebg">
<td colspan="5" align="right"><input class="button_submit" type="submit" value="', $txt['compare_selected'], '"></td>
</tr>
</tbody>';
}
echo '
</table>
</form>';
if ($context['is_popup'])
template_ph_popup_below();
}
/**
*
*/
function template_view_edit()
{
global $context, $settings, $options, $scripturl, $txt;
if ($context['is_popup'])
template_ph_popup_above();
echo '
<div class="title_bar">
<h3 class="titlebg">
', $context['ph_topic']['msg_subject'], '
</h3>
</div>
<em>', $txt['ph_last_edit'], ': ', $context['current_edit']['name'], ' (', $context['current_edit']['time'], ')</em><br />
<div class="windowbg">
<span class="topslice"><span></span></span>
<div class="content">
', $context['current_edit']['body'], '<br /><br />';
if (!empty($context['current_edit']['restore_href']))
echo '
<div style="text-align: center"><a href="', $context['current_edit']['restore_href'], '"', $context['is_popup'] ? ' onclick="return gotoAndClose(this.href);"' : '', '>', $txt['restore'], '</a></div>';
echo '
</div>
<span class="botslice"><span></span></span>
</div>';
if ($context['is_popup'])
template_ph_popup_below();
}
/**
*
*/
function template_compare_edit()
{
global $context, $settings, $options, $scripturl, $txt;
if ($context['is_popup'])
template_ph_popup_above();
echo '
<div class="title_bar">
<h3 class="titlebg">
', $context['ph_topic']['msg_subject'], '
</h3>
</div>
<em>', $txt['ph_last_edit'], ': ', $context['current_edit']['name'], ' (', $context['current_edit']['time'], ')</em><br />
<div class="windowbg">
<span class="topslice"><span></span></span>
<div class="edit_changes content">';
foreach ($context['edit_changes'] as $change)
{
if (!is_array($change))
echo $change;
else
{
if (!empty($change['d']))
echo '<del>', implode('', $change['d']), '</del>';
if (!empty($change['i']))
echo '<ins>', implode('', $change['i']), '</ins>';
}
}
echo '
</div>
<span class="botslice"><span></span></span>
</div>';
if ($context['is_popup'])
template_ph_popup_below();
}
/**
*
*/
function template_ph_popup_above()
{
global $context, $settings, $options, $txt;
// Since this is a popup of its own we need to start the html, etc.
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>
<meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
<meta name="robots" content="noindex" />
<title>', $context['page_title'], '</title>
<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/index.css" />
<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/script.js"></script>
<script type="text/javascript"><!-- // --><![CDATA[
function gotoAndClose(url)
{
window.opener.location = url;
self.close();
return false;
}
// ]]></script>
</head>
<body id="help_popup" style="background: white">';
}
/**
*
*/
function template_ph_popup_below()
{
global $context, $settings, $options, $txt;
echo '
<div style="text-align: center">
<a href="javascript:self.close();">', $txt['close_window'], '</a>
</div>
</body>
</html>';
}
?>