Mercurial > hg > vamp-website
comparison forum/Themes/Vamp/ManageMaintenance.template.php @ 76:e3e11437ecea website
Add forum code
author | Chris Cannam |
---|---|
date | Sun, 07 Jul 2013 11:25:48 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
75:72f59aa7e503 | 76:e3e11437ecea |
---|---|
1 <?php | |
2 /** | |
3 * Simple Machines Forum (SMF) | |
4 * | |
5 * @package SMF | |
6 * @author Simple Machines | |
7 * @copyright 2011 Simple Machines | |
8 * @license http://www.simplemachines.org/about/smf/license.php BSD | |
9 * | |
10 * @version 2.0 | |
11 */ | |
12 | |
13 // Template for the database maintenance tasks. | |
14 function template_maintain_database() | |
15 { | |
16 global $context, $settings, $options, $txt, $scripturl, $db_type, $modSettings; | |
17 | |
18 // If maintenance has finished tell the user. | |
19 if (!empty($context['maintenance_finished'])) | |
20 echo ' | |
21 <div class="maintenance_finished"> | |
22 ', sprintf($txt['maintain_done'], $context['maintenance_finished']), ' | |
23 </div>'; | |
24 | |
25 echo ' | |
26 <div id="manage_maintenance"> | |
27 <div class="cat_bar"> | |
28 <h3 class="catbg">', $txt['maintain_optimize'], '</h3> | |
29 </div> | |
30 <div class="windowbg"> | |
31 <span class="topslice"><span></span></span> | |
32 <div class="content"> | |
33 <form action="', $scripturl, '?action=admin;area=maintain;sa=database;activity=optimize" method="post" accept-charset="', $context['character_set'], '"> | |
34 <p>', $txt['maintain_optimize_info'], '</p> | |
35 <span><input type="submit" value="', $txt['maintain_run_now'], '" class="button_submit" /></span> | |
36 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> | |
37 </form> | |
38 </div> | |
39 <span class="botslice"><span></span></span> | |
40 </div> | |
41 | |
42 <div class="cat_bar"> | |
43 <h3 class="catbg"> | |
44 <span class="ie6_header floatleft"><a href="', $scripturl, '?action=helpadmin;help=maintenance_backup" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.gif" alt="', $txt['help'], '" /></a> ', $txt['maintain_backup'], '</span> | |
45 </h3> | |
46 </div> | |
47 | |
48 <div class="windowbg2"> | |
49 <span class="topslice"><span></span></span> | |
50 <div class="content"> | |
51 <form action="', $scripturl, '?action=admin;area=maintain;sa=database;activity=backup" method="post" accept-charset="', $context['character_set'], '"> | |
52 <p>', $txt['maintain_backup_info'], '</p>'; | |
53 | |
54 if ($db_type == 'sqlite') | |
55 echo ' | |
56 <p><input type="submit" value="', $txt['maintain_backup_save'], '" id="submitDump" class="button_submit" /></p>'; | |
57 else | |
58 echo ' | |
59 <p><label for="struct"><input type="checkbox" name="struct" id="struct" onclick="document.getElementById(\'submitDump\').disabled = !document.getElementById(\'struct\').checked && !document.getElementById(\'data\').checked;" class="input_check" checked="checked" /> ', $txt['maintain_backup_struct'], '</label><br /> | |
60 <label for="data"><input type="checkbox" name="data" id="data" onclick="document.getElementById(\'submitDump\').disabled = !document.getElementById(\'struct\').checked && !document.getElementById(\'data\').checked;" checked="checked" class="input_check" /> ', $txt['maintain_backup_data'], '</label><br /> | |
61 <label for="compress"><input type="checkbox" name="compress" id="compress" value="gzip" checked="checked" class="input_check" /> ', $txt['maintain_backup_gz'], '</label></p> | |
62 <p><input type="submit" value="', $txt['maintain_backup_save'], '" id="submitDump" onclick="return document.getElementById(\'struct\').checked || document.getElementById(\'data\').checked;" class="button_submit" /></p>'; | |
63 | |
64 echo ' | |
65 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> | |
66 </form> | |
67 </div> | |
68 <span class="botslice"><span></span></span> | |
69 </div>'; | |
70 | |
71 // Show an option to convert to UTF-8 if we're not on UTF-8 yet. | |
72 if ($context['convert_utf8']) | |
73 { | |
74 echo ' | |
75 <div class="cat_bar"> | |
76 <h3 class="catbg">', $txt['utf8_title'], '</h3> | |
77 </div> | |
78 <div class="windowbg"> | |
79 <span class="topslice"><span></span></span> | |
80 <div class="content"> | |
81 <form action="', $scripturl, '?action=admin;area=maintain;sa=database;activity=convertutf8" method="post" accept-charset="', $context['character_set'], '"> | |
82 <p>', $txt['utf8_introduction'], '</p> | |
83 ', !empty($modSettings['search_index']) && $modSettings['search_index'] == 'fulltext' ? '<p class="error">' . $txt['utf8_cannot_convert_fulltext'] . '</p>' : '', ' | |
84 <span><input type="submit" value="', $txt['maintain_run_now'], '" class="button_submit" ', !empty($modSettings['search_index']) && $modSettings['search_index'] == 'fulltext' ? 'disabled="disabled"' : '', '/></span> | |
85 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> | |
86 </form> | |
87 </div> | |
88 <span class="botslice"><span></span></span> | |
89 </div>'; | |
90 } | |
91 | |
92 // We might want to convert entities if we're on UTF-8. | |
93 if ($context['convert_entities']) | |
94 { | |
95 echo ' | |
96 <div class="cat_bar"> | |
97 <h3 class="catbg">', $txt['entity_convert_title'], '</h3> | |
98 </div> | |
99 <div class="windowbg"> | |
100 <span class="topslice"><span></span></span> | |
101 <div class="content"> | |
102 <form action="', $scripturl, '?action=admin;area=maintain;sa=database;activity=convertentities" method="post" accept-charset="', $context['character_set'], '"> | |
103 <p>', $txt['entity_convert_introduction'], '</p> | |
104 <span><input type="submit" value="', $txt['maintain_run_now'], '" class="button_submit" /></span> | |
105 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> | |
106 </form> | |
107 </div> | |
108 <span class="botslice"><span></span></span> | |
109 </div>'; | |
110 } | |
111 | |
112 echo ' | |
113 </div> | |
114 <br class="clear" />'; | |
115 } | |
116 | |
117 // Template for the routine maintenance tasks. | |
118 function template_maintain_routine() | |
119 { | |
120 global $context, $settings, $options, $txt, $scripturl, $modSettings; | |
121 | |
122 // If maintenance has finished tell the user. | |
123 if (!empty($context['maintenance_finished'])) | |
124 echo ' | |
125 <div class="maintenance_finished"> | |
126 ', sprintf($txt['maintain_done'], $context['maintenance_finished']), ' | |
127 </div>'; | |
128 | |
129 // Starts off with general maintenance procedures. | |
130 echo ' | |
131 <div id="manage_maintenance"> | |
132 <div class="cat_bar"> | |
133 <h3 class="catbg">', $txt['maintain_version'], '</h3> | |
134 </div> | |
135 <div class="windowbg"> | |
136 <span class="topslice"><span></span></span> | |
137 <div class="content"> | |
138 <form action="', $scripturl, '?action=admin;area=maintain;sa=routine;activity=version" method="post" accept-charset="', $context['character_set'], '"> | |
139 <p>', $txt['maintain_version_info'], '</p> | |
140 <span><input type="submit" value="', $txt['maintain_run_now'], '" class="button_submit" /></span> | |
141 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> | |
142 </form> | |
143 </div> | |
144 <span class="botslice"><span></span></span> | |
145 </div> | |
146 <div class="cat_bar"> | |
147 <h3 class="catbg">', $txt['maintain_errors'], '</h3> | |
148 </div> | |
149 <div class="windowbg2"> | |
150 <span class="topslice"><span></span></span> | |
151 <div class="content"> | |
152 <form action="', $scripturl, '?action=admin;area=repairboards" method="post" accept-charset="', $context['character_set'], '"> | |
153 <p>', $txt['maintain_errors_info'], '</p> | |
154 <span><input type="submit" value="', $txt['maintain_run_now'], '" class="button_submit" /></span> | |
155 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> | |
156 </form> | |
157 </div> | |
158 <span class="botslice"><span></span></span> | |
159 </div> | |
160 <div class="cat_bar"> | |
161 <h3 class="catbg">', $txt['maintain_recount'], '</h3> | |
162 </div> | |
163 <div class="windowbg"> | |
164 <span class="topslice"><span></span></span> | |
165 <div class="content"> | |
166 <form action="', $scripturl, '?action=admin;area=maintain;sa=routine;activity=recount" method="post" accept-charset="', $context['character_set'], '"> | |
167 <p>', $txt['maintain_recount_info'], '</p> | |
168 <span><input type="submit" value="', $txt['maintain_run_now'], '" class="button_submit" /></span> | |
169 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> | |
170 </form> | |
171 </div> | |
172 <span class="botslice"><span></span></span> | |
173 </div> | |
174 <div class="cat_bar"> | |
175 <h3 class="catbg">', $txt['maintain_logs'], '</h3> | |
176 </div> | |
177 <div class="windowbg2"> | |
178 <span class="topslice"><span></span></span> | |
179 <div class="content"> | |
180 <form action="', $scripturl, '?action=admin;area=maintain;sa=routine;activity=logs" method="post" accept-charset="', $context['character_set'], '"> | |
181 <p>', $txt['maintain_logs_info'], '</p> | |
182 <span><input type="submit" value="', $txt['maintain_run_now'], '" class="button_submit" /></span> | |
183 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> | |
184 </form> | |
185 </div> | |
186 <span class="botslice"><span></span></span> | |
187 </div> | |
188 <div class="cat_bar"> | |
189 <h3 class="catbg">', $txt['maintain_cache'], '</h3> | |
190 </div> | |
191 <div class="windowbg"> | |
192 <span class="topslice"><span></span></span> | |
193 <div class="content"> | |
194 <form action="', $scripturl, '?action=admin;area=maintain;sa=routine;activity=cleancache" method="post" accept-charset="', $context['character_set'], '"> | |
195 <p>', $txt['maintain_cache_info'], '</p> | |
196 <span><input type="submit" value="', $txt['maintain_run_now'], '" class="button_submit" /></span> | |
197 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> | |
198 </form> | |
199 </div> | |
200 <span class="botslice"><span></span></span> | |
201 </div> | |
202 </div> | |
203 <br class="clear" />'; | |
204 } | |
205 | |
206 // Template for the member maintenance tasks. | |
207 function template_maintain_members() | |
208 { | |
209 global $context, $settings, $options, $txt, $scripturl; | |
210 | |
211 // If maintenance has finished tell the user. | |
212 if (!empty($context['maintenance_finished'])) | |
213 echo ' | |
214 <div class="maintenance_finished"> | |
215 ', sprintf($txt['maintain_done'], $context['maintenance_finished']), ' | |
216 </div>'; | |
217 | |
218 echo ' | |
219 <script type="text/javascript"><!-- // --><![CDATA[ | |
220 var warningMessage = \'\'; | |
221 var membersSwap = false; | |
222 | |
223 function swapMembers() | |
224 { | |
225 membersSwap = !membersSwap; | |
226 var membersForm = document.getElementById(\'membersForm\'); | |
227 | |
228 document.getElementById("membersIcon").src = smf_images_url + (membersSwap ? "/collapse.gif" : "/expand.gif"); | |
229 setInnerHTML(document.getElementById("membersText"), membersSwap ? "', $txt['maintain_members_choose'], '" : "', $txt['maintain_members_all'], '"); | |
230 document.getElementById("membersPanel").style.display = (membersSwap ? "block" : "none"); | |
231 | |
232 for (var i = 0; i < membersForm.length; i++) | |
233 { | |
234 if (membersForm.elements[i].type.toLowerCase() == "checkbox") | |
235 membersForm.elements[i].checked = !membersSwap; | |
236 } | |
237 } | |
238 | |
239 function checkAttributeValidity() | |
240 { | |
241 origText = \'', $txt['reattribute_confirm'], '\'; | |
242 valid = true; | |
243 | |
244 // Do all the fields! | |
245 if (!document.getElementById(\'to\').value) | |
246 valid = false; | |
247 warningMessage = origText.replace(/%member_to%/, document.getElementById(\'to\').value); | |
248 | |
249 if (document.getElementById(\'type_email\').checked) | |
250 { | |
251 if (!document.getElementById(\'from_email\').value) | |
252 valid = false; | |
253 warningMessage = warningMessage.replace(/%type%/, \'', addcslashes($txt['reattribute_confirm_email'], "'"), '\').replace(/%find%/, document.getElementById(\'from_email\').value); | |
254 } | |
255 else | |
256 { | |
257 if (!document.getElementById(\'from_name\').value) | |
258 valid = false; | |
259 warningMessage = warningMessage.replace(/%type%/, \'', addcslashes($txt['reattribute_confirm_username'], "'"), '\').replace(/%find%/, document.getElementById(\'from_name\').value); | |
260 } | |
261 | |
262 document.getElementById(\'do_attribute\').disabled = valid ? \'\' : \'disabled\'; | |
263 | |
264 setTimeout("checkAttributeValidity();", 500); | |
265 return valid; | |
266 } | |
267 setTimeout("checkAttributeValidity();", 500); | |
268 // ]]></script> | |
269 <div id="manage_maintenance"> | |
270 <div class="cat_bar"> | |
271 <h3 class="catbg">', $txt['maintain_reattribute_posts'], '</h3> | |
272 </div> | |
273 <div class="windowbg2"> | |
274 <span class="topslice"><span></span></span> | |
275 <div class="content"> | |
276 <form action="', $scripturl, '?action=admin;area=maintain;sa=members;activity=reattribute" method="post" accept-charset="', $context['character_set'], '"> | |
277 <p><strong>', $txt['reattribute_guest_posts'], '</strong></p> | |
278 <dl class="settings"> | |
279 <dt> | |
280 <label for="type_email"><input type="radio" name="type" id="type_email" value="email" checked="checked" class="input_radio" />', $txt['reattribute_email'], '</label> | |
281 </dt> | |
282 <dd> | |
283 <input type="text" name="from_email" id="from_email" value="" onclick="document.getElementById(\'type_email\').checked = \'checked\'; document.getElementById(\'from_name\').value = \'\';" /> | |
284 </dd> | |
285 <dt> | |
286 <label for="type_name"><input type="radio" name="type" id="type_name" value="name" class="input_radio" />', $txt['reattribute_username'], '</label> | |
287 </dt> | |
288 <dd> | |
289 <input type="text" name="from_name" id="from_name" value="" onclick="document.getElementById(\'type_name\').checked = \'checked\'; document.getElementById(\'from_email\').value = \'\';" class="input_text" /> | |
290 </dd> | |
291 </dl> | |
292 <dl class="settings"> | |
293 <dt> | |
294 <label for="to"><strong>', $txt['reattribute_current_member'], ':</strong></label> | |
295 </dt> | |
296 <dd> | |
297 <input type="text" name="to" id="to" value="" class="input_text" /> | |
298 </dd> | |
299 </dl> | |
300 <p class="maintain_members"> | |
301 <input type="checkbox" name="posts" id="posts" checked="checked" class="input_check" /> | |
302 <label for="posts">', $txt['reattribute_increase_posts'], '</label> | |
303 </p> | |
304 <span><input type="submit" id="do_attribute" value="', $txt['reattribute'], '" onclick="if (!checkAttributeValidity()) return false; return confirm(warningMessage);" class="button_submit" /></span> | |
305 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> | |
306 </form> | |
307 </div> | |
308 <span class="botslice"><span></span></span> | |
309 </div> | |
310 <div class="cat_bar"> | |
311 <h3 class="catbg"> | |
312 <span class="ie6_header floatleft"> | |
313 <a href="', $scripturl, '?action=helpadmin;help=maintenance_members" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.gif" alt="', $txt['help'], '" /></a> ', $txt['maintain_members'], ' | |
314 </span> | |
315 </h3> | |
316 </div> | |
317 <div class="windowbg"> | |
318 <span class="topslice"><span></span></span> | |
319 <div class="content"> | |
320 <form action="', $scripturl, '?action=admin;area=maintain;sa=members;activity=purgeinactive" method="post" accept-charset="', $context['character_set'], '" id="membersForm"> | |
321 <p><a id="membersLink"></a>', $txt['maintain_members_since1'], ' | |
322 <select name="del_type"> | |
323 <option value="activated" selected="selected">', $txt['maintain_members_activated'], '</option> | |
324 <option value="logged">', $txt['maintain_members_logged_in'], '</option> | |
325 </select> ', $txt['maintain_members_since2'], ' <input type="text" name="maxdays" value="30" size="3" class="input_text" />', $txt['maintain_members_since3'], '</p>'; | |
326 | |
327 echo ' | |
328 <p><a href="#membersLink" onclick="swapMembers();"><img src="', $settings['images_url'], '/expand.gif" alt="+" id="membersIcon" /></a> <a href="#membersLink" onclick="swapMembers();" id="membersText" style="font-weight: bold;">', $txt['maintain_members_all'], '</a></p> | |
329 <div style="display: none; padding: 3px" id="membersPanel">'; | |
330 | |
331 foreach ($context['membergroups'] as $group) | |
332 echo ' | |
333 <label for="groups', $group['id'], '"><input type="checkbox" name="groups[', $group['id'], ']" id="groups', $group['id'], '" checked="checked" class="input_check" /> ', $group['name'], '</label><br />'; | |
334 | |
335 echo ' | |
336 </div> | |
337 <span><input type="submit" value="', $txt['maintain_old_remove'], '" onclick="return confirm(\'', $txt['maintain_members_confirm'], '\');" class="button_submit" /></span> | |
338 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> | |
339 </form> | |
340 </div> | |
341 <span class="botslice"><span></span></span> | |
342 </div> | |
343 </div> | |
344 <br class="clear" /> | |
345 | |
346 <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/suggest.js?fin20"></script> | |
347 <script type="text/javascript"><!-- // --><![CDATA[ | |
348 var oAttributeMemberSuggest = new smc_AutoSuggest({ | |
349 sSelf: \'oAttributeMemberSuggest\', | |
350 sSessionId: \'', $context['session_id'], '\', | |
351 sSessionVar: \'', $context['session_var'], '\', | |
352 sSuggestId: \'attributeMember\', | |
353 sControlId: \'to\', | |
354 sSearchType: \'member\', | |
355 sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\', | |
356 bItemList: false | |
357 }); | |
358 // ]]></script>'; | |
359 } | |
360 | |
361 // Template for the topic maintenance tasks. | |
362 function template_maintain_topics() | |
363 { | |
364 global $scripturl, $txt, $context, $settings, $modSettings; | |
365 | |
366 // If maintenance has finished tell the user. | |
367 if (!empty($context['maintenance_finished'])) | |
368 echo ' | |
369 <div class="maintenance_finished"> | |
370 ', sprintf($txt['maintain_done'], $context['maintenance_finished']), ' | |
371 </div>'; | |
372 | |
373 // Bit of javascript for showing which boards to prune in an otherwise hidden list. | |
374 echo ' | |
375 <script type="text/javascript"><!-- // --><![CDATA[ | |
376 var rotSwap = false; | |
377 function swapRot() | |
378 { | |
379 rotSwap = !rotSwap; | |
380 | |
381 // Toggle icon | |
382 document.getElementById("rotIcon").src = smf_images_url + (rotSwap ? "/collapse.gif" : "/expand.gif"); | |
383 setInnerHTML(document.getElementById("rotText"), rotSwap ? ', JavaScriptEscape($txt['maintain_old_choose']), ' : ', JavaScriptEscape($txt['maintain_old_all']), '); | |
384 | |
385 // Toggle panel | |
386 document.getElementById("rotPanel").style.display = !rotSwap ? "none" : ""; | |
387 | |
388 // Toggle checkboxes | |
389 var rotPanel = document.getElementById(\'rotPanel\'); | |
390 var oBoardCheckBoxes = rotPanel.getElementsByTagName(\'input\'); | |
391 for (var i = 0; i < oBoardCheckBoxes.length; i++) | |
392 { | |
393 if (oBoardCheckBoxes[i].type.toLowerCase() == "checkbox") | |
394 oBoardCheckBoxes[i].checked = !rotSwap; | |
395 } | |
396 } | |
397 // ]]></script>'; | |
398 | |
399 echo ' | |
400 <div id="manage_maintenance"> | |
401 <div class="cat_bar"> | |
402 <h3 class="catbg">', $txt['maintain_old'], '</h3> | |
403 </div> | |
404 <div class="windowbg"> | |
405 <span class="topslice"><span></span></span> | |
406 <div class="content flow_auto"> | |
407 <form action="', $scripturl, '?action=admin;area=maintain;sa=topics;activity=pruneold" method="post" accept-charset="', $context['character_set'], '">'; | |
408 | |
409 // The otherwise hidden "choose which boards to prune". | |
410 echo ' | |
411 <p> | |
412 <a id="rotLink"></a>', $txt['maintain_old_since_days1'], '<input type="text" name="maxdays" value="30" size="3" />', $txt['maintain_old_since_days2'], ' | |
413 </p> | |
414 <p> | |
415 <label for="delete_type_nothing"><input type="radio" name="delete_type" id="delete_type_nothing" value="nothing" class="input_radio" /> ', $txt['maintain_old_nothing_else'], '</label><br /> | |
416 <label for="delete_type_moved"><input type="radio" name="delete_type" id="delete_type_moved" value="moved" class="input_radio" checked="checked" /> ', $txt['maintain_old_are_moved'], '</label><br /> | |
417 <label for="delete_type_locked"><input type="radio" name="delete_type" id="delete_type_locked" value="locked" class="input_radio" /> ', $txt['maintain_old_are_locked'], '</label><br /> | |
418 </p>'; | |
419 | |
420 if (!empty($modSettings['enableStickyTopics'])) | |
421 echo ' | |
422 <p> | |
423 <label for="delete_old_not_sticky"><input type="checkbox" name="delete_old_not_sticky" id="delete_old_not_sticky" class="input_check" checked="checked" /> ', $txt['maintain_old_are_not_stickied'], '</label><br /> | |
424 </p>'; | |
425 | |
426 echo ' | |
427 <p> | |
428 <a href="#rotLink" onclick="swapRot();"><img src="', $settings['images_url'], '/expand.gif" alt="+" id="rotIcon" /></a> <a href="#rotLink" onclick="swapRot();" id="rotText" style="font-weight: bold;">', $txt['maintain_old_all'], '</a> | |
429 </p> | |
430 <div style="display: none;" id="rotPanel" class="flow_hidden"> | |
431 <div class="floatleft" style="width: 49%">'; | |
432 | |
433 // This is the "middle" of the list. | |
434 $middle = ceil(count($context['categories']) / 2); | |
435 | |
436 $i = 0; | |
437 foreach ($context['categories'] as $category) | |
438 { | |
439 echo ' | |
440 <fieldset> | |
441 <legend>', $category['name'], '</legend> | |
442 <ul class="reset">'; | |
443 | |
444 // Display a checkbox with every board. | |
445 foreach ($category['boards'] as $board) | |
446 echo ' | |
447 <li style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'] * 1.5, 'em;"><label for="boards_', $board['id'], '"><input type="checkbox" name="boards[', $board['id'], ']" id="boards_', $board['id'], '" checked="checked" class="input_check" />', $board['name'], '</label></li>'; | |
448 | |
449 echo ' | |
450 </ul> | |
451 </fieldset>'; | |
452 | |
453 // Increase $i, and check if we're at the middle yet. | |
454 if (++$i == $middle) | |
455 echo ' | |
456 </div> | |
457 <div class="floatright" style="width: 49%;">'; | |
458 } | |
459 | |
460 echo ' | |
461 </div> | |
462 </div> | |
463 <span><input type="submit" value="', $txt['maintain_old_remove'], '" onclick="return confirm(\'', $txt['maintain_old_confirm'], '\');" class="button_submit" /></span> | |
464 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> | |
465 </form> | |
466 </div> | |
467 <span class="botslice"><span></span></span> | |
468 </div> | |
469 <div class="cat_bar"> | |
470 <h3 class="catbg">', $txt['move_topics_maintenance'], '</h3> | |
471 </div> | |
472 <div class="windowbg2"> | |
473 <span class="topslice"><span></span></span> | |
474 <div class="content"> | |
475 <form action="', $scripturl, '?action=admin;area=maintain;sa=topics;activity=massmove" method="post" accept-charset="', $context['character_set'], '"> | |
476 <p><label for="id_board_from">', $txt['move_topics_from'], ' </label> | |
477 <select name="id_board_from" id="id_board_from"> | |
478 <option disabled="disabled">(', $txt['move_topics_select_board'], ')</option>'; | |
479 | |
480 // From board | |
481 foreach ($context['categories'] as $category) | |
482 { | |
483 echo ' | |
484 <option disabled="disabled">--------------------------------------</option> | |
485 <option disabled="disabled">', $category['name'], '</option> | |
486 <option disabled="disabled">--------------------------------------</option>'; | |
487 | |
488 foreach ($category['boards'] as $board) | |
489 echo ' | |
490 <option value="', $board['id'], '"> ', str_repeat('==', $board['child_level']), '=> ', $board['name'], '</option>'; | |
491 } | |
492 | |
493 echo ' | |
494 </select> | |
495 <label for="id_board_to">', $txt['move_topics_to'], '</label> | |
496 <select name="id_board_to" id="id_board_to"> | |
497 <option disabled="disabled">(', $txt['move_topics_select_board'], ')</option>'; | |
498 | |
499 // To board | |
500 foreach ($context['categories'] as $category) | |
501 { | |
502 echo ' | |
503 <option disabled="disabled">--------------------------------------</option> | |
504 <option disabled="disabled">', $category['name'], '</option> | |
505 <option disabled="disabled">--------------------------------------</option>'; | |
506 | |
507 foreach ($category['boards'] as $board) | |
508 echo ' | |
509 <option value="', $board['id'], '"> ', str_repeat('==', $board['child_level']), '=> ', $board['name'], '</option>'; | |
510 } | |
511 echo ' | |
512 </select></p> | |
513 <span><input type="submit" value="', $txt['move_topics_now'], '" onclick="if (document.getElementById(\'id_board_from\').options[document.getElementById(\'id_board_from\').selectedIndex].disabled || document.getElementById(\'id_board_from\').options[document.getElementById(\'id_board_to\').selectedIndex].disabled) return false; var confirmText = \'', $txt['move_topics_confirm'] . '\'; return confirm(confirmText.replace(/%board_from%/, document.getElementById(\'id_board_from\').options[document.getElementById(\'id_board_from\').selectedIndex].text.replace(/^=+> /, \'\')).replace(/%board_to%/, document.getElementById(\'id_board_to\').options[document.getElementById(\'id_board_to\').selectedIndex].text.replace(/^=+> /, \'\')));" class="button_submit" /></span> | |
514 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> | |
515 </form> | |
516 </div> | |
517 <span class="botslice"><span></span></span> | |
518 </div> | |
519 </div> | |
520 <br class="clear" />'; | |
521 } | |
522 | |
523 // Simple template for showing results of our optimization... | |
524 function template_optimize() | |
525 { | |
526 global $context, $settings, $options, $txt, $scripturl; | |
527 | |
528 echo ' | |
529 <div id="manage_maintenance"> | |
530 <div class="cat_bar"> | |
531 <h3 class="catbg">', $txt['maintain_optimize'], '</h3> | |
532 </div> | |
533 <div class="windowbg"> | |
534 <span class="topslice"><span></span></span> | |
535 <div class="content"> | |
536 <p> | |
537 ', $txt['database_numb_tables'], '<br /> | |
538 ', $txt['database_optimize_attempt'], '<br />'; | |
539 | |
540 // List each table being optimized... | |
541 foreach ($context['optimized_tables'] as $table) | |
542 echo ' | |
543 ', sprintf($txt['database_optimizing'], $table['name'], $table['data_freed']), '<br />'; | |
544 | |
545 // How did we go? | |
546 echo ' | |
547 <br />', $context['num_tables_optimized'] == 0 ? $txt['database_already_optimized'] : $context['num_tables_optimized'] . ' ' . $txt['database_optimized']; | |
548 | |
549 echo ' | |
550 </p> | |
551 <p><a href="', $scripturl, '?action=admin;area=maintain">', $txt['maintain_return'], '</a></p> | |
552 </div> | |
553 <span class="botslice"><span></span></span> | |
554 </div> | |
555 </div> | |
556 <br class="clear" />'; | |
557 } | |
558 | |
559 function template_convert_utf8() | |
560 { | |
561 global $context, $txt, $settings, $scripturl; | |
562 | |
563 echo ' | |
564 <div id="manage_maintenance"> | |
565 <div class="cat_bar"> | |
566 <h3 class="catbg">', $txt['utf8_title'], '</h3> | |
567 </div> | |
568 <div class="windowbg"> | |
569 <span class="topslice"><span></span></span> | |
570 <div class="content"> | |
571 <form action="', $scripturl, '?action=admin;area=maintain;sa=database;activity=convertutf8" method="post" accept-charset="', $context['character_set'], '"> | |
572 <p>', $txt['utf8_introduction'], '</p> | |
573 <div>', $txt['utf8_warning'], '</div> | |
574 | |
575 <dl class="settings"> | |
576 <dt><strong>', $txt['utf8_source_charset'], ':</strong></dt> | |
577 <dd><select name="src_charset">'; | |
578 foreach ($context['charset_list'] as $charset) | |
579 echo ' | |
580 <option value="', $charset, '"', $charset === $context['charset_detected'] ? ' selected="selected"' : '', '>', $charset, '</option>'; | |
581 echo ' | |
582 </select></dd> | |
583 <dt><strong>', $txt['utf8_database_charset'], ':</strong></dt> | |
584 <dd>', $context['database_charset'], '</dd> | |
585 <dt><strong>', $txt['utf8_target_charset'], ': </strong></dt> | |
586 <dd>', $txt['utf8_utf8'], '</dd> | |
587 </dl> | |
588 <input type="submit" value="', $txt['utf8_proceed'], '" class="button_submit" /> | |
589 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" /> | |
590 <input type="hidden" name="proceed" value="1" /> | |
591 </form> | |
592 </div> | |
593 <span class="botslice"><span></span></span> | |
594 </div> | |
595 </div> | |
596 <br class="clear" />'; | |
597 } | |
598 | |
599 function template_convert_entities() | |
600 { | |
601 global $context, $txt, $settings, $scripturl; | |
602 | |
603 echo ' | |
604 <div id="manage_maintenance"> | |
605 <div class="cat_bar"> | |
606 <h3 class="catbg">', $txt['entity_convert_title'], '</h3> | |
607 </div> | |
608 <div class="windowbg"> | |
609 <span class="topslice"><span></span></span> | |
610 <div class="content"> | |
611 <p>', $txt['entity_convert_introduction'], '</p> | |
612 <form action="', $scripturl, '?action=admin;area=maintain;sa=database;activity=convertentities;start=0;', $context['session_var'], '=', $context['session_id'], '" method="post" accept-charset="', $context['character_set'], '"> | |
613 <input type="submit" value="', $txt['entity_convert_proceed'], '" class="button_submit" /> | |
614 </form> | |
615 </div> | |
616 <span class="botslice"><span></span></span> | |
617 </div> | |
618 </div> | |
619 <br class="clear" />'; | |
620 } | |
621 | |
622 ?> |