ReportToMod.template.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. '?action=reporttm;u=#'
  18. It should submit to:
  19. '?action=reporttm;topic=' . $context['current_topic'] . '.' . $context['start']
  20. '?action=reporttm;u=#'
  21. It only needs to send the following fields:
  22. comment: an additional comment to give the moderator.
  23. sc: the session id, or $context['session_id'].
  24. */
  25. function template_main()
  26. {
  27. global $context, $txt, $scripturl;
  28. echo '
  29. <div id="report_form">
  30. <form action="', $context['submit_url'], '" method="post" accept-charset="', $context['character_set'], '">
  31. <input type="hidden" name="', $context['report_type'], '" value="', $context['reported_item'], '">
  32. <div class="cat_bar">
  33. <h3 class="catbg">', $context['page_title'], '</h3>
  34. </div>
  35. <div class="windowbg">
  36. <div class="content">';
  37. if (!empty($context['post_errors']))
  38. {
  39. echo '
  40. <div id="error_box" class="errorbox">
  41. <ul id="error_list">';
  42. foreach ($context['post_errors'] as $key => $error)
  43. echo '
  44. <li id="error_', $key, '" class="error">', $error, '</li>';
  45. echo '
  46. </ul>';
  47. }
  48. else
  49. echo '
  50. <div style="display:none" id="error_box" class="errorbox">';
  51. echo '
  52. </div>';
  53. echo '
  54. <p class="noticebox">', $context['notice'], '</p>
  55. <br>
  56. <dl class="settings" id="report_post">';
  57. echo '
  58. <dt>
  59. <label for="report_comment">', $txt['enter_comment'], '</label>:
  60. </dt>
  61. <dd>
  62. <textarea type="text" id="report_comment" name="comment" rows="5">', $context['comment_body'], '</textarea>
  63. </dd>';
  64. echo '
  65. </dl>
  66. <div class="flow_auto">
  67. <input type="submit" name="save" value="', $txt['rtm10'], '" style="margin-left: 1ex;" class="button_submit">
  68. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
  69. </div>
  70. </div>
  71. </div>
  72. </form>
  73. </div>';
  74. }
  75. ?>