ReportToMod.template.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. // Want to see your master piece?
  29. echo '
  30. <div id="preview_section"', isset($context['preview_message']) ? '' : ' style="display: none;"', '>
  31. <div class="cat_bar">
  32. <h3 class="catbg">
  33. <span>', $txt['preview'], '</span>
  34. </h3>
  35. </div>
  36. <div class="windowbg">
  37. <div class="content">
  38. <div class="post" id="preview_body">
  39. ', empty($context['preview_message']) ? '<br>' : $context['preview_message'], '
  40. </div>
  41. </div>
  42. </div>
  43. </div><br>';
  44. echo '
  45. <div id="report_form">
  46. <form action="', $context['submit_url'], '" method="post" accept-charset="', $context['character_set'], '">
  47. <input type="hidden" name="', $context['report_type'], '" value="', $context['reported_item'], '">
  48. <div class="cat_bar">
  49. <h3 class="catbg">', $context['page_title'], '</h3>
  50. </div>
  51. <div class="windowbg">
  52. <div class="content">';
  53. if (!empty($context['post_errors']))
  54. {
  55. echo '
  56. <div id="error_box" class="errorbox">
  57. <ul id="error_list">';
  58. foreach ($context['post_errors'] as $key => $error)
  59. echo '
  60. <li id="error_', $key, '" class="error">', $error, '</li>';
  61. echo '
  62. </ul>';
  63. }
  64. else
  65. echo '
  66. <div style="display:none" id="error_box" class="errorbox">';
  67. echo '
  68. </div>';
  69. echo '
  70. <p class="noticebox">', $context['notice'], '</p>
  71. <br>
  72. <dl class="settings" id="report_post">';
  73. echo '
  74. <dt>
  75. <label for="report_comment">', $txt['enter_comment'], '</label>:
  76. </dt>
  77. <dd>
  78. <textarea type="text" id="report_comment" name="comment" rows="5">', $context['comment_body'], '</textarea>
  79. </dd>';
  80. echo '
  81. </dl>
  82. <div class="flow_auto">
  83. <input type="submit" name="preview" value="', $txt['preview'] , '" class="button_submit">
  84. <input type="submit" name="save" value="', $txt['rtm10'], '" style="margin-left: 1ex;" class="button_submit">
  85. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
  86. </div>
  87. </div>
  88. </div>
  89. </form>
  90. </div>';
  91. }
  92. ?>