MoveTopic.template.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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.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, $settings, $options, $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. <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. <dt>
  68. <label for="redirect_topic">', $txt['movetopic_redirect'], '</label>
  69. </dt>
  70. <dd>
  71. <input type="checkbox" name="redirect_topic" id="redirect_topic" checked="checked" class="input_check" />
  72. </dd>
  73. <dt>
  74. ', $txt['movetopic_expires'], '
  75. </dt>
  76. <dd>
  77. <select name="redirect_expires">
  78. <option value="0" selected="selected">', $txt['never'], '</option>
  79. <option value="1440">', $txt['one_day'], '</option>
  80. <option value="10080">', $txt['one_week'], '</option>
  81. <option value="20160">', $txt['two_weeks'], '</option>
  82. <option value="43200">', $txt['one_month'], '</option>
  83. <option value="86400">', $txt['two_months'], '</option>
  84. </select>
  85. </dd>
  86. </dl>
  87. </fieldset>
  88. <input type="submit" value="', $txt['move_topic'], '" onclick="return submitThisOnce(this);" accesskey="s" class="button_submit" />
  89. <br class="clear_right" />
  90. </div>
  91. </div>
  92. <span class="botslice"><span></span></span>
  93. </div>';
  94. if ($context['back_to_topic'])
  95. echo '
  96. <input type="hidden" name="goback" value="1" />';
  97. echo '
  98. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  99. <input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" />
  100. </form>
  101. </div>';
  102. }
  103. ?>