MoveTopic.template.php 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. // Show an interface for selecting which board to move a post to.
  13. function template_main()
  14. {
  15. global $context, $settings, $options, $txt, $scripturl;
  16. echo '
  17. <div id="move_topic" class="lower_padding">
  18. <form action="', $scripturl, '?action=movetopic2;topic=', $context['current_topic'], '.0" method="post" accept-charset="', $context['character_set'], '" onsubmit="submitonce(this);">
  19. <div class="cat_bar">
  20. <h3 class="catbg">', $txt['move_topic'], '</h3>
  21. </div>
  22. <div class="windowbg centertext">
  23. <span class="topslice"><span></span></span>
  24. <div class="content">
  25. <div class="move_topic">
  26. <dl class="settings">
  27. <dt>
  28. <strong>', $txt['move_to'], ':</strong>
  29. </dt>
  30. <dd>
  31. <select name="toboard">';
  32. foreach ($context['categories'] as $category)
  33. {
  34. echo '
  35. <optgroup label="', $category['name'], '">';
  36. foreach ($category['boards'] as $board)
  37. echo '
  38. <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) . '=&gt; ' : '', $board['name'], '</option>';
  39. echo '
  40. </optgroup>';
  41. }
  42. echo '
  43. </select>
  44. </dd>';
  45. // Disable the reason textarea when the postRedirect checkbox is unchecked...
  46. echo '
  47. </dl>
  48. <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 />
  49. <fieldset id="subjectArea" style="display: none;">
  50. <dl class="settings">
  51. <dt><strong>', $txt['moveTopic3'], ':</strong></dt>
  52. <dd><input type="text" name="custom_subject" size="30" value="', $context['subject'], '" class="input_text" /></dd>
  53. </dl>
  54. <label for="enforce_subject"><input type="checkbox" name="enforce_subject" id="enforce_subject" class="input_check" /> ', $txt['moveTopic4'], '.</label>
  55. </fieldset>
  56. <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>
  57. <fieldset id="reasonArea" style="margin-top: 1ex;', $context['is_approved'] ? '' : 'display: none;', '">
  58. <dl class="settings">
  59. <dt>
  60. ', $txt['moved_why'], '
  61. </dt>
  62. <dd>
  63. <textarea name="reason" rows="3" cols="40">', $txt['movetopic_default'], '</textarea>
  64. </dd>
  65. </dl>
  66. </fieldset>
  67. <div class="righttext">
  68. <input type="submit" value="', $txt['move_topic'], '" onclick="return submitThisOnce(this);" accesskey="s" class="button_submit" />
  69. </div>
  70. </div>
  71. </div>
  72. <span class="botslice"><span></span></span>
  73. </div>';
  74. if ($context['back_to_topic'])
  75. echo '
  76. <input type="hidden" name="goback" value="1" />';
  77. echo '
  78. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  79. <input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" />
  80. </form>
  81. </div>';
  82. }
  83. ?>