index.php 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. use ChamiloSession as Session;
  4. use Chamilo\CourseBundle\Entity\CForumPost;
  5. /**
  6. * These files are a complete rework of the forum. The database structure is
  7. * based on phpBB but all the code is rewritten. A lot of new functionalities
  8. * are added:
  9. * - forum categories and forums can be sorted up or down, locked or made invisible
  10. * - consistent and integrated forum administration
  11. * - forum options: are students allowed to edit their post?
  12. * moderation of posts (approval)
  13. * reply only forums (students cannot create new threads)
  14. * multiple forums per group
  15. * - sticky messages
  16. * - new view option: nested view
  17. * - quoting a message
  18. *
  19. * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
  20. * @copyright Ghent University
  21. * @copyright Patrick Cool
  22. *
  23. * @package chamilo.forum
  24. */
  25. require_once __DIR__.'/../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. echo Display::return_message($return_message, 'confirm', 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=\"../lp/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) && !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' => empty($forumCategory['visibility']) ? 'text-muted' : null
  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. // We display all the forums in this category.
  300. foreach ($forum_list as $forum) {
  301. $html = '';
  302. // Here we clean the whatnew_post_info array a little bit because to display the icon we
  303. // test if $whatsnew_post_info[$forum['forum_id']] is empty or not.
  304. if (isset($forum['forum_id'])) {
  305. if (!empty($whatsnew_post_info)) {
  306. if (
  307. isset($whatsnew_post_info[$forum['forum_id']]) &&
  308. is_array($whatsnew_post_info[$forum['forum_id']])
  309. ) {
  310. foreach ($whatsnew_post_info[$forum['forum_id']] as $key_thread_id => $new_post_array) {
  311. if (empty($whatsnew_post_info[$forum['forum_id']][$key_thread_id])) {
  312. unset($whatsnew_post_info[$forum['forum_id']][$key_thread_id]);
  313. unset($_SESSION['whatsnew_post_info'][$forum['forum_id']][$key_thread_id]);
  314. }
  315. }
  316. }
  317. }
  318. }
  319. // Note: This can be speed up if we transform the $forum_list
  320. // to an array that uses the forum_category as the key.
  321. if (
  322. isset($forum['forum_category']) &&
  323. $forum['forum_category'] == $forumCategory['cat_id']
  324. ) {
  325. $show_forum = false;
  326. // SHOULD WE SHOW THIS PARTICULAR FORUM
  327. // you are teacher => show forum
  328. if (api_is_allowed_to_edit(false, true)) {
  329. $show_forum = true;
  330. } else {
  331. // you are not a teacher
  332. // it is not a group forum => show forum
  333. // (invisible forums are already left out see get_forums function)
  334. if ($forum['forum_of_group'] == '0') {
  335. $show_forum = true;
  336. } else {
  337. $show_forum = GroupManager::user_has_access(
  338. $user_id,
  339. $forum['forum_of_group'],
  340. GroupManager::GROUP_TOOL_FORUM
  341. );
  342. }
  343. }
  344. if ($show_forum) {
  345. $form_count++;
  346. $mywhatsnew_post_info = isset($whatsnew_post_info[$forum['forum_id']]) ?
  347. $whatsnew_post_info[$forum['forum_id']] : null;
  348. $html = '<div class="panel panel-default forum">';
  349. $html .= '<div class="panel-body">';
  350. $forum_image = '';
  351. $imgForum = '';
  352. // Showing the image
  353. if (!empty($forum['forum_image'])) {
  354. $image_path = api_get_path(WEB_COURSE_PATH).api_get_course_path().'/upload/forum/images/'.$forum['forum_image'];
  355. $image_size = api_getimagesize($image_path);
  356. $img_attributes = '';
  357. if (!empty($image_size)) {
  358. //limit display width and height to 100px
  359. $img_attributes = ' style="width:80px" height="80px"';
  360. $imgForum = "<img src=\"$image_path\" $img_attributes>";
  361. } else {
  362. $imgForum = '';
  363. }
  364. $forum_image = $imgForum;
  365. } else {
  366. if ($forum['forum_of_group'] == '0') {
  367. $forum_image = Display::return_icon(
  368. 'forum_group.png',
  369. get_lang('GroupForum'),
  370. null,
  371. ICON_SIZE_LARGE
  372. );
  373. } else {
  374. $forum_image = Display::return_icon(
  375. 'forum.png',
  376. get_lang('Forum'),
  377. null,
  378. ICON_SIZE_LARGE
  379. );
  380. }
  381. }
  382. // Validation when belongs to a session
  383. $session_img = api_get_session_image(
  384. $forum['session_id'],
  385. $_user['status']
  386. );
  387. if ($forum['forum_of_group'] != '0') {
  388. $my_all_groups_forum_name = isset($all_groups[$forum['forum_of_group']]['name']) ?
  389. $all_groups[$forum['forum_of_group']]['name'] : null;
  390. $my_all_groups_forum_id = isset($all_groups[$forum['forum_of_group']]['id']) ?
  391. $all_groups[$forum['forum_of_group']]['id'] : null;
  392. $group_title = api_substr(
  393. $my_all_groups_forum_name,
  394. 0,
  395. 30
  396. );
  397. $forum_title_group_addition = ' (<a href="../group/group_space.php?'
  398. . api_get_cidreq().'&gidReq='.$forum['forum_of_group']
  399. . '" class="forum_group_link">'.get_lang('GoTo').' '.$group_title.'</a>)'
  400. . $session_img;
  401. } else {
  402. $forum_title_group_addition = '';
  403. }
  404. if (empty($sessionId) && !empty($forum['session_name'])) {
  405. $session_displayed = ' ('.$forum['session_name'].')';
  406. } else {
  407. $session_displayed = '';
  408. }
  409. $forum['forum_of_group'] == 0 ? $groupid = '' : $groupid = $forum['forum_of_group'];
  410. $number_threads = isset($forum['number_of_threads']) ? (int) $forum['number_of_threads'] : 0;
  411. $number_posts = isset($forum['number_of_posts']) ? $forum['number_of_posts'] : 0;
  412. $linkForum = api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.api_get_cidreq().'&gidReq='.$groupid.'&forum='.$forum['forum_id'];
  413. $html .= '<div class="row">';
  414. $html .= '<div class="col-md-6">';
  415. $html .= '<div class="col-md-3">';
  416. $html .= '<div class="number-post">'.Display::url($forum_image, $linkForum);
  417. $html .= '<p>'.$number_threads.' '.get_lang('ForumThreads').'</p>'
  418. . '</div>';
  419. $html .= '</div>';
  420. $html .= '<div class="col-md-9">';
  421. $iconForum = Display::return_icon(
  422. 'forum_yellow.png',
  423. get_lang($forumCategory['cat_title']),
  424. null,
  425. ICON_SIZE_MEDIUM
  426. );
  427. $linkForum = Display::tag(
  428. 'a',
  429. $forum['forum_title'],
  430. [
  431. 'href' => $linkForum,
  432. 'class' => empty($forum['visibility']) ? 'text-muted' : null
  433. ]
  434. );
  435. if (!empty($forum['start_time']) && !empty($forum['end_time'])) {
  436. $res = api_is_date_in_date_range($forum['start_time'], $forum['end_time']);
  437. if (!$res) {
  438. $linkForum = $forum['forum_title'];
  439. }
  440. }
  441. $html .= '<h3 class="title">'.$iconForum.$linkForum.'</h3>';
  442. $html .= Display::tag(
  443. 'p',
  444. Security::remove_XSS($forum['forum_comment']),
  445. [
  446. 'class'=>'description'
  447. ]
  448. );
  449. if ($forum['moderated'] == 1 && api_is_allowed_to_edit(false, true)) {
  450. $waitingCount = getCountPostsWithStatus(
  451. CForumPost::STATUS_WAITING_MODERATION,
  452. $forum
  453. );
  454. if (!empty($waitingCount)) {
  455. $html .= Display::label(
  456. get_lang('PostsPendingModeration').': '.$waitingCount,
  457. 'warning'
  458. );
  459. }
  460. }
  461. $html .= '</div>';
  462. $html .= '</div>';
  463. $iconEmpty = '';
  464. // The number of topics and posts.
  465. if ($forum['forum_of_group'] !== '0') {
  466. $newPost = '';
  467. if (is_array($mywhatsnew_post_info) && !empty($mywhatsnew_post_info)) {
  468. $newPost = ' '.Display::return_icon(
  469. 'alert.png',
  470. get_lang('Forum'),
  471. null,
  472. ICON_SIZE_SMALL
  473. );
  474. } else {
  475. $newPost = $iconEmpty;
  476. }
  477. } else {
  478. if (is_array($mywhatsnew_post_info) && !empty($mywhatsnew_post_info)) {
  479. $newPost = ' '.Display::return_icon(
  480. 'alert.png',
  481. get_lang('Forum'),
  482. null,
  483. ICON_SIZE_SMALL
  484. );
  485. } else {
  486. $newPost = $iconEmpty;
  487. }
  488. }
  489. $html .= '<div class="col-md-6">';
  490. $html .= '<div class="row">';
  491. $html .= '<div class="col-md-2">';
  492. $html .= $newPost.'</div>';
  493. $html .= '<div class="col-md-6">';
  494. // The last post in the forum.
  495. if (isset($forum['last_poster_name']) && $forum['last_poster_name'] != '') {
  496. $name = $forum['last_poster_name'];
  497. $poster_id = 0;
  498. $username = "";
  499. } else {
  500. if (isset($forum['last_poster_firstname'])) {
  501. $name = api_get_person_name(
  502. $forum['last_poster_firstname'],
  503. $forum['last_poster_lastname']
  504. );
  505. $poster_id = $forum['last_poster_id'];
  506. $userinfo = api_get_user_info($poster_id);
  507. $username = sprintf(
  508. get_lang('LoginX'),
  509. $userinfo['username']
  510. );
  511. }
  512. }
  513. if (!empty($forum['last_post_id'])) {
  514. $html .= Display::return_icon(
  515. 'post-item.png',
  516. null,
  517. null,
  518. ICON_SIZE_TINY
  519. )
  520. . ' '.
  521. api_convert_and_format_date($forum['last_post_date'])
  522. . '<br /> '.get_lang('By').' '.
  523. display_user_link(
  524. $poster_id,
  525. $name,
  526. '',
  527. $username
  528. );
  529. }
  530. $html .= '</div>';
  531. $html .= '<div class="col-md-4">';
  532. if (api_is_allowed_to_edit(false, true) &&
  533. !($forum['session_id'] == 0 && intval($sessionId) != 0)
  534. ) {
  535. $html .= '<a href="'.api_get_self().'?'.api_get_cidreq()
  536. . '&action=edit&content=forum&id='.$forum['forum_id'].'">'
  537. . Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL)
  538. . '</a>';
  539. $html .= '<a href="'.api_get_self().'?'.api_get_cidreq()
  540. . '&action=delete&content=forum&id='.$forum['forum_id']
  541. . "\" onclick=\"javascript:if(!confirm('".addslashes(
  542. api_htmlentities(get_lang('DeleteForum'), ENT_QUOTES)
  543. )
  544. . "')) return false;\">"
  545. . Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL)
  546. . '</a>';
  547. $html .= return_visible_invisible_icon(
  548. 'forum',
  549. $forum['forum_id'],
  550. $forum['visibility']
  551. );
  552. $html .= return_lock_unlock_icon(
  553. 'forum',
  554. $forum['forum_id'],
  555. $forum['locked']
  556. );
  557. $html .= return_up_down_icon(
  558. 'forum',
  559. $forum['forum_id'],
  560. $forumsInCategory
  561. );
  562. }
  563. $iconnotify = 'notification_mail_na.png';
  564. $session_forum_notification = isset($_SESSION['forum_notification']['forum']) ?
  565. $_SESSION['forum_notification']['forum'] : false;
  566. if (is_array($session_forum_notification)) {
  567. if (in_array(
  568. $forum['forum_id'],
  569. $session_forum_notification
  570. )) {
  571. $iconnotify = 'notification_mail.png';
  572. }
  573. }
  574. if (
  575. !api_is_anonymous() &&
  576. api_is_allowed_to_session_edit(false, true)
  577. ) {
  578. $html .= '<a href="'.api_get_self().'?'.api_get_cidreq()
  579. . '&action=notify&content=forum&id='.$forum['forum_id'].'">'
  580. . Display::return_icon($iconnotify, get_lang('NotifyMe'), null, ICON_SIZE_SMALL)
  581. . '</a>';
  582. }
  583. $html .= '</div>';
  584. $html .= '</div>';
  585. $html .= '</div>';
  586. $html .= '</div>';
  587. $html .= '</div>';
  588. $html .= '</div>';
  589. }
  590. echo $html;
  591. }
  592. }
  593. } else {
  594. echo '<div class="alert alert-warning">'.get_lang('NoForumInThisCategory').'</div>'
  595. . (api_is_allowed_to_edit(false, true) ? '<div>' : '</div>')
  596. . '</div>';
  597. }
  598. echo '</div>';
  599. }
  600. }
  601. Display:: display_footer();