MoveTopic.template.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <?php
  2. /**
  3. * Simple Machines Forum (SMF)
  4. *
  5. * @package SMF
  6. * @author Simple Machines
  7. * @copyright 2014 Simple Machines and individual contributors
  8. * @license http://www.simplemachines.org/about/smf/license.php BSD
  9. *
  10. * @version 2.1 Alpha 1
  11. */
  12. /**
  13. * Show an interface for selecting which board to move a post to.
  14. */
  15. function template_main()
  16. {
  17. global $context, $txt, $scripturl;
  18. echo '
  19. <div id="move_topic" class="lower_padding">
  20. <form action="', $scripturl, '?action=movetopic2;current_board=' . $context['current_board'] . ';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. <div class="content">
  26. <div class="move_topic">
  27. <dl class="settings">
  28. <dt>
  29. <strong>', $txt['move_to'], ':</strong>
  30. </dt>
  31. <dd>
  32. <select name="toboard">';
  33. foreach ($context['categories'] as $category)
  34. {
  35. echo '
  36. <optgroup label="', $category['name'], '">';
  37. foreach ($category['boards'] as $board)
  38. echo '
  39. <option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', $board['id'] == $context['current_board'] ? ' disabled' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level']-1) . '=&gt; ' : '', $board['name'], '</option>';
  40. echo '
  41. </optgroup>';
  42. }
  43. echo '
  44. </select>
  45. </dd>';
  46. // Disable the reason textarea when the postRedirect checkbox is unchecked...
  47. echo '
  48. </dl>
  49. <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 />
  50. <fieldset id="subjectArea" style="display: none;">
  51. <dl class="settings">
  52. <dt><strong>', $txt['moveTopic3'], ':</strong></dt>
  53. <dd><input type="text" name="custom_subject" size="30" value="', $context['subject'], '" class="input_text" /></dd>
  54. </dl>
  55. <label for="enforce_subject"><input type="checkbox" name="enforce_subject" id="enforce_subject" class="input_check" /> ', $txt['moveTopic4'], '.</label>
  56. </fieldset>
  57. <label for="postRedirect"><input type="checkbox" name="postRedirect" id="postRedirect"', $context['is_approved'] ? ' 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>
  58. <fieldset id="reasonArea" style="margin-top: 1ex;', $context['is_approved'] ? '' : 'display: none;', '">
  59. <dl class="settings">
  60. <dt>
  61. ', $txt['moved_why'], '
  62. </dt>
  63. <dd>
  64. <textarea name="reason" rows="3" cols="40">', $txt['movetopic_default'], '</textarea>
  65. </dd>
  66. <dt>
  67. <label for="redirect_topic">', $txt['movetopic_redirect'], '</label>
  68. </dt>
  69. <dd>
  70. <input type="checkbox" name="redirect_topic" id="redirect_topic" checked class="input_check" />
  71. </dd>
  72. <dt>
  73. ', $txt['movetopic_expires'], '
  74. </dt>
  75. <dd>
  76. <select name="redirect_expires">
  77. <option value="0" selected>', $txt['never'], '</option>
  78. <option value="1440">', $txt['one_day'], '</option>
  79. <option value="10080">', $txt['one_week'], '</option>
  80. <option value="20160">', $txt['two_weeks'], '</option>
  81. <option value="43200">', $txt['one_month'], '</option>
  82. <option value="86400">', $txt['two_months'], '</option>
  83. </select>
  84. </dd>
  85. </dl>
  86. </fieldset>
  87. <input type="submit" value="', $txt['move_topic'], '" onclick="return submitThisOnce(this);" accesskey="s" class="button_submit" />
  88. </div>
  89. </div>
  90. </div>';
  91. if ($context['back_to_topic'])
  92. echo '
  93. <input type="hidden" name="goback" value="1" />';
  94. echo '
  95. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  96. <input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" />
  97. </form>
  98. </div>';
  99. }
  100. ?>