Chris@76
|
1 <?php
|
Chris@76
|
2 /**
|
Chris@76
|
3 * Simple Machines Forum (SMF)
|
Chris@76
|
4 *
|
Chris@76
|
5 * @package SMF
|
Chris@76
|
6 * @author Simple Machines
|
Chris@76
|
7 * @copyright 2011 Simple Machines
|
Chris@76
|
8 * @license http://www.simplemachines.org/about/smf/license.php BSD
|
Chris@76
|
9 *
|
Chris@76
|
10 * @version 2.0
|
Chris@76
|
11 */
|
Chris@76
|
12
|
Chris@76
|
13 // Show an interface for selecting which board to move a post to.
|
Chris@76
|
14 function template_main()
|
Chris@76
|
15 {
|
Chris@76
|
16 global $context, $settings, $options, $txt, $scripturl;
|
Chris@76
|
17
|
Chris@76
|
18 echo '
|
Chris@76
|
19 <div id="move_topic" class="lower_padding">
|
Chris@76
|
20 <form action="', $scripturl, '?action=movetopic2;topic=', $context['current_topic'], '.0" method="post" accept-charset="', $context['character_set'], '" onsubmit="submitonce(this);">
|
Chris@76
|
21 <div class="cat_bar">
|
Chris@76
|
22 <h3 class="catbg">', $txt['move_topic'], '</h3>
|
Chris@76
|
23 </div>
|
Chris@76
|
24 <div class="windowbg centertext">
|
Chris@76
|
25 <span class="topslice"><span></span></span>
|
Chris@76
|
26 <div class="content">
|
Chris@76
|
27 <div class="move_topic">
|
Chris@76
|
28 <dl class="settings">
|
Chris@76
|
29 <dt>
|
Chris@76
|
30 <strong>', $txt['move_to'], ':</strong>
|
Chris@76
|
31 </dt>
|
Chris@76
|
32 <dd>
|
Chris@76
|
33 <select name="toboard">';
|
Chris@76
|
34
|
Chris@76
|
35 foreach ($context['categories'] as $category)
|
Chris@76
|
36 {
|
Chris@76
|
37 echo '
|
Chris@76
|
38 <optgroup label="', $category['name'], '">';
|
Chris@76
|
39
|
Chris@76
|
40 foreach ($category['boards'] as $board)
|
Chris@76
|
41 echo '
|
Chris@76
|
42 <option value="', $board['id'], '"', $board['selected'] ? ' selected="selected"' : '', $board['id'] == $context['current_board'] ? ' disabled="disabled"' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level']-1) . '=> ' : '', $board['name'], '</option>';
|
Chris@76
|
43 echo '
|
Chris@76
|
44 </optgroup>';
|
Chris@76
|
45 }
|
Chris@76
|
46
|
Chris@76
|
47 echo '
|
Chris@76
|
48 </select>
|
Chris@76
|
49 </dd>';
|
Chris@76
|
50
|
Chris@76
|
51 // Disable the reason textarea when the postRedirect checkbox is unchecked...
|
Chris@76
|
52 echo '
|
Chris@76
|
53 </dl>
|
Chris@76
|
54 <label for="reset_subject"><input type="checkbox" name="reset_subject" id="reset_subject" onclick="document.getElementById(\'subjectArea\').style.display = this.checked ? \'block\' : \'none\';" class="input_check" /> ', $txt['moveTopic2'], '.</label><br />
|
Chris@76
|
55 <fieldset id="subjectArea" style="display: none;">
|
Chris@76
|
56 <dl class="settings">
|
Chris@76
|
57 <dt><strong>', $txt['moveTopic3'], ':</strong></dt>
|
Chris@76
|
58 <dd><input type="text" name="custom_subject" size="30" value="', $context['subject'], '" class="input_text" /></dd>
|
Chris@76
|
59 </dl>
|
Chris@76
|
60 <label for="enforce_subject"><input type="checkbox" name="enforce_subject" id="enforce_subject" class="input_check" /> ', $txt['moveTopic4'], '.</label>
|
Chris@76
|
61 </fieldset>
|
Chris@76
|
62 <label for="postRedirect"><input type="checkbox" name="postRedirect" id="postRedirect" ', $context['is_approved'] ? 'checked="checked"' : '', ' onclick="', $context['is_approved'] ? '' : 'if (this.checked && !confirm(\'' . $txt['move_topic_unapproved_js'] . '\')) return false; ', 'document.getElementById(\'reasonArea\').style.display = this.checked ? \'block\' : \'none\';" class="input_check" /> ', $txt['moveTopic1'], '.</label>
|
Chris@76
|
63 <fieldset id="reasonArea" style="margin-top: 1ex;', $context['is_approved'] ? '' : 'display: none;', '">
|
Chris@76
|
64 <dl class="settings">
|
Chris@76
|
65 <dt>
|
Chris@76
|
66 ', $txt['moved_why'], '
|
Chris@76
|
67 </dt>
|
Chris@76
|
68 <dd>
|
Chris@76
|
69 <textarea name="reason" rows="3" cols="40">', $txt['movetopic_default'], '</textarea>
|
Chris@76
|
70 </dd>
|
Chris@76
|
71 </dl>
|
Chris@76
|
72 </fieldset>
|
Chris@76
|
73 <div class="righttext">
|
Chris@76
|
74 <input type="submit" value="', $txt['move_topic'], '" onclick="return submitThisOnce(this);" accesskey="s" class="button_submit" />
|
Chris@76
|
75 </div>
|
Chris@76
|
76 </div>
|
Chris@76
|
77 </div>
|
Chris@76
|
78 <span class="botslice"><span></span></span>
|
Chris@76
|
79 </div>';
|
Chris@76
|
80
|
Chris@76
|
81 if ($context['back_to_topic'])
|
Chris@76
|
82 echo '
|
Chris@76
|
83 <input type="hidden" name="goback" value="1" />';
|
Chris@76
|
84
|
Chris@76
|
85 echo '
|
Chris@76
|
86 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
|
Chris@76
|
87 <input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" />
|
Chris@76
|
88 </form>
|
Chris@76
|
89 </div>';
|
Chris@76
|
90 }
|
Chris@76
|
91
|
Chris@76
|
92 ?> |