MoveTopic.template.php 3.6 KB

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