SendTopic.template.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. /**
  3. * Simple Machines Forum (SMF)
  4. *
  5. * @package SMF
  6. * @author Simple Machines http://www.simplemachines.org
  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. /* This template contains two humble sub templates - main. Its job is pretty
  14. simple: it collects the information we need to actually send the topic.
  15. The report sub template gets shown from:
  16. '?action=reporttm;topic=##.##;msg=##'
  17. It should submit to:
  18. '?action=reporttm;topic=' . $context['current_topic'] . '.' . $context['start']
  19. It only needs to send the following fields:
  20. comment: an additional comment to give the moderator.
  21. sc: the session id, or $context['session_id'].
  22. */
  23. function template_report()
  24. {
  25. global $context, $txt, $scripturl;
  26. echo '
  27. <div id="report_topic">
  28. <form action="', $scripturl, '?action=reporttm;topic=', $context['current_topic'], '.', $context['start'], '" method="post" accept-charset="', $context['character_set'], '">
  29. <input type="hidden" name="msg" value="' . $context['message_id'] . '">
  30. <div class="cat_bar">
  31. <h3 class="catbg">', $txt['report_to_mod'], '</h3>
  32. </div>
  33. <div class="windowbg">
  34. <div class="content">';
  35. if (!empty($context['post_errors']))
  36. {
  37. echo '
  38. <div id="error_box" class="errorbox">
  39. <ul id="error_list">';
  40. foreach ($context['post_errors'] as $key => $error)
  41. echo '
  42. <li id="error_', $key, '" class="error">', $error, '</li>';
  43. echo '
  44. </ul>';
  45. }
  46. else
  47. echo '
  48. <div style="display:none" id="error_box" class="errorbox">';
  49. echo '
  50. </div>';
  51. echo '
  52. <p class="noticebox">', $txt['report_to_mod_func'], '</p>
  53. <br>
  54. <dl class="settings" id="report_post">';
  55. echo '
  56. <dt>
  57. <label for="report_comment">', $txt['enter_comment'], '</label>:
  58. </dt>
  59. <dd>
  60. <textarea type="text" id="report_comment" name="comment" rows="5">', $context['comment_body'], '</textarea>
  61. </dd>';
  62. echo '
  63. </dl>
  64. <div class="flow_auto">
  65. <input type="submit" name="save" value="', $txt['rtm10'], '" style="margin-left: 1ex;" class="button_submit">
  66. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
  67. </div>
  68. </div>
  69. </div>
  70. </form>
  71. </div>';
  72. }
  73. ?>