123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590 |
- <?php
- /**
- * Simple Machines Forum (SMF)
- *
- * @package SMF
- * @author Simple Machines
- * @copyright 2011 Simple Machines
- * @license http://www.simplemachines.org/about/smf/license.php BSD
- *
- * @version 2.1 Alpha 1
- */
- // Template for the database maintenance tasks.
- function template_maintain_database()
- {
- global $context, $settings, $options, $txt, $scripturl, $db_type, $modSettings;
- // If maintenance has finished tell the user.
- if (!empty($context['maintenance_finished']))
- echo '
- <div class="maintenance_finished">
- ', sprintf($txt['maintain_done'], $context['maintenance_finished']), '
- </div>';
- echo '
- <div id="manage_maintenance">
- <div class="cat_bar">
- <h3 class="catbg">', $txt['maintain_sub_database'], ' ', $txt['permitgroups_maintenance'], '</h3>
- </div>
- <div class="windowbg2">
- <div class="content">
- <h3 class="double_height">', $txt['maintain_optimize'], '</h3>
- <form action="', $scripturl, '?action=admin;area=maintain;sa=database;activity=optimize" method="post" accept-charset="', $context['character_set'], '">
- <p class="floatleft">', $txt['maintain_optimize_info'], '</p>
- <input type="submit" value="', $txt['maintain_run_now'], '" class="button_submit" />
- <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
- <input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '" />
- </form>
- <hr />
- </div>
- <div class="content">
- <h3 class="double_height">
- <a href="', $scripturl, '?action=helpadmin;help=maintenance_backup" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.png" class="icon" alt="', $txt['help'], '" /></a> ', $txt['maintain_backup'], '
- </h3>
- <form action="', $scripturl, '?action=admin;area=maintain;sa=database;activity=backup" method="post" accept-charset="', $context['character_set'], '">
- <p class="floatleft">', $txt['maintain_backup_info'], '</p>
- <br classs="clear" />';
- if ($db_type == 'sqlite')
- echo '
- <hr />
- <p>
- <input type="submit" value="', $txt['maintain_backup_save'], '" id="submitDump" class="button_submit" />
- </p>';
- else
- {
- if ($context['safe_mode_enable'])
- echo '
- <div class="errorbox">', $txt['safe_mode_enabled'], '</div>';
- else
- echo '
- <div class="', $context['suggested_method'] == 'use_external_tool' || $context['use_maintenance'] != 0 ? 'errorbox' : 'noticebox', '">
- ', $txt[$context['suggested_method']],
- $context['use_maintenance'] != 0 ? '<br />' . $txt['enable_maintenance' . $context['use_maintenance']] : '',
- '</div>';
- echo '
- <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 />
- <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 />
- <label for="compress"><input type="checkbox" name="compress" id="compress" value="gzip"', $context['suggested_method'] == 'zipped_file' ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['maintain_backup_gz'], '</label>
- </p>
- <p>
- <input ', $context['use_maintenance'] == 2 ? 'disabled="disabled" ' : '', 'type="submit" value="', $txt['maintain_backup_save'], '" id="submitDump" onclick="return document.getElementById(\'struct\').checked || document.getElementById(\'data\').checked;" class="button_submit" />
- <br class="clear_right" />
- </p>';
- }
- echo '
- <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
- <input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '" />
- </form><hr />
- </div>';
- // Show an option to convert to UTF-8 if we're not on UTF-8 yet.
- if ($context['convert_utf8'])
- {
- echo '
- <div class="content">
- <h3 class="double_height">', $txt['utf8_title'], '</h3>
- <form action="', $scripturl, '?action=admin;area=maintain;sa=database;activity=convertutf8" method="post" accept-charset="', $context['character_set'], '">
- <p class="floatleft">', $txt['utf8_introduction'], '</p>
- ', !empty($modSettings['search_index']) && $modSettings['search_index'] == 'fulltext' ? '<p class="errorbox">' . $txt['utf8_cannot_convert_fulltext'] . '</p>' : '', '
- <input type="submit" value="', $txt['maintain_run_now'], '" class="button_submit" ', !empty($modSettings['search_index']) && $modSettings['search_index'] == 'fulltext' ? 'disabled="disabled"' : '', '/>
- <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
- <input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '" />
- </form><hr />
- </div>';
- }
- // We might want to convert entities if we're on UTF-8.
- if ($context['convert_entities'])
- {
- echo '
- <div class="content">
- <h3 class="double_height">', $txt['entity_convert_title'], '</h3>
- <form action="', $scripturl, '?action=admin;area=maintain;sa=database;activity=convertentities" method="post" accept-charset="', $context['character_set'], '">
- <p class="floatleft">', $txt['entity_convert_introduction'], '</p>
- <input type="submit" value="', $txt['maintain_run_now'], '" class="button_submit" />
- <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
- <input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '" />
- </form><hr />
- </div>';
- }
- echo '
- </div>
- </div>';
- }
- // Template for the routine maintenance tasks.
- function template_maintain_routine()
- {
- global $context, $settings, $options, $txt, $scripturl, $modSettings;
- // If maintenance has finished tell the user.
- if (!empty($context['maintenance_finished']))
- echo '
- <div class="infobox">
- ', sprintf($txt['maintain_done'], $context['maintenance_finished']), '
- </div>';
- // Starts off with general maintenance procedures.
- echo '
- <div id="manage_maintenance">
- <div class="cat_bar">
- <h3 class="catbg">', $txt['maintain_sub_routine'], ' ', $txt['permitgroups_maintenance'], '</h3>
- </div>
- <div class="windowbg2">
- <div class="content">
- <h3 class="double_height">', $txt['maintain_version'], '</h3>
- <form action="', $scripturl, '?action=admin;area=maintain;sa=routine;activity=version" method="post" accept-charset="', $context['character_set'], '">
- <p class="floatleft">', $txt['maintain_version_info'], '</p>
- <input type="submit" value="', $txt['maintain_run_now'], '" class="button_submit" />
- <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
- </form><hr />
- </div>
- <div class="content">
- <h3 class="double_height">', $txt['maintain_errors'], '</h3>
- <form action="', $scripturl, '?action=admin;area=repairboards" method="post" accept-charset="', $context['character_set'], '">
- <p class="floatleft">', $txt['maintain_errors_info'], '</p>
- <input type="submit" value="', $txt['maintain_run_now'], '" class="button_submit" />
- <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
- <input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '" />
- </form><hr />
- </div>
- <div class="content">
- <h3 class="double_height">', $txt['maintain_recount'], '</h3>
- <form action="', $scripturl, '?action=admin;area=maintain;sa=routine;activity=recount" method="post" accept-charset="', $context['character_set'], '">
- <p class="floatleft">', $txt['maintain_recount_info'], '</p>
- <input type="submit" value="', $txt['maintain_run_now'], '" class="button_submit" />
- <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
- <input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '" />
- </form><hr />
- </div>
- <div class="content">
- <h3 class="double_height">', $txt['maintain_logs'], '</h3>
- <form action="', $scripturl, '?action=admin;area=maintain;sa=routine;activity=logs" method="post" accept-charset="', $context['character_set'], '">
- <p class="floatleft">', $txt['maintain_logs_info'], '</p>
- <input type="submit" value="', $txt['maintain_run_now'], '" class="button_submit" />
- <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
- <input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '" />
- </form><hr />
- </div>
- <div class="content">
- <h3 class="double_height">', $txt['maintain_cache'], '</h3>
- <form action="', $scripturl, '?action=admin;area=maintain;sa=routine;activity=cleancache" method="post" accept-charset="', $context['character_set'], '">
- <p class="floatleft">', $txt['maintain_cache_info'], '</p>
- <input type="submit" value="', $txt['maintain_run_now'], '" class="button_submit" />
- <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
- <input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '" />
- </form><hr />
- </div>
- </div>
- </div>';
- }
- // Template for the member maintenance tasks.
- function template_maintain_members()
- {
- global $context, $settings, $options, $txt, $scripturl;
- // If maintenance has finished tell the user.
- if (!empty($context['maintenance_finished']))
- echo '
- <div class="infobox">
- ', sprintf($txt['maintain_done'], $context['maintenance_finished']), '
- </div>';
- echo '
- <script type="text/javascript"><!-- // --><![CDATA[
- var warningMessage = \'\';
- var membersSwap = false;
- function swapMembers()
- {
- membersSwap = !membersSwap;
- var membersForm = document.getElementById(\'membersForm\');
- document.getElementById("membersIcon").src = smf_images_url + (membersSwap ? "/collapse.png" : "/expand.png");
- setInnerHTML(document.getElementById("membersText"), membersSwap ? "', $txt['maintain_members_choose'], '" : "', $txt['maintain_members_all'], '");
- document.getElementById("membersPanel").style.display = (membersSwap ? "block" : "none");
- for (var i = 0; i < membersForm.length; i++)
- {
- if (membersForm.elements[i].type.toLowerCase() == "checkbox")
- membersForm.elements[i].checked = !membersSwap;
- }
- }
- function checkAttributeValidity()
- {
- origText = \'', $txt['reattribute_confirm'], '\';
- valid = true;
- // Do all the fields!
- if (!document.getElementById(\'to\').value)
- valid = false;
- warningMessage = origText.replace(/%member_to%/, document.getElementById(\'to\').value);
- if (document.getElementById(\'type_email\').checked)
- {
- if (!document.getElementById(\'from_email\').value)
- valid = false;
- warningMessage = warningMessage.replace(/%type%/, \'', addcslashes($txt['reattribute_confirm_email'], "'"), '\').replace(/%find%/, document.getElementById(\'from_email\').value);
- }
- else
- {
- if (!document.getElementById(\'from_name\').value)
- valid = false;
- warningMessage = warningMessage.replace(/%type%/, \'', addcslashes($txt['reattribute_confirm_username'], "'"), '\').replace(/%find%/, document.getElementById(\'from_name\').value);
- }
- document.getElementById(\'do_attribute\').disabled = valid ? \'\' : \'disabled\';
- setTimeout("checkAttributeValidity();", 500);
- return valid;
- }
- setTimeout("checkAttributeValidity();", 500);
- // ]]></script>
- <div id="manage_maintenance">
- <div class="cat_bar">
- <h3 class="catbg">', $txt['admin_news_select_members'], ' ', $txt['admin_maintenance'], '</h3>
- </div>
- <div class="windowbg2">
- <div class="content">
- <h3 class="double_height">', $txt['maintain_reattribute_posts'], '</h3>
- <form action="', $scripturl, '?action=admin;area=maintain;sa=members;activity=reattribute" method="post" accept-charset="', $context['character_set'], '">
- <p><strong>', $txt['reattribute_guest_posts'], '</strong></p>
- <dl class="settings">
- <dt>
- <label for="type_email"><input type="radio" name="type" id="type_email" value="email" checked="checked" class="input_radio" />', $txt['reattribute_email'], '</label>
- </dt>
- <dd>
- <input type="text" name="from_email" id="from_email" value="" onclick="document.getElementById(\'type_email\').checked = \'checked\'; document.getElementById(\'from_name\').value = \'\';" />
- </dd>
- <dt>
- <label for="type_name"><input type="radio" name="type" id="type_name" value="name" class="input_radio" />', $txt['reattribute_username'], '</label>
- </dt>
- <dd>
- <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" />
- </dd>
- </dl>
- <dl class="settings">
- <dt>
- <label for="to"><strong>', $txt['reattribute_current_member'], ':</strong></label>
- </dt>
- <dd>
- <input type="text" name="to" id="to" value="" class="input_text" />
- </dd>
- </dl>
- <p class="maintain_members">
- <input type="checkbox" name="posts" id="posts" checked="checked" class="input_check" />
- <label for="posts">', $txt['reattribute_increase_posts'], '</label>
- </p>
- <input type="submit" id="do_attribute" value="', $txt['reattribute'], '" onclick="if (!checkAttributeValidity()) return false; return confirm(warningMessage);" class="button_submit" />
- <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
- <input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '" />
- </form><hr />
- </div>
- <div class="content">
- <h3 class="double_height">
- <a href="', $scripturl, '?action=helpadmin;help=maintenance_members" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.png" class="icon" alt="', $txt['help'], '" /></a> ', $txt['maintain_members'], '
- </h3>
- <form action="', $scripturl, '?action=admin;area=maintain;sa=members;activity=purgeinactive" method="post" accept-charset="', $context['character_set'], '" id="membersForm">
- <p><a id="membersLink"></a>', $txt['maintain_members_since1'], '
- <select name="del_type">
- <option value="activated" selected="selected">', $txt['maintain_members_activated'], '</option>
- <option value="logged">', $txt['maintain_members_logged_in'], '</option>
- </select> ', $txt['maintain_members_since2'], ' <input type="text" name="maxdays" value="30" size="3" class="input_text" />', $txt['maintain_members_since3'], '</p>';
- echo '
- <p><a href="#membersLink" onclick="swapMembers();"><img src="', $settings['images_url'], '/expand.png" alt="+" id="membersIcon" /></a> <a href="#membersLink" onclick="swapMembers();" id="membersText" style="font-weight: bold;">', $txt['maintain_members_all'], '</a></p>
- <div style="display: none; padding: 3px" id="membersPanel">';
- foreach ($context['membergroups'] as $group)
- echo '
- <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 />';
- echo '
- </div>
- <input type="submit" value="', $txt['maintain_old_remove'], '" onclick="return confirm(\'', $txt['maintain_members_confirm'], '\');" class="button_submit" />
- <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
- <input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '" />
- </form><hr />
- </div>
- <div class="content">
- <h3 class="double_height">', $txt['maintain_recountposts'], '</h3>
- <form action="', $scripturl, '?action=admin;area=maintain;sa=members;activity=recountposts" method="post" accept-charset="', $context['character_set'], '" id="membersRecountForm">
- <p class="floatleft">', $txt['maintain_recountposts_info'], '</p>
- <input type="submit" value="', $txt['maintain_run_now'], '" class="button_submit" />
- <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
- <input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '" />
- </form><hr />
- </div>
- </div>
- </div>
- <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/suggest.js?fin20"></script>
- <script type="text/javascript"><!-- // --><![CDATA[
- var oAttributeMemberSuggest = new smc_AutoSuggest({
- sSelf: \'oAttributeMemberSuggest\',
- sSessionId: smf_session_id,
- sSessionVar: smf_session_var,
- sSuggestId: \'attributeMember\',
- sControlId: \'to\',
- sSearchType: \'member\',
- sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\',
- bItemList: false
- });
- // ]]></script>';
- }
- // Template for the topic maintenance tasks.
- function template_maintain_topics()
- {
- global $scripturl, $txt, $context, $settings, $modSettings;
- // If maintenance has finished tell the user.
- if (!empty($context['maintenance_finished']))
- echo '
- <div class="infobox">
- ', sprintf($txt['maintain_done'], $context['maintenance_finished']), '
- </div>';
- // Bit of javascript for showing which boards to prune in an otherwise hidden list.
- echo '
- <script type="text/javascript"><!-- // --><![CDATA[
- var rotSwap = false;
- function swapRot()
- {
- rotSwap = !rotSwap;
- // Toggle icon
- document.getElementById("rotIcon").src = smf_images_url + (rotSwap ? "/collapse.png" : "/expand.png");
- setInnerHTML(document.getElementById("rotText"), rotSwap ? ', JavaScriptEscape($txt['maintain_old_choose']), ' : ', JavaScriptEscape($txt['maintain_old_all']), ');
- // Toggle panel
- document.getElementById("rotPanel").style.display = !rotSwap ? "none" : "";
- // Toggle checkboxes
- var rotPanel = document.getElementById(\'rotPanel\');
- var oBoardCheckBoxes = rotPanel.getElementsByTagName(\'input\');
- for (var i = 0; i < oBoardCheckBoxes.length; i++)
- {
- if (oBoardCheckBoxes[i].type.toLowerCase() == "checkbox")
- oBoardCheckBoxes[i].checked = !rotSwap;
- }
- }
- // ]]></script>';
- echo '
- <div id="manage_maintenance">
- <div class="cat_bar">
- <h3 class="catbg">', $txt['maintain_sub_topics'], ' ', $txt['admin_maintenance'], '</h3>
- </div>
- <div class="windowbg2">
- <div class="content">
- <h3 class="double_height">', $txt['maintain_old'], '</h3>
- <div class="content flow_auto">
- <form action="', $scripturl, '?action=admin;area=maintain;sa=topics;activity=pruneold" method="post" accept-charset="', $context['character_set'], '">';
- // The otherwise hidden "choose which boards to prune".
- echo '
- <p>
- <a id="rotLink"></a>', $txt['maintain_old_since_days1'], '<input type="text" name="maxdays" value="30" size="3" />', $txt['maintain_old_since_days2'], '
- </p>
- <p>
- <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 />
- <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 />
- <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 />
- </p>';
- if (!empty($modSettings['enableStickyTopics']))
- echo '
- <p>
- <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 />
- </p>';
- echo '
- <p>
- <a href="#rotLink" onclick="swapRot();"><img src="', $settings['images_url'], '/expand.png" alt="+" id="rotIcon" /></a> <a href="#rotLink" onclick="swapRot();" id="rotText" style="font-weight: bold;">', $txt['maintain_old_all'], '</a>
- </p>
- <div style="display: none;" id="rotPanel" class="flow_hidden">
- <div class="floatleft" style="width: 49%">';
- // This is the "middle" of the list.
- $middle = ceil(count($context['categories']) / 2);
- $i = 0;
- foreach ($context['categories'] as $category)
- {
- echo '
- <fieldset>
- <legend>', $category['name'], '</legend>
- <ul class="reset">';
- // Display a checkbox with every board.
- foreach ($category['boards'] as $board)
- echo '
- <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>';
- echo '
- </ul>
- </fieldset>';
- // Increase $i, and check if we're at the middle yet.
- if (++$i == $middle)
- echo '
- </div>
- <div class="floatright" style="width: 49%;">';
- }
- echo '
- </div>
- </div>
- <input type="submit" value="', $txt['maintain_old_remove'], '" onclick="return confirm(\'', $txt['maintain_old_confirm'], '\');" class="button_submit" />
- <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
- <input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '" />
- </form><hr class="clear" />
- </div>
- <div class="content">
- <h3 class="double_height">', $txt['move_topics_maintenance'], '</h3>
- <form action="', $scripturl, '?action=admin;area=maintain;sa=topics;activity=massmove" method="post" accept-charset="', $context['character_set'], '">
- <p><label for="id_board_from">', $txt['move_topics_from'], ' </label>
- <select name="id_board_from" id="id_board_from">
- <option disabled="disabled">(', $txt['move_topics_select_board'], ')</option>';
- // From board
- foreach ($context['categories'] as $category)
- {
- echo '
- <option disabled="disabled">--------------------------------------</option>
- <option disabled="disabled">', $category['name'], '</option>
- <option disabled="disabled">--------------------------------------</option>';
- foreach ($category['boards'] as $board)
- echo '
- <option value="', $board['id'], '"> ', str_repeat('==', $board['child_level']), '=> ', $board['name'], '</option>';
- }
- echo '
- </select>
- <label for="id_board_to">', $txt['move_topics_to'], '</label>
- <select name="id_board_to" id="id_board_to">
- <option disabled="disabled">(', $txt['move_topics_select_board'], ')</option>';
- // To board
- foreach ($context['categories'] as $category)
- {
- echo '
- <option disabled="disabled">--------------------------------------</option>
- <option disabled="disabled">', $category['name'], '</option>
- <option disabled="disabled">--------------------------------------</option>';
- foreach ($category['boards'] as $board)
- echo '
- <option value="', $board['id'], '"> ', str_repeat('==', $board['child_level']), '=> ', $board['name'], '</option>';
- }
- echo '
- </select></p>
- <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" />
- <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
- </form><hr class="clear" />
- </div>
- </div>
- </div>
- </div>';
- }
- // Simple template for showing results of our optimization...
- function template_optimize()
- {
- global $context, $settings, $options, $txt, $scripturl;
- echo '
- <div id="manage_maintenance">
- <div class="cat_bar">
- <h3 class="catbg">', $txt['maintain_optimize'], '</h3>
- </div>
- <div class="windowbg2">
- <div class="content">
- <p>
- ', $txt['database_numb_tables'], '<br />
- ', $txt['database_optimize_attempt'], '<br />';
- // List each table being optimized...
- foreach ($context['optimized_tables'] as $table)
- echo '
- ', sprintf($txt['database_optimizing'], $table['name'], $table['data_freed']), '<br />';
- // How did we go?
- echo '
- <br />', $context['num_tables_optimized'] == 0 ? $txt['database_already_optimized'] : $context['num_tables_optimized'] . ' ' . $txt['database_optimized'];
- echo '
- </p>
- <p><a href="', $scripturl, '?action=admin;area=maintain">', $txt['maintain_return'], '</a></p>
- </div>
- </div>
- </div>';
- }
- function template_convert_utf8()
- {
- global $context, $txt, $settings, $scripturl;
- echo '
- <div id="manage_maintenance">
- <div class="cat_bar">
- <h3 class="catbg">', $txt['utf8_title'], '</h3>
- </div>
- <div class="windowbg2">
- <div class="content">
- <form action="', $scripturl, '?action=admin;area=maintain;sa=database;activity=convertutf8" method="post" accept-charset="', $context['character_set'], '">
- <p>', $txt['utf8_introduction'], '</p>
- <div>', $txt['utf8_warning'], '</div>
- <dl class="settings">
- <dt><strong>', $txt['utf8_source_charset'], ':</strong></dt>
- <dd><select name="src_charset">';
- foreach ($context['charset_list'] as $charset)
- echo '
- <option value="', $charset, '"', $charset === $context['charset_detected'] ? ' selected="selected"' : '', '>', $charset, '</option>';
- echo '
- </select></dd>
- <dt><strong>', $txt['utf8_database_charset'], ':</strong></dt>
- <dd>', $context['database_charset'], '</dd>
- <dt><strong>', $txt['utf8_target_charset'], ': </strong></dt>
- <dd>', $txt['utf8_utf8'], '</dd>
- </dl>
- <input type="submit" value="', $txt['utf8_proceed'], '" class="button_submit" />
- <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
- <input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '" />
- <input type="hidden" name="proceed" value="1" />
- </form><hr />
- </div>
- </div>
- </div>';
- }
- function template_convert_entities()
- {
- global $context, $txt, $settings, $scripturl;
- echo '
- <div id="manage_maintenance">
- <div class="cat_bar">
- <h3 class="catbg">', $txt['entity_convert_title'], '</h3>
- </div>
- <div class="windowbg2">
- <div class="content">
- <p>', $txt['entity_convert_introduction'], '</p>
- <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'], '">
- <input type="submit" value="', $txt['entity_convert_proceed'], '" class="button_submit" />
- </form>< hr />
- </div>
- </div>
- </div>';
- }
- ?>
|