UI Improvements + lots of bugfixes * @package chamilo.forum */ // Delete attachment file if ((isset($_GET['action']) && $_GET['action'] == 'delete_attach') && isset($_GET['id_attach']) ) { delete_attachment(0, $_GET['id_attach']); } $sessionId = api_get_session_id(); $_user = api_get_user_info(); $userId = api_get_user_id(); $groupId = api_get_group_id(); $sortDirection = isset($_GET['posts_order']) && $_GET['posts_order'] === 'desc' ? 'DESC' : 'ASC'; if (isset($current_thread['thread_id'])) { $rows = getPosts($current_thread['thread_id'], $sortDirection); $increment = 0; $clean_forum_id = intval($_GET['forum']); $clean_thread_id = intval($_GET['thread']); $locked = api_resource_is_locked_by_gradebook( $clean_thread_id, LINK_FORUM_THREAD ); $closedPost = null; if (!empty($rows)) { foreach ($rows as $row) { if ($row['user_id'] == '0') { $name = prepare4display($row['poster_name']); } else { $name = api_get_person_name($row['firstname'], $row['lastname']); } $username = sprintf(get_lang('LoginX'), $row['username']); if (($current_forum_category && $current_forum_category['locked'] == 0) && $current_forum['locked'] == 0 && $current_thread['locked'] == 0 || api_is_allowed_to_edit(false, true) ) { if ($_user['user_id'] || ($current_forum['allow_anonymous'] == 1 && !$_user['user_id'])) { if (!api_is_anonymous() && api_is_allowed_to_session_edit(false, true)) { $buttonReply = Display::tag( 'a', ' ' . get_lang('ReplyToMessage'), array( 'href' => 'reply.php?' . api_get_cidreq() . "&forum=$clean_forum_id&thread=$clean_thread_id&post=" . "{$row['post_id']}&action=replymessage&origin=$origin", 'class' => 'btn btn-primary' ) ); $buttonQuote = Display::tag( 'a', ' ' . get_lang('QuoteMessage'), array( 'href' => 'reply.php?' . api_get_cidreq() . "&forum=$clean_forum_id&thread=$clean_thread_id" . "&post={$row['post_id']}&action=quote&origin=$origin", 'class' => 'btn btn-success' ) ); } } } else { if (($current_forum_category && $current_forum_category['locked'] == 1)) { $closedPost = Display::tag( 'div', ' ' . get_lang('ForumcategoryLocked'), array('class' => 'alert alert-warning post-closed') ); } if ($current_forum['locked'] == 1) { $closedPost = Display::tag( 'div', ' ' . get_lang('ForumLocked'), array('class' => 'alert alert-warning post-closed') ); } if ($current_thread['locked'] == 1) { $closedPost = Display::tag( 'div', ' ' . get_lang('ThreadLocked'), array('class' => 'alert alert-warning post-closed') ); } } $html = ''; $html .= '