// The user who posted it can edit his thread only if the course admin allowed this in the properties of the forum
// The course admin him/herself can do this off course always
if ( GroupManager::is_tutor_of_group(api_get_user_id(), $group_id) OR ($current_forum['allow_edit']==1 AND $row['user_id']==$_user['user_id']) or (api_is_allowed_to_edit(false,true) && !(api_is_course_coach() && $current_forum['session_id']!=$_SESSION['id_session']))) {
@ -65,7 +69,7 @@ if (isset($current_thread['thread_id'])) {
}
if ($origin != 'learnpath') {
if (GroupManager::is_tutor_of_group(api_get_user_id(), $group_id) OR api_is_allowed_to_edit(false,true) && !(api_is_course_coach() && $current_forum['session_id']!=$_SESSION['id_session'])) {
if (GroupManager::is_tutor_of_group(api_get_user_id(), $group_id) || api_is_allowed_to_edit(false,true) && !(api_is_course_coach() && $current_forum['session_id']!=$_SESSION['id_session'])) {
@ -94,8 +98,10 @@ if (isset($current_thread['thread_id'])) {
}
}
if (($current_forum_category && $current_forum_category['locked']==0) AND $current_forum['locked']==0 AND $current_thread['locked']==0 OR api_is_allowed_to_edit(false,true)) {
if ($_user['user_id'] OR ($current_forum['allow_anonymous']==1 AND !$_user['user_id'])) {
if (($current_forum_category && $current_forum_category['locked']==0) &&
@ -114,12 +120,12 @@ if (isset($current_thread['thread_id'])) {
}
echo "</td>";
// prepare the notification icon
if (isset($whatsnew_post_info[$current_forum['forum_id']][$current_thread['thread_id']][$row['post_id']]) and !empty($whatsnew_post_info[$current_forum['forum_id']][$current_thread['thread_id']][$row['post_id']]) and !empty($whatsnew_post_info[$_GET['forum']][$row['thread_id']])) {
if (isset($whatsnew_post_info[$current_forum['forum_id']][$current_thread['thread_id']][$row['post_id']]) && !empty($whatsnew_post_info[$current_forum['forum_id']][$current_thread['thread_id']][$row['post_id']]) and !empty($whatsnew_post_info[$_GET['forum']][$row['thread_id']])) {
if (($current_forum['allow_edit']==1 AND $row['user_id']==$_user['user_id']) or (api_is_allowed_to_edit(false,true) && !(api_is_course_coach() && $current_forum['session_id']!=$_SESSION['id_session']))) {
if (($current_forum['allow_edit']==1 && $row['user_id']==$_user['user_id']) ||
$condition_display_tools = ' WHERE (visibility = 1 AND (category = "authoring" OR category = "interaction" OR category = "plugin") OR (name = "'.TOOL_TRACKING.'") ) ';
}
$sql = "SELECT *
FROM $course_tool_table
FROM $course_tool_table t
$condition_display_tools AND
c_id = $course_id $condition_session
ORDER BY id";
$result = Database::query($sql);
break;
case TOOL_AUTHORING:
$sql = "SELECT * FROM $course_tool_table
$sql = "SELECT * FROM $course_tool_table t
WHERE category = 'authoring' AND c_id = $course_id $condition_session
ORDER BY id";
$result = Database::query($sql);
break;
case TOOL_INTERACTION:
$sql = "SELECT * FROM $course_tool_table
$sql = "SELECT * FROM $course_tool_table t
WHERE category = 'interaction' AND c_id = $course_id $condition_session
ORDER BY id";
$result = Database::query($sql);
break;
case TOOL_ADMIN_VISIBLE:
$sql = "SELECT * FROM $course_tool_table
$sql = "SELECT * FROM $course_tool_table t
WHERE category = 'admin' AND visibility ='1' AND c_id = $course_id $condition_session
ORDER BY id";
$result = Database::query($sql);
break;
case TOOL_ADMIN_PLATFORM:
$sql = "SELECT * FROM $course_tool_table
WHERE category = 'admin' AND c_id = $course_id $condition_session ORDER BY id";
$sql = "SELECT * FROM $course_tool_table t
WHERE category = 'admin' AND c_id = $course_id $condition_session
ORDER BY id";
$result = Database::query($sql);
break;
case TOOL_DRH:
$sql = "SELECT * FROM $course_tool_table
$sql = "SELECT * FROM $course_tool_table t
WHERE name IN ('tracking') AND c_id = $course_id $condition_session