ManageMaintenance.template.php 26 KB

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