@ -51,7 +51,7 @@ $this_section=SECTION_COURSES;
api_protect_course_script(true);
// including additional library scripts
require_once api_get_path(LIBRARY_PATH).'/ text.lib.php';
require_once api_get_path(LIBRARY_PATH).'text.lib.php';
require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php';
$nameTools=get_lang('Forums');
@ -117,7 +117,7 @@ if (api_is_allowed_to_edit(false,true)) {
// notification
if (isset($_GET['action']) & & $_GET['action'] == 'notify' AND isset($_GET['content']) AND isset($_GET['id'])) {
if (api_get_session_id()!=0 & & api_is_allowed_to_session_edit(false,true)==false) {
if (api_get_session_id()!=0 & & api_is_allowed_to_session_edit(false,true)==false) {
api_not_allowed();
}
$return_message = set_notification($_GET['content'],$_GET['id']);
@ -128,7 +128,7 @@ if (isset($_GET['action']) && $_GET['action'] == 'notify' AND isset($_GET['conte
$whatsnew_post_info = array();
$whatsnew_post_info = $_SESSION['whatsnew_post_info'];
/*
/*
TRACKING
*/
event_access_tool(TOOL_FORUM);
@ -145,7 +145,7 @@ if (isset($_GET['action']) && $_GET['action'] == 'notify' AND isset($_GET['conte
// step 2: we find all the forums (only the visible ones if it is a student)
$forum_list = array();
$forum_list = get_forums();
/*
RETRIEVING ALL GROUPS AND THOSE OF THE USER
@ -164,15 +164,15 @@ if (isset($_GET['action']) && $_GET['action'] == 'notify' AND isset($_GET['conte
}
}
/*
CLEAN GROUP ID FOR AJAXFILEMANAGER
/*
CLEAN GROUP ID FOR AJAXFILEMANAGER
*/
if(isset($_SESSION['_gid'])) {
unset($_SESSION['_gid']);
}
/*
ACTION LINKS
/*
ACTION LINKS
*/
$session_id=isset($_SESSION['id_session']) ? $_SESSION['id_session'] : false;
//if (api_is_allowed_to_edit() and !$_GET['action'])
@ -187,27 +187,27 @@ if (isset($_GET['action']) && $_GET['action'] == 'notify' AND isset($_GET['conte
}
echo '< / div > ';
/*
Display Forum Categories and the Forums in it
*/
/*
Display Forum Categories and the Forums in it
*/
echo '< table class = "data_table" > ';
// Step 3: we display the forum_categories first
if(is_array($forum_categories_list)) {
foreach ($forum_categories_list as $forum_category_key => $forum_category) {
//validacion when belongs to a session
$session_img = api_get_session_image($forum_category['session_id'], $_user['status']);
if((!isset($_SESSION['id_session']) || $_SESSION['id_session']==0) & & !empty($forum_category['session_name'])) {
$session_displayed = ' ('.Security::remove_XSS($forum_category['session_name']).')';
} else {
$session_displayed = '';
}
echo "< tr > < th style = \"padding-left:5px;\" align = \"left\" colspan = \"5\" > ";
echo "< tr > < th style = \"padding-left:5px;\" align = \"left\" colspan = \"5\" > ";
echo '< a href = "viewforumcategory.php?'.api_get_cidreq().'&forumcategory='.prepare4display($forum_category['cat_id']).'" ' . class_visible_invisible ( prepare4display ( $ forum_category [ ' visibility ' ] ) ) . ' > '.prepare4display($forum_category['cat_title']).$session_displayed.'< / a > '. $session_img .'< br / > ';
if ($forum_category['cat_comment']< >'' AND trim($forum_category['cat_comment'])< >' ') {
if ($forum_category['cat_comment']< >'' AND trim($forum_category['cat_comment'])< >' ') {
echo '< span class = "forum_description" > '.prepare4display($forum_category['cat_comment']).'< / span > ';
}
echo '< / th > ';
@ -338,10 +338,10 @@ if (isset($_GET['action']) && $_GET['action'] == 'notify' AND isset($_GET['conte
}
}
echo "< / td > ";
//validacion when belongs to a session
$session_img = api_get_session_image($forum['session_id'], $_user['status']);
if ($forum['forum_of_group'] < > '0') {
$my_all_groups_forum_name = isset($all_groups[$forum['forum_of_group']]['name']) ? $all_groups[$forum['forum_of_group']]['name'] : null;
$my_all_groups_forum_id = isset($all_groups[$forum['forum_of_group']]['id']) ? $all_groups[$forum['forum_of_group']]['id'] : null;
@ -357,11 +357,11 @@ if (isset($_GET['action']) && $_GET['action'] == 'notify' AND isset($_GET['conte
$session_displayed = '';
}
$forum['forum_of_group']==0?$groupid='':$groupid=$forum['forum_of_group'];
echo "< td > < a href = \"viewforum.php?".api_get_cidreq()."&gidReq=".intval($groupid)."&forum=".intval($forum['forum_id'])."\" " . class_visible_invisible ( prepare4display ( $ forum [ ' visibility ' ] ) ) . " > ";
//Forum title
echo prepare4display($forum['forum_title']).$session_displayed.'< / a > '.$forum_title_group_addition.'< br / > '.prepare4display($forum['forum_comment']);
echo '< / td > ';
//$number_forum_topics_and_posts=get_post_topics_of_forum($forum['forum_id']); // deprecated
@ -400,12 +400,12 @@ if (isset($_GET['action']) && $_GET['action'] == 'notify' AND isset($_GET['conte
}
}
if (!api_is_anonymous() & & api_is_allowed_to_session_edit(false,true) ) {
if (!api_is_anonymous() & & api_is_allowed_to_session_edit(false,true) ) {
echo "< a href = \"".api_get_self()."?".api_get_cidreq()."&gradebook=$gradebook&action=notify&content=forum&id=".$forum['forum_id']."\" > ".icon('../img/'.$iconnotify,get_lang('NotifyMe'))."< / a > ";
}
echo "< / td > ";
echo "< / tr > ";
}
}
}
}
@ -413,7 +413,7 @@ if (isset($_GET['action']) && $_GET['action'] == 'notify' AND isset($_GET['conte
echo "< tr > < td > ".get_lang('NoForumInThisCategory')."< / td > ".(api_is_allowed_to_edit(false,true)?'< td colspan = "6" > < / td > ':'< td colspan = "6" > < / td > ')."< / tr > ";
}
}
}
}
echo "< / table > ";
/*