123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297 |
- <?php
- /**
- * Simple Machines Forum (SMF)
- *
- * @package SMF
- * @author Simple Machines
- * @copyright 2012 Simple Machines
- * @license http://www.simplemachines.org/about/smf/license.php BSD
- *
- * @version 2.1 Alpha 1
- */
- // Template template wraps around the simple settings page to add javascript functionality.
- function template_avatar_settings_above()
- {
- }
- function template_avatar_settings_below()
- {
- echo '
- <script type="text/javascript"><!-- // --><![CDATA[
- var fUpdateStatus = function ()
- {
- document.getElementById("avatar_max_width_external").disabled = document.getElementById("avatar_download_external").checked;
- document.getElementById("avatar_max_height_external").disabled = document.getElementById("avatar_download_external").checked;
- document.getElementById("avatar_action_too_large").disabled = document.getElementById("avatar_download_external").checked;
- document.getElementById("custom_avatar_dir").disabled = document.getElementById("custom_avatar_enabled").value == 0;
- document.getElementById("custom_avatar_url").disabled = document.getElementById("custom_avatar_enabled").value == 0;
- }
- addLoadEvent(fUpdateStatus);
- // ]]></script>
- ';
- }
- function template_browse()
- {
- global $context, $settings, $options, $scripturl, $txt;
- echo '
- <div id="manage_attachments">
- <div class="cat_bar">
- <h3 class="catbg">', $txt['attachment_manager_browse_files'], '</h3>
- </div>
- <div class="windowbg2">
- <div class="content">
- <a href="', $scripturl, '?action=admin;area=manageattachments;sa=browse">', $context['browse_type'] === 'attachments' ? '<img src="' . $settings['images_url'] . '/selected.png" alt=">" /> ' : '', $txt['attachment_manager_attachments'], '</a> |
- <a href="', $scripturl, '?action=admin;area=manageattachments;sa=browse;avatars">', $context['browse_type'] === 'avatars' ? '<img src="' . $settings['images_url'] . '/selected.png" alt=">" /> ' : '', $txt['attachment_manager_avatars'], '</a> |
- <a href="', $scripturl, '?action=admin;area=manageattachments;sa=browse;thumbs">', $context['browse_type'] === 'thumbs' ? '<img src="' . $settings['images_url'] . '/selected.png" alt=">" /> ' : '', $txt['attachment_manager_thumbs'], '</a>
- </div>
- </div>
- </div>';
- template_show_list('file_list');
- }
- function template_maintenance()
- {
- global $context, $settings, $options, $scripturl, $txt, $modSettings;
- echo '
- <div id="manage_attachments">
- <div class="cat_bar">
- <h3 class="catbg">', $txt['attachment_stats'], '</h3>
- </div>
- <div class="windowbg">
- <div class="content">
- <dl class="settings">
- <dt><strong>', $txt['attachment_total'], ':</strong></dt><dd>', $context['num_attachments'], '</dd>
- <dt><strong>', $txt['attachment_manager_total_avatars'], ':</strong></dt><dd>', $context['num_avatars'], '</dd>
- <dt><strong>', $txt['attachmentdir_size'], ':</strong></dt><dd>', $context['attachment_total_size'], ' ', $txt['kilobyte'], '</dd>
- <dt><strong>', $txt['attach_current_dir'], ':</strong></dt><dd>', $modSettings['attachmentUploadDir'][$modSettings['currentAttachmentUploadDir']], '</dd>
- <dt><strong>', $txt['attachmentdir_size_current'], ':</strong></dt><dd>', $context['attachment_current_size'], ' ', $txt['kilobyte'], '</dd>
- <dt><strong>', $txt['attachment_space'], ':</strong></dt><dd>', isset($context['attachment_space']) ? $context['attachment_space'] . ' ' . $txt['kilobyte'] : $txt['attachmentdir_size_not_set'], '</dd>
- <dt><strong>', $txt['attachmentdir_files_current'], ':</strong></dt><dd>', $context['attachment_current_files'], '</dd>
- <dt><strong>', $txt['attachment_files'], ':</strong></dt><dd>', isset($context['attachment_files']) ? $context['attachment_files'] : $txt['attachmentdir_files_not_set'], '</dd>
- </dl>
- </div>
- </div>
- <div class="cat_bar">
- <h3 class="catbg">', $txt['attachment_integrity_check'], '</h3>
- </div>
- <div class="windowbg">
- <div class="content">
- <form action="', $scripturl, '?action=admin;area=manageattachments;sa=repair;', $context['session_var'], '=', $context['session_id'], '" method="post" accept-charset="', $context['character_set'], '">
- <p>', $txt['attachment_integrity_check_desc'], '</p>
- <hr class="hrcolor" />
- <input type="submit" name="repair" value="', $txt['attachment_check_now'], '" class="button_submit" />
- <br class="clear_right" />
- </form>
- </div>
- </div>
- <div class="cat_bar">
- <h3 class="catbg">', $txt['attachment_pruning'], '</h3>
- </div>
- <div class="windowbg">
- <div class="content">
- <form action="', $scripturl, '?action=admin;area=manageattachments" method="post" accept-charset="', $context['character_set'], '" onsubmit="return confirm(\'', $txt['attachment_pruning_warning'], '\');" style="margin: 0 0 2ex 0;">
- ', $txt['attachment_remove_old'], ' <input type="text" name="age" value="25" size="4" class="input_text" /> ', $txt['days_word'], '<br />
- ', $txt['attachment_pruning_message'], ': <input type="text" name="notice" value="', $txt['attachment_delete_admin'], '" size="40" class="input_text" /><br />
- <input type="submit" name="remove" value="', $txt['remove'], '" class="button_submit" />
- <input type="hidden" name="type" value="attachments" />
- <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
- <input type="hidden" name="sa" value="byAge" />
- <br class="clear_right" />
- </form>
- <hr />
- <form action="', $scripturl, '?action=admin;area=manageattachments" method="post" accept-charset="', $context['character_set'], '" onsubmit="return confirm(\'', $txt['attachment_pruning_warning'], '\');" style="margin: 0 0 2ex 0;">
- ', $txt['attachment_remove_size'], ' <input type="text" name="size" id="size" value="100" size="4" class="input_text" /> ', $txt['kilobyte'], '<br />
- ', $txt['attachment_pruning_message'], ': <input type="text" name="notice" value="', $txt['attachment_delete_admin'], '" size="40" class="input_text" /><br />
- <input type="submit" name="remove" value="', $txt['remove'], '" class="button_submit" />
- <input type="hidden" name="type" value="attachments" />
- <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
- <input type="hidden" name="sa" value="bySize" />
- <br class="clear_right" />
- </form>
- <hr />
- <form action="', $scripturl, '?action=admin;area=manageattachments" method="post" accept-charset="', $context['character_set'], '" onsubmit="return confirm(\'', $txt['attachment_pruning_warning'], '\');" style="margin: 0 0 2ex 0;">
- ', $txt['attachment_manager_avatars_older'], ' <input type="text" name="age" value="45" size="4" class="input_text" /> ', $txt['days_word'], '<br />
- <input type="submit" name="remove" value="', $txt['remove'], '" class="button_submit" />
- <input type="hidden" name="type" value="avatars" />
- <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
- <input type="hidden" name="sa" value="byAge" />
- </form>
- </div>
- </div>
- </div>';
- echo '
- <div id="transfer" class="cat_bar">
- <h3 class="catbg">', $txt['attachment_transfer'], '</h3>
- </div>';
- if (!empty($context['results']))
- echo '
- <div class="noticebox">', $context['results'], '</div>';
- echo '
- <div class="windowbg">
- <div class="content">
- <form action="', $scripturl, '?action=admin;area=manageattachments;sa=transfer" method="post" accept-charset="', $context['character_set'], '">
- <p>', $txt['attachment_transfer_desc'], '</p>
- <hr class="hrcolor" />
- <dl class="settings">
- <dt>', $txt['attachment_transfer_from'], '</dt>
- <dd><select name="from">
- <option value="0">', $txt['attachment_transfer_select'], '</option>';
- foreach ($context['attach_dirs'] as $id => $dir)
- echo '
- <option value="', $id, '">', $dir, '</option>';
- echo '
- </select></dd>
- <dt>', $txt['attachment_transfer_auto'], '</dt>
- <dd><select name="auto">
- <option value="0">', $txt['attachment_transfer_auto_select'], '</option>
- <option value="-1">', $txt['attachment_transfer_forum_root'], '</option>';
- if (!empty($context['base_dirs']))
- foreach ($context['base_dirs'] as $id => $dir)
- echo '
- <option value="', $id, '">', $dir, '</option>';
- else
- echo '
- <option value="0" disabled="disabled">', $txt['attachment_transfer_no_base'], '</option>';
- echo '
- </select></dd>
- <dt>', $txt['attachment_transfer_to'], '</dt>
- <dd><select name="to">
- <option value="0">', $txt['attachment_transfer_select'], '</option>';
- foreach ($context['attach_dirs'] as $id => $dir)
- echo '
- <option value="', $id, '">', $dir, '</option>';
- echo '
- </select></dd>';
- if (!empty($modSettings['attachmentDirFileLimit']))
- echo '
- <dt>', $txt['attachment_transfer_empty'], '</dt>
- <dd><input type="checkbox" name="empty_it"', $context['checked'] ? ' checked="checked"' : '', ' /></dd>';
- echo '
- </dl>
- <hr class="hrcolor"/>
- <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
- <input type="submit" onclick="start_progress()" name="transfer" value="', $txt['attachment_transfer_now'], '" class="button_submit" />
- <div id="progress_msg"></div>
- <div id="show_progress" class="padding"></div>
- <br class="clear_right" />
- </form>
- <script type="text/javascript"><!-- // --><![CDATA[
- function start_progress() {
- setTimeout(\'show_msg()\', 1000);
- }
- function show_msg() {
- $(\'#progress_msg\').html(\'<div><img src="', $settings['actual_images_url'], '/loading.gif" alt="loading.gif" width="35" height="35" /> ', $txt['attachment_transfer_progress'] , '<\/div>\');
- show_progress();
- }
- function show_progress() {
- $(\'#show_progress\').load("progress.php");
- setTimeout(\'show_progress()\', 1500);
- }
- // ]]></script>
- </div>
- </div>
- <br class="clear" />';
- }
- function template_attachment_repair()
- {
- global $context, $txt, $scripturl, $settings;
- // If we've completed just let them know!
- if ($context['completed'])
- {
- echo '
- <div id="manage_attachments">
- <div class="cat_bar">
- <h3 class="catbg">', $txt['repair_attachments_complete'], '</h3>
- </div>
- <div class="windowbg">
- <div class="content">
- ', $txt['repair_attachments_complete_desc'], '
- </div>
- </div>
- </div>
- <br class="clear" />';
- }
- // What about if no errors were even found?
- elseif (!$context['errors_found'])
- {
- echo '
- <div id="manage_attachments">
- <div class="cat_bar">
- <h3 class="catbg">', $txt['repair_attachments_complete'], '</h3>
- </div>
- <div class="windowbg">
- <div class="content">
- ', $txt['repair_attachments_no_errors'], '
- </div>
- </div>
- </div>
- <br class="clear" />';
- }
- // Otherwise, I'm sad to say, we have a problem!
- else
- {
- echo '
- <div id="manage_attachments">
- <form id="admin_form_wrapper" action="', $scripturl, '?action=admin;area=manageattachments;sa=repair;fixErrors=1;step=0;substep=0;', $context['session_var'], '=', $context['session_id'], '" method="post" accept-charset="', $context['character_set'], '">
- <div class="cat_bar">
- <h3 class="catbg">', $txt['repair_attachments'], '</h3>
- </div>
- <div class="windowbg">
- <div class="content">
- <p>', $txt['repair_attachments_error_desc'], '</p>';
- // Loop through each error reporting the status
- foreach ($context['repair_errors'] as $error => $number)
- {
- if (!empty($number))
- echo '
- <input type="checkbox" name="to_fix[]" id="', $error, '" value="', $error, '" class="input_check" />
- <label for="', $error, '">', sprintf($txt['attach_repair_' . $error], $number), '</label><br />';
- }
- echo ' <br />
- <input type="submit" value="', $txt['repair_attachments_continue'], '" class="button_submit" />
- <input type="submit" name="cancel" value="', $txt['repair_attachments_cancel'], '" class="button_submit" />
- </div>
- </div>
- </form>
- </div>
- <br class="clear" />';
- }
- }
- function template_attachment_paths()
- {
- global $modSettings;
- if (!empty($modSettings['attachment_basedirectories']))
- {
- template_show_list('base_paths');
- }
- template_show_list('attach_paths');
- }
- ?>
|