ModerationCenter.template.php 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862
  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. function template_moderation_center()
  13. {
  14. global $settings, $options, $context, $txt, $scripturl;
  15. // Show a welcome message to the user.
  16. echo '
  17. <div id="modcenter">
  18. <div class="cat_bar">
  19. <h3 class="catbg">', $txt['moderation_center'], '</h3>
  20. </div>
  21. <div class="information">
  22. <strong>', $txt['hello_guest'], ' ', $context['user']['name'], '!</strong>
  23. <p>
  24. ', $txt['mc_description'], '
  25. </p>
  26. </div>';
  27. $alternate = true;
  28. // Show all the blocks they want to see.
  29. foreach ($context['mod_blocks'] as $block)
  30. {
  31. $block_function = 'template_' . $block;
  32. echo '
  33. <div class="modblock_', $alternate ? 'left' : 'right', '">', function_exists($block_function) ? $block_function() : '', '</div>';
  34. if (!$alternate)
  35. echo '
  36. <br class="clear" />';
  37. $alternate = !$alternate;
  38. }
  39. echo '
  40. </div>
  41. <br class="clear" />';
  42. }
  43. function template_latest_news()
  44. {
  45. global $settings, $options, $context, $txt, $scripturl;
  46. echo '
  47. <div class="cat_bar">
  48. <h3 class="catbg">
  49. <span class="ie6_header floatleft"><a href="', $scripturl, '?action=helpadmin;help=live_news" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.gif" alt="', $txt['help'], '" class="icon" /></a> ', $txt['mc_latest_news'], '</span>
  50. </h3>
  51. </div>
  52. <div class="windowbg">
  53. <span class="topslice"><span></span></span>
  54. <div class="content">
  55. <div id="smfAnnouncements" class="smalltext">', $txt['mc_cannot_connect_sm'], '</div>
  56. </div>
  57. <span class="botslice"><span></span></span>
  58. </div>';
  59. // This requires a lot of javascript...
  60. // @todo Put this in it's own file!!
  61. echo '
  62. <script type="text/javascript" src="', $scripturl, '?action=viewsmfile;filename=current-version.js"></script>
  63. <script type="text/javascript" src="', $scripturl, '?action=viewsmfile;filename=latest-news.js"></script>
  64. <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/admin.js?fin20"></script>
  65. <script type="text/javascript"><!-- // --><![CDATA[
  66. var oAdminIndex = new smf_AdminIndex({
  67. sSelf: \'oAdminCenter\',
  68. bLoadAnnouncements: true,
  69. sAnnouncementTemplate: ', JavaScriptEscape('
  70. <dl>
  71. %content%
  72. </dl>
  73. '), ',
  74. sAnnouncementMessageTemplate: ', JavaScriptEscape('
  75. <dt><a href="%href%">%subject%</a> ' . $txt['on'] . ' %time%</dt>
  76. <dd>
  77. %message%
  78. </dd>
  79. '), ',
  80. sAnnouncementContainerId: \'smfAnnouncements\'
  81. });
  82. // ]]></script>';
  83. }
  84. // Show all the group requests the user can see.
  85. function template_group_requests_block()
  86. {
  87. global $settings, $options, $context, $txt, $scripturl;
  88. echo '
  89. <div class="cat_bar">
  90. <h3 class="catbg">
  91. <a href="', $scripturl, '?action=groups;sa=requests">', $txt['mc_group_requests'], '</a>
  92. </h3>
  93. </div>
  94. <div class="windowbg">
  95. <span class="topslice"><span></span></span>
  96. <div class="content modbox">
  97. <ul class="reset">';
  98. foreach ($context['group_requests'] as $request)
  99. echo '
  100. <li class="smalltext">
  101. <a href="', $request['request_href'], '">', $request['group']['name'], '</a> ', $txt['mc_groupr_by'], ' ', $request['member']['link'], '
  102. </li>';
  103. // Don't have any watched users right now?
  104. if (empty($context['group_requests']))
  105. echo '
  106. <li>
  107. <strong class="smalltext">', $txt['mc_group_requests_none'], '</strong>
  108. </li>';
  109. echo '
  110. </ul>
  111. </div>
  112. <span class="botslice"><span></span></span>
  113. </div>';
  114. }
  115. // A block to show the current top reported posts.
  116. function template_reported_posts_block()
  117. {
  118. global $settings, $options, $context, $txt, $scripturl;
  119. echo '
  120. <div class="cat_bar">
  121. <h3 class="catbg">
  122. <a href="', $scripturl, '?action=moderate;area=reports">', $txt['mc_recent_reports'], '</a>
  123. </h3>
  124. </div>
  125. <div class="windowbg">
  126. <span class="topslice"><span></span></span>
  127. <div class="content modbox">
  128. <ul class="reset">';
  129. foreach ($context['reported_posts'] as $report)
  130. echo '
  131. <li class="smalltext">
  132. <a href="', $report['report_href'], '">', $report['subject'], '</a> ', $txt['mc_reportedp_by'], ' ', $report['author']['link'], '
  133. </li>';
  134. // Don't have any watched users right now?
  135. if (empty($context['reported_posts']))
  136. echo '
  137. <li>
  138. <strong class="smalltext">', $txt['mc_recent_reports_none'], '</strong>
  139. </li>';
  140. echo '
  141. </ul>
  142. </div>
  143. <span class="botslice"><span></span></span>
  144. </div>';
  145. }
  146. function template_watched_users()
  147. {
  148. global $settings, $options, $context, $txt, $scripturl;
  149. echo '
  150. <div class="cat_bar">
  151. <h3 class="catbg">
  152. <a href="', $scripturl, '?action=moderate;area=userwatch">', $txt['mc_watched_users'], '</a>
  153. </h3>
  154. </div>
  155. <div class="windowbg">
  156. <span class="topslice"><span></span></span>
  157. <div class="content modbox">
  158. <ul class="reset">';
  159. foreach ($context['watched_users'] as $user)
  160. echo '
  161. <li>
  162. <span class="smalltext">', sprintf(!empty($user['last_login']) ? $txt['mc_seen'] : $txt['mc_seen_never'], $user['link'], $user['last_login']), '</span>
  163. </li>';
  164. // Don't have any watched users right now?
  165. if (empty($context['watched_users']))
  166. echo '
  167. <li>
  168. <strong class="smalltext">', $txt['mc_watched_users_none'], '</strong>
  169. </li>';
  170. echo '
  171. </ul>
  172. </div>
  173. <span class="botslice"><span></span></span>
  174. </div>';
  175. }
  176. // Little section for making... notes.
  177. function template_notes()
  178. {
  179. global $settings, $options, $context, $txt, $scripturl;
  180. echo '
  181. <form action="', $scripturl, '?action=moderate;area=index" method="post">
  182. <div class="cat_bar">
  183. <h3 class="catbg">', $txt['mc_notes'], '</h3>
  184. </div>
  185. <div class="windowbg">
  186. <span class="topslice"><span></span></span>
  187. <div class="content modbox">';
  188. if (!empty($context['notes']))
  189. {
  190. echo '
  191. <ul class="reset moderation_notes">';
  192. // Cycle through the notes.
  193. foreach ($context['notes'] as $note)
  194. echo '
  195. <li class="smalltext"><a href="', $note['delete_href'], '"><img src="', $settings['images_url'], '/pm_recipient_delete.gif" alt="" /></a> <strong>', $note['author']['link'], ':</strong> ', $note['text'], '</li>';
  196. echo '
  197. </ul>
  198. <div class="pagesection notes">
  199. <span class="smalltext">', $txt['pages'], ': ', $context['page_index'], '</span>
  200. </div>';
  201. }
  202. echo '
  203. <div class="floatleft post_note">
  204. <input type="text" name="new_note" value="', $txt['mc_click_add_note'], '" style="width: 95%;" onclick="if (this.value == \'', $txt['mc_click_add_note'], '\') this.value = \'\';" class="input_text" />
  205. </div>
  206. <div class="floatright">
  207. <input type="submit" name="makenote" value="', $txt['mc_add_note'], '" class="button_submit" />
  208. </div>
  209. <br class="clear" />
  210. </div>
  211. <span class="botslice"><span></span></span>
  212. </div>
  213. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  214. </form>';
  215. }
  216. function template_reported_posts()
  217. {
  218. global $settings, $options, $context, $txt, $scripturl;
  219. echo '
  220. <form action="', $scripturl, '?action=moderate;area=reports', $context['view_closed'] ? ';sa=closed' : '', ';start=', $context['start'], '" method="post" accept-charset="', $context['character_set'], '">
  221. <div class="cat_bar">
  222. <h3 class="catbg">
  223. ', $context['view_closed'] ? $txt['mc_reportedp_closed'] : $txt['mc_reportedp_active'], '
  224. </h3>
  225. </div>
  226. <div class="pagesection">
  227. <div class="pages">', $txt['pages'], ': ', $context['page_index'], '</div>
  228. </div>';
  229. // Make the buttons.
  230. $close_button = create_button('close.gif', $context['view_closed'] ? 'mc_reportedp_open' : 'mc_reportedp_close', $context['view_closed'] ? 'mc_reportedp_open' : 'mc_reportedp_close', 'align="middle"');
  231. $details_button = create_button('details.gif', 'mc_reportedp_details', 'mc_reportedp_details', 'align="middle"');
  232. $ignore_button = create_button('ignore.gif', 'mc_reportedp_ignore', 'mc_reportedp_ignore', 'align="middle"');
  233. $unignore_button = create_button('ignore.gif', 'mc_reportedp_unignore', 'mc_reportedp_unignore', 'align="middle"');
  234. foreach ($context['reports'] as $report)
  235. {
  236. echo '
  237. <div class="', $report['alternate'] ? 'windowbg' : 'windowbg2', '">
  238. <span class="topslice"><span></span></span>
  239. <div class="content">
  240. <div>
  241. <div class="floatleft">
  242. <strong><a href="', $report['topic_href'], '">', $report['subject'], '</a></strong> ', $txt['mc_reportedp_by'], ' <strong>', $report['author']['link'], '</strong>
  243. </div>
  244. <div class="floatright">
  245. <a href="', $report['report_href'], '">', $details_button, '</a>
  246. <a href="', $scripturl, '?action=moderate;area=reports', $context['view_closed'] ? ';sa=closed' : '', ';ignore=', (int) !$report['ignore'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '" ', !$report['ignore'] ? 'onclick="return confirm(\'' . $txt['mc_reportedp_ignore_confirm'] . '\');"' : '', '>', $report['ignore'] ? $unignore_button : $ignore_button, '</a>
  247. <a href="', $scripturl, '?action=moderate;area=reports', $context['view_closed'] ? ';sa=closed' : '', ';close=', (int) !$report['closed'], ';rid=', $report['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '">', $close_button, '</a>
  248. ', !$context['view_closed'] ? '<input type="checkbox" name="close[]" value="' . $report['id'] . '" class="input_check" />' : '', '
  249. </div>
  250. </div><br />
  251. <div class="smalltext">
  252. &#171; ', $txt['mc_reportedp_last_reported'], ': ', $report['last_updated'], ' &#187;<br />';
  253. // Prepare the comments...
  254. $comments = array();
  255. foreach ($report['comments'] as $comment)
  256. $comments[$comment['member']['id']] = $comment['member']['link'];
  257. echo '
  258. &#171; ', $txt['mc_reportedp_reported_by'], ': ', implode(', ', $comments), ' &#187;
  259. </div>
  260. <hr />
  261. ', $report['body'], '
  262. </div>
  263. <span class="botslice"><span></span></span>
  264. </div>';
  265. }
  266. // Were none found?
  267. if (empty($context['reports']))
  268. echo '
  269. <div class="windowbg2">
  270. <span class="topslice"><span></span></span>
  271. <div class="content">
  272. <p class="centertext">', $txt['mc_reportedp_none_found'], '</p>
  273. </div>
  274. <span class="botslice"><span></span></span>
  275. </div>';
  276. echo '
  277. <div class="pagesection">
  278. <div class="floatleft">
  279. ', $txt['pages'], ': ', $context['page_index'], '
  280. </div>
  281. <div class="floatright">
  282. ', !$context['view_closed'] ? '<input type="submit" name="close_selected" value="' . $txt['mc_reportedp_close_selected'] . '" class="button_submit" />' : '', '
  283. </div>
  284. </div>
  285. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  286. </form>
  287. <br class="clear" />';
  288. }
  289. // Show a list of all the unapproved posts
  290. function template_unapproved_posts()
  291. {
  292. global $settings, $options, $context, $txt, $scripturl;
  293. // Just a big table of it all really...
  294. echo '
  295. <div id="modcenter">
  296. <form action="', $scripturl, '?action=moderate;area=postmod;start=', $context['start'], ';sa=', $context['current_view'], '" method="post" accept-charset="', $context['character_set'], '">
  297. <div class="cat_bar">
  298. <h3 class="catbg">', $txt['mc_unapproved_posts'], '</h3>
  299. </div>';
  300. // Make up some buttons
  301. $approve_button = create_button('approve.gif', 'approve', 'approve', 'align="middle"');
  302. $remove_button = create_button('delete.gif', 'remove_message', 'remove', 'align="middle"');
  303. // No posts?
  304. if (empty($context['unapproved_items']))
  305. echo '
  306. <div class="windowbg2">
  307. <span class="topslice"><span></span></span>
  308. <div class="content">
  309. <p class="centertext">', $txt['mc_unapproved_' . $context['current_view'] . '_none_found'], '</p>
  310. </div>
  311. <span class="botslice"><span></span></span>
  312. </div>';
  313. else
  314. echo '
  315. <div class="pagesection">
  316. <div class="pagelinks">', $txt['pages'], ': ', $context['page_index'], '</div>
  317. </div>';
  318. foreach ($context['unapproved_items'] as $item)
  319. {
  320. echo '
  321. <div class="cat_bar">
  322. <h3 class="catbg">
  323. <span class="smalltext floatleft">', $item['counter'], '&nbsp;</span>
  324. <span class="smalltext floatleft"><a href="', $scripturl, '#c', $item['category']['id'], '">', $item['category']['name'], '</a> / <a href="', $scripturl, '?board=', $item['board']['id'], '.0">', $item['board']['name'], '</a> / <a href="', $scripturl, '?topic=', $item['topic']['id'], '.msg', $item['id'], '#msg', $item['id'], '">', $item['subject'], '</a></span>
  325. <span class="smalltext floatright">', $txt['mc_unapproved_by'], ' ', $item['poster']['link'], ' ', $txt['on'], ': ', $item['time'], '</span>
  326. </h3>
  327. </div>
  328. <div class="', $item['alternate'] ? 'windowbg' : 'windowbg2', '">
  329. <span class="topslice"><span></span></span>
  330. <div class="content">
  331. <div class="post">', $item['body'], '</div>
  332. <span class="floatright">
  333. <a href="', $scripturl, '?action=moderate;area=postmod;sa=', $context['current_view'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';approve=', $item['id'], '">', $approve_button, '</a>';
  334. if ($item['can_delete'])
  335. echo '
  336. ', $context['menu_separator'], '
  337. <a href="', $scripturl, '?action=moderate;area=postmod;sa=', $context['current_view'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';delete=', $item['id'], '">', $remove_button, '</a>';
  338. echo '
  339. <input type="checkbox" name="item[]" value="', $item['id'], '" checked="checked" class="input_check" /> ';
  340. echo '
  341. </span>
  342. <br class="clear" />
  343. </div>
  344. <span class="botslice"><span></span></span>
  345. </div>';
  346. }
  347. echo '
  348. <div class="pagesection">
  349. <div class="floatright">
  350. <select name="do" onchange="if (this.value != 0 &amp;&amp; confirm(\'', $txt['mc_unapproved_sure'], '\')) submit();">
  351. <option value="0">', $txt['with_selected'], ':</option>
  352. <option value="0">-------------------</option>
  353. <option value="approve">&nbsp;--&nbsp;', $txt['approve'], '</option>
  354. <option value="delete">&nbsp;--&nbsp;', $txt['delete'], '</option>
  355. </select>
  356. <noscript><input type="submit" name="submit" value="', $txt['go'], '" class="button_submit" /></noscript>
  357. </div>';
  358. if (!empty($context['unapproved_items']))
  359. echo '
  360. <div class="floatleft">
  361. <div class="pagelinks">', $txt['pages'], ': ', $context['page_index'], '</div>
  362. </div>';
  363. echo '
  364. </div>
  365. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  366. </form>
  367. </div>
  368. <br class="clear" />';
  369. }
  370. // List all attachments awaiting approval.
  371. function template_unapproved_attachments()
  372. {
  373. global $settings, $options, $context, $txt, $scripturl;
  374. // Show all the attachments still oustanding.
  375. echo '
  376. <div id="modcenter">
  377. <form action="', $scripturl, '?action=moderate;area=attachmod;sa=attachments;start=', $context['start'], '" method="post" accept-charset="', $context['character_set'], '">
  378. <div class="cat_bar">
  379. <h3 class="catbg">', $txt['mc_unapproved_attachments'], '</h3>
  380. </div>';
  381. // The ever popular approve button, with the massively unpopular delete.
  382. $approve_button = create_button('approve.gif', 'approve', 'approve', 'align="middle"');
  383. $remove_button = create_button('delete.gif', 'remove_message', 'remove', 'align="middle"');
  384. // None awaiting?
  385. if (empty($context['unapproved_items']))
  386. echo '
  387. <div class="windowbg">
  388. <span class="topslice"><span></span></span>
  389. <div class="content">
  390. <p class="centertext">', $txt['mc_unapproved_attachments_none_found'], '</p>
  391. </div>
  392. <span class="botslice"><span></span></span>
  393. </div>';
  394. else
  395. echo '
  396. <div class="pagesection">
  397. <div class="pagelinks">', $txt['pages'], ': ', $context['page_index'], '</div>
  398. </div>
  399. <table class="table_grid" width="100%">
  400. <thead>
  401. <tr class="catbg">
  402. <th>', $txt['mc_unapproved_attach_name'], '</th>
  403. <th>', $txt['mc_unapproved_attach_size'], '</th>
  404. <th>', $txt['mc_unapproved_attach_poster'], '</th>
  405. <th>', $txt['date'], '</th>
  406. <th nowrap="nowrap" align="center"><input type="checkbox" onclick="invertAll(this, this.form);" class="input_check" checked="checked" /></th>
  407. </tr>
  408. </thead>
  409. <tbody>';
  410. foreach ($context['unapproved_items'] as $item)
  411. {
  412. echo '
  413. <tr class="', $item['alternate'] ? 'windowbg' : 'windowbg2', '">
  414. <td>
  415. ', $item['filename'], '
  416. </td>
  417. <td align="right">
  418. ', $item['size'], $txt['kilobyte'], '
  419. </td>
  420. <td>
  421. ', $item['poster']['link'], '
  422. </td>
  423. <td class="smalltext">
  424. ', $item['time'], '<br />', $txt['in'], ' <a href="', $item['message']['href'], '">', $item['message']['subject'], '</a>
  425. </td>
  426. <td width="4%" align="center">
  427. <input type="checkbox" name="item[]" value="', $item['id'], '" checked="checked" class="input_check" />
  428. </td>
  429. </tr>';
  430. }
  431. if (!empty($context['unapproved_items']))
  432. echo '
  433. </tbody>
  434. </table>';
  435. echo '
  436. <div class="pagesection">
  437. <div class="floatright">
  438. <select name="do" onchange="if (this.value != 0 &amp;&amp; confirm(\'', $txt['mc_unapproved_sure'], '\')) submit();">
  439. <option value="0">', $txt['with_selected'], ':</option>
  440. <option value="0">-------------------</option>
  441. <option value="approve">&nbsp;--&nbsp;', $txt['approve'], '</option>
  442. <option value="delete">&nbsp;--&nbsp;', $txt['delete'], '</option>
  443. </select>
  444. <noscript><input type="submit" name="submit" value="', $txt['go'], '" class="button_submit" /></noscript>
  445. </div>';
  446. if (!empty($context['unapproved_items']))
  447. echo '
  448. <div class="floatleft">
  449. <div class="pagelinks">', $txt['pages'], ': ', $context['page_index'], '</div>
  450. </div>';
  451. echo '
  452. </div>
  453. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  454. </form>
  455. </div>
  456. <br class="clear" />';
  457. }
  458. function template_viewmodreport()
  459. {
  460. global $context, $scripturl, $txt;
  461. echo '
  462. <div id="modcenter">
  463. <form action="', $scripturl, '?action=moderate;area=reports;report=', $context['report']['id'], '" method="post" accept-charset="', $context['character_set'], '">
  464. <div class="cat_bar">
  465. <h3 class="catbg">
  466. ', sprintf($txt['mc_viewmodreport'], $context['report']['message_link'], $context['report']['author']['link']), '
  467. </h3>
  468. </div>
  469. <div class="title_bar">
  470. <h3 class="titlebg">
  471. <span class="floatleft">
  472. ', sprintf($txt['mc_modreport_summary'], $context['report']['num_reports'], $context['report']['last_updated']), '
  473. </span>
  474. <span class="floatright">';
  475. // Make the buttons.
  476. $close_button = create_button('close.gif', $context['report']['closed'] ? 'mc_reportedp_open' : 'mc_reportedp_close', $context['report']['closed'] ? 'mc_reportedp_open' : 'mc_reportedp_close', 'align="middle"');
  477. $ignore_button = create_button('ignore.gif', 'mc_reportedp_ignore', 'mc_reportedp_ignore', 'align="middle"');
  478. $unignore_button = create_button('ignore.gif', 'mc_reportedp_unignore', 'mc_reportedp_unignore', 'align="middle"');
  479. echo '
  480. <a href="', $scripturl, '?action=moderate;area=reports;ignore=', (int) !$context['report']['ignore'], ';rid=', $context['report']['id'], ';', $context['session_var'], '=', $context['session_id'], '" ', !$context['report']['ignore'] ? 'onclick="return confirm(\'' . $txt['mc_reportedp_ignore_confirm'] . '\');"' : '', '>', $context['report']['ignore'] ? $unignore_button : $ignore_button, '</a>
  481. <a href="', $scripturl, '?action=moderate;area=reports;close=', (int) !$context['report']['closed'], ';rid=', $context['report']['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $close_button, '</a>
  482. </span>
  483. </h3>
  484. </div>
  485. <div class="windowbg2">
  486. <span class="topslice"><span></span></span>
  487. <div class="content">
  488. ', $context['report']['body'], '
  489. </div>
  490. <span class="botslice"><span></span></span>
  491. </div>
  492. <br />
  493. <div class="cat_bar">
  494. <h3 class="catbg">', $txt['mc_modreport_whoreported_title'], '</h3>
  495. </div>';
  496. foreach ($context['report']['comments'] as $comment)
  497. echo '
  498. <div class="windowbg">
  499. <span class="topslice"><span></span></span>
  500. <div class="content">
  501. <p class="smalltext">', sprintf($txt['mc_modreport_whoreported_data'], $comment['member']['link'] . (empty($comment['member']['id']) && !empty($comment['member']['ip']) ? ' (' . $comment['member']['ip'] . ')' : ''), $comment['time']), '</p>
  502. <p>', $comment['message'], '</p>
  503. </div>
  504. <span class="botslice"><span></span></span>
  505. </div>';
  506. echo '
  507. <br />
  508. <div class="cat_bar">
  509. <h3 class="catbg">', $txt['mc_modreport_mod_comments'], '</h3>
  510. </div>
  511. <div class="windowbg2">
  512. <span class="topslice"><span></span></span>
  513. <div class="content">';
  514. if (empty($context['report']['mod_comments']))
  515. echo '
  516. <p class="centertext">', $txt['mc_modreport_no_mod_comment'], '</p>';
  517. foreach ($context['report']['mod_comments'] as $comment)
  518. echo
  519. '<p>', $comment['member']['link'], ': ', $comment['message'], ' <em class="smalltext">(', $comment['time'], ')</em></p>';
  520. echo '
  521. <textarea rows="2" cols="60" style="' . ($context['browser']['is_ie8'] ? 'width: 635px; max-width: 60%; min-width: 60%' : 'width: 60%') . ';" name="mod_comment"></textarea>
  522. <div>
  523. <input type="submit" name="add_comment" value="', $txt['mc_modreport_add_mod_comment'], '" class="button_submit" />
  524. </div>
  525. </div>
  526. <span class="botslice"><span></span></span>
  527. </div>
  528. <br />';
  529. $alt = false;
  530. template_show_list('moderation_actions_list');
  531. if (!empty($context['entries']))
  532. {
  533. echo '
  534. <div class="cat_bar">
  535. <h3 class="catbg">', $txt['mc_modreport_modactions'], '</h3>
  536. </div>
  537. <table width="100%" class="table_grid">
  538. <thead>
  539. <tr class="catbg">
  540. <th>', $txt['modlog_action'], '</th>
  541. <th>', $txt['modlog_date'], '</th>
  542. <th>', $txt['modlog_member'], '</th>
  543. <th>', $txt['modlog_position'], '</th>
  544. <th>', $txt['modlog_ip'], '</th>
  545. </tr>
  546. </thead>
  547. <tbody>';
  548. foreach ($context['entries'] as $entry)
  549. {
  550. echo '
  551. <tr class="', $alt ? 'windowbg2' : 'windowbg', '">
  552. <td>', $entry['action'], '</td>
  553. <td>', $entry['time'], '</td>
  554. <td>', $entry['moderator']['link'], '</td>
  555. <td>', $entry['position'], '</td>
  556. <td>', $entry['ip'], '</td>
  557. </tr>
  558. <tr>
  559. <td colspan="5" class="', $alt ? 'windowbg2' : 'windowbg', '">';
  560. foreach ($entry['extra'] as $key => $value)
  561. echo '
  562. <em>', $key, '</em>: ', $value;
  563. echo '
  564. </td>
  565. </tr>';
  566. }
  567. echo '
  568. </tbody>
  569. </table>';
  570. }
  571. echo '
  572. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  573. </form>
  574. </div>
  575. <br class="clear" />';
  576. }
  577. // Callback function for showing a watched users post in the table.
  578. function template_user_watch_post_callback($post)
  579. {
  580. global $scripturl, $context, $txt, $delete_button;
  581. // We'll have a delete please bob.
  582. if (empty($delete_button))
  583. $delete_button = create_button('delete.gif', 'remove_message', 'remove', 'align="middle"');
  584. $output_html = '
  585. <div>
  586. <div class="floatleft">
  587. <strong><a href="' . $scripturl . '?topic=' . $post['id_topic'] . '.' . $post['id'] . '#msg' . $post['id'] . '">' . $post['subject'] . '</a></strong> ' . $txt['mc_reportedp_by'] . ' <strong>' . $post['author_link'] . '</strong>
  588. </div>
  589. <div class="floatright">';
  590. if ($post['can_delete'])
  591. $output_html .= '
  592. <a href="' . $scripturl . '?action=moderate;area=userwatch;sa=post;delete=' . $post['id'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" onclick="return confirm(\'' . $txt['mc_watched_users_delete_post'] . '\');">' . $delete_button . '</a>
  593. <input type="checkbox" name="delete[]" value="' . $post['id'] . '" class="input_check" />';
  594. $output_html .= '
  595. </div>
  596. </div><br />
  597. <div class="smalltext">
  598. &#171; ' . $txt['mc_watched_users_posted'] . ': ' . $post['poster_time'] . ' &#187;
  599. </div>
  600. <hr />
  601. ' . $post['body'];
  602. return $output_html;
  603. }
  604. // Moderation settings
  605. function template_moderation_settings()
  606. {
  607. global $settings, $options, $context, $txt, $scripturl;
  608. echo '
  609. <div id="modcenter">
  610. <form action="', $scripturl, '?action=moderate;area=settings" method="post" accept-charset="', $context['character_set'], '">
  611. <div class="cat_bar">
  612. <h3 class="catbg">', $txt['mc_prefs_title'], '</h3>
  613. </div>
  614. <div class="information">
  615. ', $txt['mc_prefs_desc'], '
  616. </div>
  617. <div class="windowbg2">
  618. <span class="topslice"><span></span></span>
  619. <div class="content">
  620. <dl class="settings">
  621. <dt>
  622. <strong>', $txt['mc_prefs_homepage'], ':</strong>
  623. </dt>
  624. <dd>';
  625. foreach ($context['homepage_blocks'] as $k => $v)
  626. echo '
  627. <label for="mod_homepage_', $k, '"><input type="checkbox" id="mod_homepage_', $k, '" name="mod_homepage[', $k, ']"', in_array($k, $context['mod_settings']['user_blocks']) ? ' checked="checked"' : '', ' class="input_check" /> ', $v, '</label><br />';
  628. echo '
  629. </dd>';
  630. // If they can moderate boards they have more options!
  631. if ($context['can_moderate_boards'])
  632. {
  633. echo '
  634. <dt>
  635. <strong><label for="mod_show_reports">', $txt['mc_prefs_show_reports'], '</label>:</strong>
  636. </dt>
  637. <dd>
  638. <input type="checkbox" id="mod_show_reports" name="mod_show_reports" ', $context['mod_settings']['show_reports'] ? 'checked="checked"' : '', ' class="input_check" />
  639. </dd>
  640. <dt>
  641. <strong><label for="mod_notify_report">', $txt['mc_prefs_notify_report'], '</label>:</strong>
  642. </dt>
  643. <dd>
  644. <select id="mod_notify_report" name="mod_notify_report">
  645. <option value="0" ', $context['mod_settings']['notify_report'] == 0 ? 'selected="selected"' : '', '>', $txt['mc_prefs_notify_report_never'], '</option>
  646. <option value="1" ', $context['mod_settings']['notify_report'] == 1 ? 'selected="selected"' : '', '>', $txt['mc_prefs_notify_report_moderator'], '</option>
  647. <option value="2" ', $context['mod_settings']['notify_report'] == 2 ? 'selected="selected"' : '', '>', $txt['mc_prefs_notify_report_always'], '</option>
  648. </select>
  649. </dd>';
  650. }
  651. if ($context['can_moderate_approvals'])
  652. {
  653. echo '
  654. <dt>
  655. <strong><label for="mod_notify_approval">', $txt['mc_prefs_notify_approval'], '</label>:</strong>
  656. </dt>
  657. <dd>
  658. <input type="checkbox" id="mod_notify_approval" name="mod_notify_approval" ', $context['mod_settings']['notify_approval'] ? 'checked="checked"' : '', ' class="input_check" />
  659. </dd>';
  660. }
  661. echo '
  662. </dl>
  663. <div class="righttext">
  664. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  665. <input type="hidden" name="', $context['mod-set_token_var'], '" value="', $context['mod-set_token'], '" />
  666. <input type="submit" name="save" value="', $txt['save'], '" class="button_submit" />
  667. </div>
  668. </div>
  669. <span class="botslice"><span></span></span>
  670. </div>
  671. </form>
  672. </div>
  673. <br class="clear" />';
  674. }
  675. // Show a notice sent to a user.
  676. function template_show_notice()
  677. {
  678. global $txt, $settings, $options, $context;
  679. // We do all the HTML for this one!
  680. echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  681. <html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '>
  682. <head>
  683. <meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
  684. <title>', $context['page_title'], '</title>
  685. <link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/index.css" />
  686. </head>
  687. <body>
  688. <div class="cat_bar">
  689. <h3 class="catbg">', $txt['show_notice'], '</h3>
  690. </div>
  691. <div class="title_bar">
  692. <h3 class="titlebg">', $txt['show_notice_subject'], ': ', $context['notice_subject'], '</h3>
  693. </div>
  694. <div class="windowbg">
  695. <span class="topslice"><span></span></span>
  696. <div class="content">
  697. <dl>
  698. <dt>
  699. <strong>', $txt['show_notice_text'], ':</strong>
  700. </dt>
  701. <dd>
  702. ', $context['notice_body'], '
  703. </dd>
  704. </dl>
  705. </div>
  706. <span class="botslice"><span></span></span>
  707. </div>
  708. </body>
  709. </html>';
  710. }
  711. // Add or edit a warning template.
  712. function template_warn_template()
  713. {
  714. global $context, $settings, $options, $txt, $scripturl;
  715. echo '
  716. <div id="modcenter">
  717. <form action="', $scripturl, '?action=moderate;area=warnings;sa=templateedit;tid=', $context['id_template'], '" method="post" accept-charset="', $context['character_set'], '">
  718. <div class="cat_bar">
  719. <h3 class="catbg">', $context['page_title'], '</h3>
  720. </div>
  721. <div class="information">
  722. ', $txt['mc_warning_template_desc'], '
  723. </div>
  724. <div class="windowbg">
  725. <span class="topslice"><span></span></span>
  726. <div class="content">
  727. <dl class="settings">
  728. <dt>
  729. <strong><label for="template_title">', $txt['mc_warning_template_title'], '</label>:</strong>
  730. </dt>
  731. <dd>
  732. <input type="text" id="template_title" name="template_title" value="', $context['template_data']['title'], '" size="30" class="input_text" />
  733. </dd>
  734. <dt>
  735. <strong><label for="template_body">', $txt['profile_warning_notify_body'], '</label>:</strong><br />
  736. <span class="smalltext">', $txt['mc_warning_template_body_desc'], '</span>
  737. </dt>
  738. <dd>
  739. <textarea id="template_body" name="template_body" rows="10" cols="45" class="smalltext">', $context['template_data']['body'], '</textarea>
  740. </dd>
  741. </dl>';
  742. if ($context['template_data']['can_edit_personal'])
  743. echo '
  744. <input type="checkbox" name="make_personal" id="make_personal" ', $context['template_data']['personal'] ? 'checked="checked"' : '', ' class="input_check" />
  745. <label for="make_personal">
  746. <strong>', $txt['mc_warning_template_personal'], '</strong>
  747. </label>
  748. <br />
  749. <span class="smalltext">', $txt['mc_warning_template_personal_desc'], '</span>
  750. <br />';
  751. echo '
  752. <input type="submit" name="save" value="', $context['page_title'], '" class="button_submit" />
  753. </div>
  754. <span class="botslice"><span></span></span>
  755. </div>
  756. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  757. <input type="hidden" name="', $context['mod-wt_token_var'], '" value="', $context['mod-wt_token'], '" />
  758. </form>
  759. </div>
  760. <br class="clear" />';
  761. }
  762. ?>