index.php 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * These files are a complete rework of the forum. The database structure is
  5. * based on phpBB but all the code is rewritten. A lot of new functionalities
  6. * are added:
  7. * - forum categories and forums can be sorted up or down, locked or made invisible
  8. * - consistent and integrated forum administration
  9. * - forum options: are students allowed to edit their post?
  10. * moderation of posts (approval)
  11. * reply only forums (students cannot create new threads)
  12. * multiple forums per group
  13. * - sticky messages
  14. * - new view option: nested view
  15. * - quoting a message
  16. *
  17. * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
  18. * @copyright Ghent University
  19. * @copyright Patrick Cool
  20. *
  21. * @package chamilo.forum
  22. */
  23. use ChamiloSession as Session;
  24. // Including the global initialization file.
  25. require_once '../inc/global.inc.php';
  26. $current_course_tool = TOOL_FORUM;
  27. $htmlHeadXtra[] = '<script>
  28. $(document).ready(function() {
  29. $(\'.hide-me\').slideUp();
  30. });
  31. function hidecontent(content){
  32. $(content).slideToggle(\'normal\');
  33. }
  34. </script>';
  35. // The section (tabs).
  36. $this_section = SECTION_COURSES;
  37. // Notification for unauthorized people.
  38. api_protect_course_script(true);
  39. $nameTools = get_lang('Forums');
  40. $_course = api_get_course_info();
  41. $sessionId = api_get_session_id();
  42. $_user = api_get_user_info();
  43. // Including necessary files.
  44. require_once 'forumconfig.inc.php';
  45. require_once 'forumfunction.inc.php';
  46. if (!empty($_GET['gradebook']) && $_GET['gradebook'] == 'view') {
  47. $_SESSION['gradebook'] = Security::remove_XSS($_GET['gradebook']);
  48. $gradebook = $_SESSION['gradebook'];
  49. } elseif (empty($_GET['gradebook'])) {
  50. unset($_SESSION['gradebook']);
  51. $gradebook = '';
  52. }
  53. if (!empty($gradebook) && $gradebook == 'view') {
  54. $interbreadcrumb[] = array(
  55. 'url' => '../gradebook/' . $_SESSION['gradebook_dest'],
  56. 'name' => get_lang('ToolGradebook'),
  57. );
  58. }
  59. $search_forum = isset($_GET['search']) ? Security::remove_XSS($_GET['search']) : '';
  60. /* ACTIONS */
  61. $actions = isset($_GET['action']) ? $_GET['action'] : '';
  62. if ($actions == 'add') {
  63. switch ($_GET['content']) {
  64. case 'forum':
  65. $interbreadcrumb[] = array(
  66. 'url' => 'index.php?search=' . $search_forum . '&' . api_get_cidreq(),
  67. 'name' => get_lang('Forum'),
  68. );
  69. $interbreadcrumb[] = array(
  70. 'url' => '#',
  71. 'name' => get_lang('AddForum'),
  72. );
  73. break;
  74. case 'forumcategory':
  75. $interbreadcrumb[] = array(
  76. 'url' => 'index.php?search=' . $search_forum . '&' . api_get_cidreq(),
  77. 'name' => get_lang('Forum'),
  78. );
  79. $interbreadcrumb[] = array(
  80. 'url' => '#',
  81. 'name' => get_lang('AddForumCategory'),
  82. );
  83. break;
  84. default:
  85. break;
  86. }
  87. } else {
  88. $interbreadcrumb[] = array(
  89. 'url' => '#',
  90. 'name' => get_lang('ForumCategories'),
  91. );
  92. }
  93. Display::display_header('');
  94. // Tool introduction
  95. Display::display_introduction_section(TOOL_FORUM);
  96. $form_count = 0;
  97. if (api_is_allowed_to_edit(false, true)) {
  98. //if is called from a learning path lp_id
  99. $lp_id = isset($_REQUEST['lp_id']) ? intval($_REQUEST['lp_id']) : null;
  100. handle_forum_and_forumcategories($lp_id);
  101. }
  102. // Notification
  103. if ($actions == 'notify' && isset($_GET['content']) && isset($_GET['id'])) {
  104. if (
  105. api_get_session_id() != 0 &&
  106. api_is_allowed_to_session_edit(false, true) == false
  107. ) {
  108. api_not_allowed();
  109. }
  110. $return_message = set_notification($_GET['content'], $_GET['id']);
  111. Display:: display_confirmation_message($return_message, false);
  112. }
  113. get_whats_new();
  114. $whatsnew_post_info = Session::read('whatsnew_post_info');
  115. /* TRACKING */
  116. Event::event_access_tool(TOOL_FORUM);
  117. /*
  118. RETRIEVING ALL THE FORUM CATEGORIES AND FORUMS
  119. note: we do this here just after het handling of the actions to be
  120. sure that we already incorporate the latest changes
  121. */
  122. // Step 1: We store all the forum categories in an array $forum_categories.
  123. $forumCategories = get_forum_categories();
  124. // Step 2: We find all the forums (only the visible ones if it is a student).
  125. // display group forum in general forum tool depending to configuration option
  126. $setting = api_get_setting('display_groups_forum_in_general_tool');
  127. $forum_list = get_forums('', '', $setting == 'true');
  128. $user_id = api_get_user_id();
  129. /* RETRIEVING ALL GROUPS AND THOSE OF THE USER */
  130. // The groups of the user.
  131. $groups_of_user = array();
  132. $groups_of_user = GroupManager::get_group_ids($_course['real_id'], $user_id);
  133. // All groups in the course (and sorting them as the
  134. // id of the group = the key of the array).
  135. if (!api_is_anonymous()) {
  136. $all_groups = GroupManager::get_group_list();
  137. if (is_array($all_groups)) {
  138. foreach ($all_groups as $group) {
  139. $all_groups[$group['id']] = $group;
  140. }
  141. }
  142. }
  143. /* ACTION LINKS */
  144. echo '<div class="actions">';
  145. //if is called from learning path
  146. if (!empty($_GET['lp_id']) || !empty($_POST['lp_id'])) {
  147. echo "<a href=\"../newscorm/lp_controller.php?"
  148. . api_get_cidreq()
  149. . "&gradebook=&action=add_item&type=step&lp_id=$lp_id#resource_tab-5\">"
  150. . Display::return_icon(
  151. 'back.png',
  152. get_lang("BackTo") . ' ' . get_lang("LearningPaths"),
  153. '',
  154. ICON_SIZE_MEDIUM
  155. )
  156. . "</a>";
  157. }
  158. if (!empty($forum_list)) {
  159. echo search_link();
  160. }
  161. if (api_is_allowed_to_edit(false, true)) {
  162. echo '<a href="'
  163. . api_get_self() . '?' . api_get_cidreq()
  164. . '&action=add&content=forumcategory&lp_id=' . $lp_id . '"> ' .
  165. Display::return_icon(
  166. 'new_folder.png', get_lang('AddForumCategory'), '', ICON_SIZE_MEDIUM
  167. )
  168. . '</a>';
  169. if (is_array($forumCategories) and !empty($forumCategories)) {
  170. echo '<a href="'.api_get_self().'?'.api_get_cidreq(
  171. ).'&action=add&content=forum&lp_id='.$lp_id.'"> '.
  172. Display::return_icon(
  173. 'new_forum.png',
  174. get_lang('AddForum'),
  175. '',
  176. ICON_SIZE_MEDIUM
  177. ).'</a>';
  178. }
  179. }
  180. echo '</div>';
  181. // Fixes error if there forums with no category.
  182. $forumsInNoCategory = get_forums_in_category(0);
  183. if (!empty($forumsInNoCategory)) {
  184. $forumCategories = array_merge(
  185. $forumCategories,
  186. array(
  187. array(
  188. 'cat_id' => 0,
  189. 'session_id' => 0,
  190. 'visibility' => 1,
  191. 'cat_comment' => null,
  192. ),
  193. )
  194. );
  195. }
  196. /* Display Forum Categories and the Forums in it */
  197. // Step 3: We display the forum_categories first.
  198. if (is_array($forumCategories)) {
  199. foreach ($forumCategories as $forumCategory) {
  200. // The forums in this category.
  201. $forumsInCategory = get_forums_in_category($forumCategory['cat_id']);
  202. // Validation when belongs to a session.
  203. $session_img = api_get_session_image(
  204. $forumCategory['session_id'],
  205. $_user['status']
  206. );
  207. if (empty($sessionId) && !empty($forumCategory['session_name'])) {
  208. $session_displayed = ' (' . Security::remove_XSS($forumCategory['session_name']) . ')';
  209. } else {
  210. $session_displayed = '';
  211. }
  212. if (empty($forumCategory['cat_title'])) {
  213. $forumCategory['cat_title'] = get_lang('WithoutCategory');
  214. }
  215. $html = '';
  216. $iconsEdit = '';
  217. $idCategory = $forumCategory['cat_id'];
  218. $urlCategory = 'viewforumcategory.php?' . api_get_cidreq() . '&forumcategory=' . intval($idCategory);
  219. $titleCategory = Display::tag(
  220. 'a',
  221. $forumCategory['cat_title'],
  222. array(
  223. 'href' => $urlCategory,
  224. 'class' => return_visible_invisible($forumCategory['visibility'])
  225. )
  226. );
  227. $descriptionCategory = $forumCategory['cat_comment'];
  228. if (!empty($idCategory)) {
  229. if (
  230. api_is_allowed_to_edit(false, true) &&
  231. !($forumCategory['session_id'] == 0 &&
  232. intval($sessionId) != 0)
  233. ) {
  234. $iconsEdit .= '<a href="' . api_get_self() . '?' . api_get_cidreq()
  235. . '&action=edit&content=forumcategory&id=' . intval($idCategory)
  236. . '">' . Display::return_icon(
  237. 'edit.png',
  238. get_lang('Edit'),
  239. array(),
  240. ICON_SIZE_SMALL
  241. )
  242. . '</a>';
  243. $iconsEdit .='<a href="' . api_get_self() . '?' . api_get_cidreq()
  244. . '&action=delete&content=forumcategory&id=' . intval($idCategory)
  245. . "\" onclick=\"javascript:if(!confirm('"
  246. . addslashes(api_htmlentities(
  247. get_lang('DeleteForumCategory'),
  248. ENT_QUOTES
  249. ))
  250. . "')) return false;\">"
  251. . Display::return_icon(
  252. 'delete.png',
  253. get_lang('Delete'),
  254. array(),
  255. ICON_SIZE_SMALL
  256. )
  257. . '</a>';
  258. $iconsEdit .= return_visible_invisible_icon(
  259. 'forumcategory',
  260. strval(intval($idCategory)),
  261. strval(intval($forumCategory['visibility']))
  262. );
  263. $iconsEdit .= return_lock_unlock_icon(
  264. 'forumcategory',
  265. strval(intval($idCategory)),
  266. strval(intval($forumCategory['locked']))
  267. );
  268. $iconsEdit .= return_up_down_icon(
  269. 'forumcategory',
  270. strval(intval($idCategory)),
  271. $forumCategories
  272. );
  273. }
  274. }
  275. $html .= '<div class="category-forum">';
  276. $html .= Display::tag(
  277. 'div',
  278. $iconsEdit,
  279. array(
  280. 'class' => 'pull-right'
  281. )
  282. );
  283. $icoCategory = Display::return_icon(
  284. 'forum_blue.png',
  285. get_lang(
  286. $forumCategory['cat_title']
  287. ),
  288. array(),
  289. ICON_SIZE_MEDIUM
  290. );
  291. $html .= '<h3>' . $icoCategory . $titleCategory . '</h3>';
  292. if ($descriptionCategory != '' && trim($descriptionCategory) != '&nbsp;') {
  293. $html .= '<div class="forum-description">'.$descriptionCategory.'</div>';
  294. }
  295. $html .= '</div>';
  296. echo $html;
  297. echo '<div class="forum_display">';
  298. if (!empty($forumsInCategory)) {
  299. // Step 4: The interim headers (for the forum).
  300. /* echo '<tr class="forum_header">';
  301. echo '<td></td>';
  302. echo '<td>'.get_lang('Forum').'</td>';
  303. echo '<td>'.get_lang('Topics').'</td>';
  304. echo '<td>'.get_lang('Posts').'</td>';
  305. echo '<td>'.get_lang('LastPosts').'</td>';
  306. echo '<td>'.get_lang('Actions').'</td>';
  307. echo '</tr>'; */
  308. // Step 5: We display all the forums in this category.
  309. foreach ($forum_list as $forum) {
  310. // Here we clean the whatnew_post_info array a little bit because to display the icon we
  311. // test if $whatsnew_post_info[$forum['forum_id']] is empty or not.
  312. if (isset($forum['forum_id'])) {
  313. if (!empty($whatsnew_post_info)) {
  314. if (
  315. isset($whatsnew_post_info[$forum['forum_id']]) &&
  316. is_array($whatsnew_post_info[$forum['forum_id']])
  317. ) {
  318. foreach ($whatsnew_post_info[$forum['forum_id']] as $key_thread_id => $new_post_array) {
  319. if (empty($whatsnew_post_info[$forum['forum_id']][$key_thread_id])) {
  320. unset($whatsnew_post_info[$forum['forum_id']][$key_thread_id]);
  321. unset($_SESSION['whatsnew_post_info'][$forum['forum_id']][$key_thread_id]);
  322. }
  323. }
  324. }
  325. }
  326. }
  327. // Note: This can be speed up if we transform the $forum_list
  328. // to an array that uses the forum_category as the key.
  329. if (
  330. isset($forum['forum_category']) &&
  331. $forum['forum_category'] == $forumCategory['cat_id']
  332. ) {
  333. $show_forum = false;
  334. // SHOULD WE SHOW THIS PARTICULAR FORUM
  335. // you are teacher => show forum
  336. if (api_is_allowed_to_edit(false, true)) {
  337. $show_forum = true;
  338. } else {
  339. // you are not a teacher
  340. // it is not a group forum => show forum
  341. // (invisible forums are already left out see get_forums function)
  342. if ($forum['forum_of_group'] == '0') {
  343. $show_forum = true;
  344. } else {
  345. $show_forum = GroupManager::user_has_access(
  346. $user_id,
  347. $forum['forum_of_group'],
  348. GroupManager::GROUP_TOOL_FORUM
  349. );
  350. }
  351. }
  352. if ($show_forum) {
  353. $form_count++;
  354. $mywhatsnew_post_info = isset($whatsnew_post_info[$forum['forum_id']]) ?
  355. $whatsnew_post_info[$forum['forum_id']] : null;
  356. $html = '<div class="panel panel-default forum">';
  357. $html .= '<div class="panel-body">';
  358. $forum_image = '';
  359. $imgForum = '';
  360. // Showing the image
  361. if (!empty($forum['forum_image'])) {
  362. $image_path = api_get_path(WEB_COURSE_PATH)
  363. . api_get_course_path()
  364. . '/upload/forum/images/'
  365. . $forum['forum_image'];
  366. $image_size = api_getimagesize($image_path);
  367. $img_attributes = '';
  368. if (!empty($image_size)) {
  369. //limit display width and height to 100px
  370. $img_attributes = ' style="width:80px" height="80px"';
  371. $imgForum = "<img src=\"$image_path\" $img_attributes>";
  372. } else {
  373. $imgForum = '';
  374. }
  375. $forum_image = $imgForum;
  376. } else {
  377. if ($forum['forum_of_group'] == '0') {
  378. $forum_image = Display::return_icon(
  379. 'forum_group.png',
  380. get_lang('GroupForum'),
  381. null,
  382. ICON_SIZE_LARGE
  383. );
  384. } else {
  385. $forum_image = Display::return_icon(
  386. 'forum.png',
  387. get_lang('Forum'),
  388. null,
  389. ICON_SIZE_LARGE
  390. );
  391. }
  392. }
  393. // Validation when belongs to a session
  394. $session_img = api_get_session_image(
  395. $forum['session_id'],
  396. $_user['status']
  397. );
  398. if ($forum['forum_of_group'] != '0') {
  399. $my_all_groups_forum_name = isset($all_groups[$forum['forum_of_group']]['name']) ?
  400. $all_groups[$forum['forum_of_group']]['name'] : null;
  401. $my_all_groups_forum_id = isset($all_groups[$forum['forum_of_group']]['id']) ?
  402. $all_groups[$forum['forum_of_group']]['id'] : null;
  403. $group_title = api_substr(
  404. $my_all_groups_forum_name,
  405. 0,
  406. 30
  407. );
  408. $forum_title_group_addition = ' (<a href="../group/group_space.php?'
  409. . api_get_cidreq() . '&gidReq=' . $forum['forum_of_group']
  410. . '" class="forum_group_link">' . get_lang('GoTo') . ' ' . $group_title . '</a>)'
  411. . $session_img;
  412. } else {
  413. $forum_title_group_addition = '';
  414. }
  415. if (empty($sessionId) && !empty($forum['session_name'])) {
  416. $session_displayed = ' (' . $forum['session_name'] . ')';
  417. } else {
  418. $session_displayed = '';
  419. }
  420. $forum['forum_of_group'] == 0 ? $groupid = '' : $groupid = $forum['forum_of_group'];
  421. $number_threads = isset($forum['number_of_threads']) ? $forum['number_of_threads'] : 0;
  422. $number_posts = isset($forum['number_of_posts']) ? $forum['number_of_posts'] : 0;
  423. $html .= '<div class="row">';
  424. $html .= '<div class="col-md-6">';
  425. $html .= '<div class="col-md-3">';
  426. $html .= '<div class="number-post">'.$forum_image.'<p>'.$number_posts.' ' . get_lang('Posts') . '</p>'
  427. . '</div>';
  428. $html .= '</div>';
  429. $html .= '<div class="col-md-9">';
  430. $iconForum = Display::return_icon(
  431. 'forum_yellow.png',
  432. get_lang($forumCategory['cat_title']),
  433. null,
  434. ICON_SIZE_MEDIUM
  435. );
  436. $linkForum = '';
  437. $linkForum .= Display::tag(
  438. 'a',
  439. $forum['forum_title'],
  440. array (
  441. 'href' => 'viewforum.php?' . api_get_cidreq()
  442. . '&gidReq=' . intval($groupid)
  443. . '&forum=' . intval($forum['forum_id']),
  444. 'class' => return_visible_invisible( strval( intval($forum['visibility']) ) )
  445. )
  446. );
  447. $html .= '<h3 class="title">' . $iconForum . $linkForum . '</h3>';
  448. $html .= Display::tag(
  449. 'p',
  450. strip_tags($forum['forum_comment']),
  451. array(
  452. 'class'=>'description'
  453. )
  454. );
  455. $html .= '</div>';
  456. $html .= '</div>';
  457. $iconEmpty='';
  458. // The number of topics and posts.
  459. if ($forum['forum_of_group'] !== '0') {
  460. $newPost='';
  461. if (is_array($mywhatsnew_post_info) && !empty($mywhatsnew_post_info)) {
  462. $newPost = ' ' . Display::return_icon(
  463. 'alert.png',
  464. get_lang('Forum'),
  465. null,
  466. ICON_SIZE_SMALL
  467. );
  468. } else {
  469. $newPost = $iconEmpty;
  470. }
  471. } else {
  472. if (is_array($mywhatsnew_post_info) && !empty($mywhatsnew_post_info)) {
  473. $newPost = ' ' . Display::return_icon(
  474. 'alert.png',
  475. get_lang('Forum'),
  476. null,
  477. ICON_SIZE_SMALL
  478. );
  479. } else {
  480. $newPost = $iconEmpty;
  481. }
  482. }
  483. $html .= '<div class="col-md-6">';
  484. $html .= '<div class="row">';
  485. $html .= '<div class="col-md-2">';
  486. $html .= Display::return_icon(
  487. 'post-forum.png',
  488. get_lang('Forum'),
  489. null,
  490. ICON_SIZE_SMALL
  491. );
  492. $html .= ' ' . $number_threads . '<br>'.$newPost.'</div>';
  493. $html .= '<div class="col-md-6">';
  494. // The last post in the forum.
  495. if ($forum['last_poster_name'] != '') {
  496. $name = $forum['last_poster_name'];
  497. $poster_id = 0;
  498. $username = "";
  499. } else {
  500. $name = api_get_person_name(
  501. $forum['last_poster_firstname'],
  502. $forum['last_poster_lastname']
  503. );
  504. $poster_id = $forum['last_poster_id'];
  505. $userinfo = api_get_user_info($poster_id);
  506. $username = sprintf(
  507. get_lang('LoginX'),
  508. $userinfo['username']
  509. );
  510. }
  511. if (!empty($forum['last_post_id'])) {
  512. $html .= Display::return_icon(
  513. 'post-item.png',
  514. null,
  515. null,
  516. ICON_SIZE_TINY
  517. )
  518. . ' ' .
  519. api_convert_and_format_date($forum['last_post_date'])
  520. . '<br /> ' . get_lang('By') . ' ' .
  521. display_user_link(
  522. $poster_id,
  523. $name,
  524. '',
  525. $username
  526. );
  527. }
  528. $html .= '</div>';
  529. $html .= '<div class="col-md-4">';
  530. if (
  531. api_is_allowed_to_edit(false, true) &&
  532. !($forum['session_id'] == 0 && intval($sessionId) != 0)
  533. ) {
  534. $html .= '<a href="'.api_get_self() . '?' . api_get_cidreq()
  535. . '&action=edit&content=forum&id=' . $forum['forum_id'] . '">'
  536. . Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL)
  537. . '</a>';
  538. $html .= '<a href="' . api_get_self() . '?' . api_get_cidreq()
  539. . '&action=delete&content=forum&id=' . $forum['forum_id']
  540. . "\" onclick=\"javascript:if(!confirm('" . addslashes(
  541. api_htmlentities(get_lang('DeleteForum'), ENT_QUOTES)
  542. )
  543. . "')) return false;\">"
  544. . Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL)
  545. . '</a>';
  546. $html .= return_visible_invisible_icon(
  547. 'forum',
  548. $forum['forum_id'],
  549. $forum['visibility']
  550. );
  551. $html .= return_lock_unlock_icon(
  552. 'forum',
  553. $forum['forum_id'],
  554. $forum['locked']
  555. );
  556. $html .= return_up_down_icon(
  557. 'forum',
  558. $forum['forum_id'],
  559. $forumsInCategory
  560. );
  561. }
  562. $iconnotify = 'notification_mail_na.png';
  563. $session_forum_notification = isset($_SESSION['forum_notification']['forum']) ?
  564. $_SESSION['forum_notification']['forum'] : false;
  565. if (is_array($session_forum_notification)) {
  566. if (in_array(
  567. $forum['forum_id'],
  568. $session_forum_notification
  569. )) {
  570. $iconnotify = 'notification_mail.png';
  571. }
  572. }
  573. if (
  574. !api_is_anonymous() &&
  575. api_is_allowed_to_session_edit(false, true)
  576. ) {
  577. $html .= '<a href="' . api_get_self() . '?' . api_get_cidreq()
  578. . '&action=notify&content=forum&id=' . $forum['forum_id'] . '">'
  579. . Display::return_icon($iconnotify, get_lang('NotifyMe'), null, ICON_SIZE_SMALL)
  580. . '</a>';
  581. }
  582. $html .= '</div>';
  583. $html .= '</div>';
  584. $html .= '</div>';
  585. $html .= '</div>';
  586. $html .= '</div>';
  587. $html .= '</div>';
  588. }
  589. echo $html;
  590. }
  591. }
  592. } else {
  593. echo '<div class="alert alert-warning">' . get_lang('NoForumInThisCategory') . '</div>'
  594. . (api_is_allowed_to_edit(false, true) ? '<div>' : '</div>')
  595. . '</div>';
  596. }
  597. echo '</div>';
  598. }
  599. }
  600. Display:: display_footer();