parent
aecc8ee0f8
commit
f3e3b9846f
@ -1,19 +0,0 @@ |
|||||||
<?php |
|
||||||
/* For licensing terms, see /license.txt */ |
|
||||||
|
|
||||||
require_once '../main/inc/global.inc.php'; |
|
||||||
|
|
||||||
/** |
|
||||||
* Redirects "courses/ABC/document/my_file.html" to |
|
||||||
* "public/courses/ABCa0d/document/my_file.html" |
|
||||||
* That route uses the Symfony ResourceController see: |
|
||||||
* /src/CoreBundle/Controller/ResourceController.php. |
|
||||||
*/ |
|
||||||
$publicPath = api_get_path(WEB_PUBLIC_PATH); |
|
||||||
// http://localhost/chamilo2/courses/ABC/document/aa.html |
|
||||||
$courseCode = Security::remove_XSS($_GET['courseCode']); |
|
||||||
$path = Security::remove_XSS($_GET['url']); |
|
||||||
$type = Security::remove_XSS($_GET['type'] ?? 'show'); |
|
||||||
$url = $publicPath."courses/$courseCode/document/$path?type=$type"; |
|
||||||
header("Location: $url"); |
|
||||||
exit; |
|
@ -1,301 +0,0 @@ |
|||||||
<?php |
|
||||||
/* For licensing terms, see /license.txt */ |
|
||||||
|
|
||||||
use ChamiloSession as Session; |
|
||||||
|
|
||||||
/** |
|
||||||
* This is the index file displayed when a user is logged in on Chamilo. |
|
||||||
* |
|
||||||
* It displays: |
|
||||||
* - personal course list |
|
||||||
* - menu bar |
|
||||||
* Search for CONFIGURATION parameters to modify settings |
|
||||||
* |
|
||||||
* @todo Shouldn't the CONFVAL_ constant be moved to the config page? Has anybody any idea what the are used for? |
|
||||||
* If these are really configuration settings then we can add those to the dokeos config settings. |
|
||||||
* @todo check for duplication of functions with index.php (user_portal.php is orginally a copy of index.php) |
|
||||||
* @todo display_digest, shouldn't this be removed and be made into an extension? |
|
||||||
*/ |
|
||||||
|
|
||||||
/* Flag forcing the 'current course' reset, as we're not inside a course anymore */ |
|
||||||
$cidReset = true; |
|
||||||
|
|
||||||
require_once '../../main/inc/global.inc.php'; |
|
||||||
|
|
||||||
api_block_anonymous_users(); // Only users who are logged in can proceed. |
|
||||||
|
|
||||||
$logInfo = [ |
|
||||||
'tool' => SECTION_COURSES, |
|
||||||
]; |
|
||||||
Event::registerLog($logInfo); |
|
||||||
|
|
||||||
$userId = api_get_user_id(); |
|
||||||
|
|
||||||
$collapsable = api_get_configuration_value('allow_user_session_collapsable'); |
|
||||||
if ($collapsable) { |
|
||||||
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : ''; |
|
||||||
$sessionId = isset($_REQUEST['session_id']) ? $_REQUEST['session_id'] : ''; |
|
||||||
$value = isset($_REQUEST['value']) ? (int) $_REQUEST['value'] : ''; |
|
||||||
switch ($action) { |
|
||||||
case 'collapse_session': |
|
||||||
if (!empty($sessionId)) { |
|
||||||
$userRelSession = SessionManager::getUserSession($userId, $sessionId); |
|
||||||
if ($userRelSession) { |
|
||||||
$table = Database::get_main_table(TABLE_MAIN_SESSION_USER); |
|
||||||
$sql = "UPDATE $table SET collapsed = $value WHERE id = ".$userRelSession['id']; |
|
||||||
Database::query($sql); |
|
||||||
Display::addFlash(Display::return_message(get_lang('Update successful'))); |
|
||||||
} |
|
||||||
header('Location: user_portal.php'); |
|
||||||
exit; |
|
||||||
} |
|
||||||
break; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
/* Constants and CONFIGURATION parameters */ |
|
||||||
$load_dirs = api_get_setting('show_documents_preview'); |
|
||||||
$displayMyCourseViewBySessionLink = 'true' === api_get_setting('my_courses_view_by_session'); |
|
||||||
$nameTools = get_lang('My courses'); |
|
||||||
$loadHistory = isset($_GET['history']) && 1 == intval($_GET['history']) ? true : false; |
|
||||||
|
|
||||||
// Load course notification by ajax |
|
||||||
$loadNotificationsByAjax = api_get_configuration_value('user_portal_load_notification_by_ajax'); |
|
||||||
if ($loadNotificationsByAjax) { |
|
||||||
$htmlHeadXtra[] = '<script> |
|
||||||
$(function() { |
|
||||||
$(".course_notification").each(function(index) { |
|
||||||
var div = $(this); |
|
||||||
var id = $(this).attr("id"); |
|
||||||
var idList = id.split("_"); |
|
||||||
var courseId = idList[1]; |
|
||||||
var sessionId = idList[2]; |
|
||||||
var status = idList[3]; |
|
||||||
$.ajax({ |
|
||||||
type: "GET", |
|
||||||
url: "'.api_get_path(WEB_AJAX_PATH).'course_home.ajax.php?a=get_notification&course_id="+courseId+"&session_id="+sessionId+"&status="+status, |
|
||||||
success: function(data) { |
|
||||||
div.append(data); |
|
||||||
} |
|
||||||
}); |
|
||||||
}); |
|
||||||
}); |
|
||||||
</script>'; |
|
||||||
} |
|
||||||
|
|
||||||
/* |
|
||||||
Header |
|
||||||
Include the HTTP, HTML headers plus the top banner. |
|
||||||
*/ |
|
||||||
if ($load_dirs) { |
|
||||||
$url = api_get_path(WEB_AJAX_PATH).'document.ajax.php?a=document_preview'; |
|
||||||
$folder_icon = api_get_path(WEB_IMG_PATH).'icons/22/folder.png'; |
|
||||||
$close_icon = api_get_path(WEB_IMG_PATH).'loading1.gif'; |
|
||||||
$htmlHeadXtra[] = '<script> |
|
||||||
$(function() { |
|
||||||
$(".document_preview_container").hide(); |
|
||||||
$(".document_preview").click(function() { |
|
||||||
var my_id = this.id; |
|
||||||
var course_id = my_id.split("_")[2]; |
|
||||||
var session_id = my_id.split("_")[3]; |
|
||||||
|
|
||||||
//showing div |
|
||||||
$(".document_preview_container").hide(); |
|
||||||
$("#document_result_" +course_id+"_" + session_id).show(); |
|
||||||
|
|
||||||
// Loading |
|
||||||
var image = $("img", this); |
|
||||||
image.attr("src", "'.$close_icon.'"); |
|
||||||
|
|
||||||
$.ajax({ |
|
||||||
url: "'.$url.'", |
|
||||||
data: "course_id="+course_id+"&session_id="+session_id, |
|
||||||
success: function(return_value) { |
|
||||||
image.attr("src", "'.$folder_icon.'"); |
|
||||||
$("#document_result_" +course_id+"_" + session_id).html(return_value); |
|
||||||
} |
|
||||||
}); |
|
||||||
|
|
||||||
}); |
|
||||||
}); |
|
||||||
</script>'; |
|
||||||
} |
|
||||||
if ($displayMyCourseViewBySessionLink) { |
|
||||||
$htmlHeadXtra[] = ' |
|
||||||
<script> |
|
||||||
userId = '.$userId.' |
|
||||||
$(function() { |
|
||||||
changeMyCoursesView($.cookie("defaultMyCourseView" + userId)); |
|
||||||
}); |
|
||||||
|
|
||||||
/** |
|
||||||
* Keep in cookie the last teacher view for the My Courses Tab. default view, or view by session |
|
||||||
* @param inView |
|
||||||
*/ |
|
||||||
function changeMyCoursesView(inView) { |
|
||||||
$.cookie("defaultMyCourseView"+userId, inView, { expires: 365 }); |
|
||||||
if (inView == '.IndexManager::VIEW_BY_SESSION.') { |
|
||||||
$("#viewBySession").addClass("btn-primary"); |
|
||||||
$("#viewByDefault").removeClass("btn-primary"); |
|
||||||
} else { |
|
||||||
$("#viewByDefault").addClass("btn-primary"); |
|
||||||
$("#viewBySession").removeClass("btn-primary"); |
|
||||||
} |
|
||||||
} |
|
||||||
</script>'; |
|
||||||
} |
|
||||||
|
|
||||||
$myCourseListAsCategory = api_get_configuration_value('my_courses_list_as_category'); |
|
||||||
|
|
||||||
$controller = new IndexManager(get_lang('My courses')); |
|
||||||
|
|
||||||
if (!$myCourseListAsCategory) { |
|
||||||
// Main courses and session list |
|
||||||
if (isset($_COOKIE['defaultMyCourseView'.$userId]) && |
|
||||||
IndexManager::VIEW_BY_SESSION == $_COOKIE['defaultMyCourseView'.$userId] && |
|
||||||
$displayMyCourseViewBySessionLink |
|
||||||
) { |
|
||||||
$courseAndSessions = $controller->returnCoursesAndSessionsViewBySession($userId); |
|
||||||
IndexManager::setDefaultMyCourseView(IndexManager::VIEW_BY_SESSION, $userId); |
|
||||||
} else { |
|
||||||
$courseAndSessions = $controller->returnCoursesAndSessions($userId, true, null, true, $loadHistory); |
|
||||||
IndexManager::setDefaultMyCourseView(IndexManager::VIEW_BY_DEFAULT, $userId); |
|
||||||
} |
|
||||||
|
|
||||||
// if teacher, session coach or admin, display the button to change te course view |
|
||||||
if ($displayMyCourseViewBySessionLink && |
|
||||||
( |
|
||||||
api_is_drh() || |
|
||||||
api_is_session_general_coach() || |
|
||||||
api_is_platform_admin() || |
|
||||||
api_is_session_admin() || |
|
||||||
api_is_teacher() |
|
||||||
) |
|
||||||
) { |
|
||||||
$courseAndSessions['html'] = " |
|
||||||
<div class='view-by-session-link'> |
|
||||||
<div class='btn-group pull-right'> |
|
||||||
<a class='btn btn-default' id='viewByDefault' href='user_portal.php' |
|
||||||
onclick='changeMyCoursesView(\"".IndexManager::VIEW_BY_DEFAULT."\")'> |
|
||||||
".get_lang('MyCoursesDefaultView')." |
|
||||||
</a> |
|
||||||
<a class='btn btn-default' id='viewBySession' href='user_portal.php' |
|
||||||
onclick='changeMyCoursesView(\"".IndexManager::VIEW_BY_SESSION."\")'> |
|
||||||
".get_lang('MyCoursesSessionView')." |
|
||||||
</a> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
<br /><br /> |
|
||||||
".$courseAndSessions['html']; |
|
||||||
} |
|
||||||
} else { |
|
||||||
$categoryCode = isset($_GET['category']) ? $_GET['category'] : ''; |
|
||||||
|
|
||||||
if (!$categoryCode) { |
|
||||||
$courseAndSessions = $controller->returnCourseCategoryListFromUser($userId); |
|
||||||
} else { |
|
||||||
$courseAndSessions = $controller->returnCoursesAndSessions( |
|
||||||
$userId, |
|
||||||
false, |
|
||||||
$categoryCode, |
|
||||||
true, |
|
||||||
$loadHistory |
|
||||||
); |
|
||||||
$getCategory = CourseCategory::getCategory($categoryCode); |
|
||||||
$controller->tpl->assign('category', $getCategory); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
// Check if a user is enrolled only in one course for going directly to the course after the login. |
|
||||||
if ('true' === api_get_setting('go_to_course_after_login')) { |
|
||||||
$count_of_sessions = $courseAndSessions['session_count']; |
|
||||||
$count_of_courses_no_sessions = $courseAndSessions['course_count']; |
|
||||||
// User is subscribe in 1 session and 0 courses. |
|
||||||
if (1 == $count_of_sessions && 0 == $count_of_courses_no_sessions) { |
|
||||||
$sessions = SessionManager::get_sessions_by_user($userId); |
|
||||||
|
|
||||||
if (isset($sessions[0])) { |
|
||||||
$sessionInfo = $sessions[0]; |
|
||||||
// Session only has 1 course. |
|
||||||
if (isset($sessionInfo['courses']) && |
|
||||||
1 == count($sessionInfo['courses']) |
|
||||||
) { |
|
||||||
$courseCode = $sessionInfo['courses'][0]['code']; |
|
||||||
$courseInfo = api_get_course_info_by_id($sessionInfo['courses'][0]['real_id']); |
|
||||||
$courseUrl = $courseInfo['course_public_url'].'?id_session='.$sessionInfo['session_id']; |
|
||||||
header('Location:'.$courseUrl); |
|
||||||
exit; |
|
||||||
} |
|
||||||
|
|
||||||
// Session has many courses. |
|
||||||
if (isset($sessionInfo['session_id'])) { |
|
||||||
$url = api_get_path(WEB_CODE_PATH).'session/index.php?session_id='.$sessionInfo['session_id']; |
|
||||||
|
|
||||||
header('Location:'.$url); |
|
||||||
exit; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
// User is subscribed to 1 course. |
|
||||||
if (!isset($_SESSION['coursesAlreadyVisited']) && |
|
||||||
0 == $count_of_sessions && |
|
||||||
1 == $count_of_courses_no_sessions |
|
||||||
) { |
|
||||||
$courses = CourseManager::get_courses_list_by_user_id($userId); |
|
||||||
if (!empty($courses) && isset($courses[0]) && isset($courses[0]['code'])) { |
|
||||||
$courseInfo = api_get_course_info_by_id($courses[0]['real_id']); |
|
||||||
if (!empty($courseInfo)) { |
|
||||||
$courseUrl = $courseInfo['course_public_url']; |
|
||||||
header('Location:'.$courseUrl); |
|
||||||
exit; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
$showWelcomeCourse = false; |
|
||||||
// Show the chamilo mascot |
|
||||||
if (empty($courseAndSessions['html_courses']) && !isset($_GET['history'])) { |
|
||||||
$controller->setWelComeCourse(); |
|
||||||
$showWelcomeCourse = true; |
|
||||||
} |
|
||||||
|
|
||||||
$controller->tpl->assign('content', $courseAndSessions['html']); |
|
||||||
|
|
||||||
// Display the Site Use Cookie Warning Validation |
|
||||||
$useCookieValidation = api_get_setting('cookie_warning'); |
|
||||||
if ('true' === $useCookieValidation) { |
|
||||||
if (isset($_POST['acceptCookies'])) { |
|
||||||
api_set_site_use_cookie_warning_cookie(); |
|
||||||
} else { |
|
||||||
if (!api_site_use_cookie_warning_cookie_exist()) { |
|
||||||
if (Template::isToolBarDisplayedForUser()) { |
|
||||||
$controller->tpl->assign('toolBarDisplayed', true); |
|
||||||
} else { |
|
||||||
$controller->tpl->assign('toolBarDisplayed', false); |
|
||||||
} |
|
||||||
$controller->tpl->assign('displayCookieUsageWarning', true); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
$historyClass = ''; |
|
||||||
if (!empty($_GET['history'])) { |
|
||||||
$historyClass = 'courses-history'; |
|
||||||
} |
|
||||||
$controller->tpl->assign('course_history_page', $historyClass); |
|
||||||
if ($myCourseListAsCategory) { |
|
||||||
$controller->tpl->assign('header', get_lang('My courses')); |
|
||||||
} |
|
||||||
|
|
||||||
$controller->setGradeBookDependencyBar($userId); |
|
||||||
|
|
||||||
// Deleting the session_id. |
|
||||||
Session::erase('session_id'); |
|
||||||
Session::erase('id_session'); |
|
||||||
Session::erase('studentview'); |
|
||||||
api_remove_in_gradebook(); |
|
||||||
|
|
||||||
$controller->tpl->assign('content', $controller->tpl->fetch('@ChamiloCore/Index/userportal.html.twig')); |
|
||||||
$controller->tpl->display_one_col_template(); |
|
@ -1,71 +0,0 @@ |
|||||||
<?php |
|
||||||
/* For licensing terms, see /license.txt */ |
|
||||||
|
|
||||||
/** |
|
||||||
* Who is online list. |
|
||||||
*/ |
|
||||||
if (!isset($_GET['cidReq'])) { |
|
||||||
$cidReset = true; |
|
||||||
} |
|
||||||
|
|
||||||
require_once '../../main/inc/global.inc.php'; |
|
||||||
|
|
||||||
if (isset($_GET['cidReq']) && strlen($_GET['cidReq']) > 0) { |
|
||||||
api_protect_course_script(true); |
|
||||||
} |
|
||||||
|
|
||||||
$this_section = SECTION_SOCIAL; |
|
||||||
$social_right_content = ''; |
|
||||||
$whoisonline_list = ''; |
|
||||||
$social_search = ''; |
|
||||||
$userId = api_get_user_id(); |
|
||||||
$access = accessToWhoIsOnline(); |
|
||||||
|
|
||||||
if (!$access) { |
|
||||||
api_not_allowed(true); |
|
||||||
} |
|
||||||
|
|
||||||
if (isset($_GET['cidReq']) && strlen($_GET['cidReq']) > 0) { |
|
||||||
$user_list = who_is_online_in_this_course( |
|
||||||
0, |
|
||||||
MAX_ONLINE_USERS, |
|
||||||
api_get_user_id(), |
|
||||||
api_get_setting('time_limit_whosonline'), |
|
||||||
$_GET['cidReq'] |
|
||||||
); |
|
||||||
} else { |
|
||||||
$user_list = who_is_online(0, MAX_ONLINE_USERS); |
|
||||||
} |
|
||||||
|
|
||||||
if ($user_list) { |
|
||||||
if (!isset($_GET['id'])) { |
|
||||||
if ('true' == api_get_setting('allow_social_tool')) { |
|
||||||
if (!api_is_anonymous()) { |
|
||||||
$query = isset($_GET['q']) ? $_GET['q'] : null; |
|
||||||
$social_search = UserManager::getSearchForm($query); |
|
||||||
} |
|
||||||
} |
|
||||||
$social_right_content .= SocialManager::display_user_list($user_list); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
$whoisonline_list .= SocialManager::display_user_list($user_list); |
|
||||||
|
|
||||||
if (isset($_GET['id'])) { |
|
||||||
if ('true' == api_get_setting('allow_social_tool') && !api_is_anonymous()) { |
|
||||||
header("Location: ".api_get_path(WEB_CODE_PATH)."social/profile.php?u=".intval($_GET['id'])); |
|
||||||
exit; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
$tpl = new Template(get_lang('Online users list')); |
|
||||||
|
|
||||||
if ('true' === api_get_setting('allow_social_tool') && !api_is_anonymous()) { |
|
||||||
$tpl->assign('whoisonline', $whoisonline_list); |
|
||||||
$tpl->assign('social_search', $social_search); |
|
||||||
} else { |
|
||||||
$tpl->assign('whoisonline', $social_right_content); |
|
||||||
} |
|
||||||
|
|
||||||
$social_layout = $tpl->get_template('social/whoisonline.tpl'); |
|
||||||
$tpl->display($social_layout); |
|
@ -1,148 +0,0 @@ |
|||||||
<?php |
|
||||||
/* For licensing terms, see /license.txt */ |
|
||||||
|
|
||||||
/** |
|
||||||
* Shows who is online in a specific session. |
|
||||||
*/ |
|
||||||
require_once '../../main/inc/global.inc.php'; |
|
||||||
|
|
||||||
api_block_anonymous_users(); |
|
||||||
|
|
||||||
$userId = api_get_user_id(); |
|
||||||
if (empty($userId)) { |
|
||||||
api_not_allowed(true); |
|
||||||
} |
|
||||||
|
|
||||||
$sessionId = api_get_session_id(); |
|
||||||
if (empty($sessionId)) { |
|
||||||
api_not_allowed(true); |
|
||||||
} |
|
||||||
|
|
||||||
$allow = api_is_platform_admin(true) || |
|
||||||
api_is_coach($sessionId, null, false) || |
|
||||||
SessionManager::isUserSubscribedAsStudent($sessionId, api_get_user_id()); |
|
||||||
|
|
||||||
if (!$allow) { |
|
||||||
api_not_allowed(true); |
|
||||||
} |
|
||||||
|
|
||||||
$maxNumberItems = 20; |
|
||||||
$sessionInfo = api_get_session_info($sessionId); |
|
||||||
|
|
||||||
Display::display_header(get_lang('Online users list')); |
|
||||||
echo Display::page_header($sessionInfo['name']); |
|
||||||
|
|
||||||
function getUsers( |
|
||||||
$from, |
|
||||||
$numberItems, |
|
||||||
$column, |
|
||||||
$direction, |
|
||||||
$getCount = false |
|
||||||
) { |
|
||||||
$sessionId = api_get_session_id(); |
|
||||||
$from = (int) $from; |
|
||||||
$numberItems = (int) $numberItems; |
|
||||||
|
|
||||||
$urlCondition = ''; |
|
||||||
$urlJoin = ''; |
|
||||||
if (api_is_multiple_url_enabled()) { |
|
||||||
$accessUrlUser = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
||||||
$urlId = api_get_current_access_url_id(); |
|
||||||
$urlJoin = " INNER JOIN $accessUrlUser a ON (a.user_id = user.id) "; |
|
||||||
$urlCondition = " AND a.access_url_id = $urlId "; |
|
||||||
} |
|
||||||
|
|
||||||
if (empty($time_limit)) { |
|
||||||
$time_limit = api_get_setting('time_limit_whosonline'); |
|
||||||
} else { |
|
||||||
$time_limit = 60; |
|
||||||
} |
|
||||||
|
|
||||||
$online_time = time() - $time_limit * 60; |
|
||||||
$current_date = api_get_utc_datetime($online_time); |
|
||||||
|
|
||||||
if ($getCount) { |
|
||||||
$sql = "SELECT |
|
||||||
count(DISTINCT last_access.login_user_id) count |
|
||||||
FROM ".Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE)." AS last_access |
|
||||||
INNER JOIN ".Database::get_main_table(TABLE_MAIN_USER)." AS user |
|
||||||
ON user.id = last_access.login_user_id |
|
||||||
$urlJoin |
|
||||||
WHERE |
|
||||||
session_id ='".$sessionId."' AND |
|
||||||
login_date >= '$current_date' |
|
||||||
$urlCondition"; |
|
||||||
$result = Database::query($sql); |
|
||||||
$result = Database::fetch_array($result); |
|
||||||
|
|
||||||
return $result['count']; |
|
||||||
} |
|
||||||
|
|
||||||
$sql = "SELECT DISTINCT |
|
||||||
last_access.login_user_id, |
|
||||||
last_access.c_id |
|
||||||
FROM ".Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE)." AS last_access |
|
||||||
INNER JOIN ".Database::get_main_table(TABLE_MAIN_USER)." AS user |
|
||||||
ON user.id = last_access.login_user_id |
|
||||||
$urlJoin |
|
||||||
WHERE |
|
||||||
session_id ='".$sessionId."' AND |
|
||||||
login_date >= '$current_date' |
|
||||||
$urlCondition |
|
||||||
GROUP BY login_user_id |
|
||||||
LIMIT $from, $numberItems"; |
|
||||||
|
|
||||||
$studentsOnline = []; |
|
||||||
$result = Database::query($sql); |
|
||||||
while ($user_list = Database::fetch_array($result)) { |
|
||||||
$studentsOnline[$user_list['login_user_id']] = $user_list; |
|
||||||
} |
|
||||||
|
|
||||||
return $studentsOnline; |
|
||||||
} |
|
||||||
|
|
||||||
function getCountUsers() |
|
||||||
{ |
|
||||||
return getUsers(0, 0, 0, 0, true); |
|
||||||
} |
|
||||||
|
|
||||||
$table = new SortableTable( |
|
||||||
'users', |
|
||||||
'getCountUsers', |
|
||||||
'getUsers', |
|
||||||
'1', |
|
||||||
$maxNumberItems |
|
||||||
); |
|
||||||
$table->set_header(0, get_lang('Name'), false); |
|
||||||
$table->set_header(1, get_lang('In course'), false); |
|
||||||
|
|
||||||
$table->set_column_filter(0, 'user_filter'); |
|
||||||
$table->set_column_filter(1, 'course_filter'); |
|
||||||
$table->display(); |
|
||||||
|
|
||||||
function user_filter($userId, $urlParams, $row) |
|
||||||
{ |
|
||||||
$userInfo = api_get_user_info($userId); |
|
||||||
|
|
||||||
return $userInfo['complete_name_with_message_link']; |
|
||||||
} |
|
||||||
|
|
||||||
function course_filter($courseId, $urlParams, $row) |
|
||||||
{ |
|
||||||
$sessionId = api_get_session_id(); |
|
||||||
$courseInfo = api_get_course_info_by_id($courseId); |
|
||||||
|
|
||||||
return Display::url( |
|
||||||
$courseInfo['title'], |
|
||||||
$courseInfo['course_public_url'].'?id_session='.$sessionId, |
|
||||||
['target' => '_blank'] |
|
||||||
). |
|
||||||
' '. |
|
||||||
Display::url( |
|
||||||
get_lang('Chat'), |
|
||||||
'main/chat/chat.php?cidReq='.$courseInfo['code'].'&id_session='.$sessionId, |
|
||||||
['target' => '_blank', 'class' => 'btn btn-primary'] |
|
||||||
); |
|
||||||
} |
|
||||||
|
|
||||||
Display::display_footer(); |
|
Loading…
Reference in new issue