Minor -flint fixes

pull/2818/head
Julio 6 years ago
parent 5ebef6db05
commit 7526aa89dc
  1. 65
      main/admin/index.php
  2. 2
      main/admin/system_announcements.php
  3. 2
      main/admin/user_edit.php
  4. 172
      main/admin/user_list.php
  5. 34
      main/create_course/add_course.php
  6. 2
      main/exercise/exercise.class.php
  7. 2
      main/exercise/exercise_admin.php
  8. 2
      main/exercise/hotspot_answers.as.php
  9. 4
      main/forum/forumfunction.inc.php
  10. 3
      main/group/group_space.php
  11. 7
      main/inc/email_editor.php
  12. 8
      main/inc/introductionSection.inc.php
  13. 2
      main/inc/lib/banner.lib.php
  14. 3
      main/inc/lib/display.lib.php
  15. 68
      main/inc/lib/document.lib.php
  16. 8
      main/inc/lib/exercise.lib.php
  17. 11
      main/inc/lib/formvalidator/FormValidator.class.php
  18. 4
      main/inc/lib/groupmanager.lib.php
  19. 2
      main/inc/lib/sortable_table.class.php
  20. 49
      main/inc/lib/tracking.lib.php
  21. 8
      main/inc/lib/usergroup.lib.php
  22. 1
      main/mySpace/myStudents.php
  23. 2
      main/wiki/wiki.inc.php
  24. 1
      src/GraphQlBundle/ChamiloGraphQlBundle.php
  25. 2
      src/GraphQlBundle/Map/InterfaceMap.php
  26. 4
      src/GraphQlBundle/Map/QueryMap.php
  27. 2
      src/GraphQlBundle/Resolver/CourseResolver.php
  28. 2
      src/GraphQlBundle/Resolver/SessionResolver.php
  29. 2
      src/GraphQlBundle/Resolver/UserResolver.php
  30. 2
      user_portal.php

@ -13,7 +13,7 @@ use League\Flysystem\Filesystem;
$cidReset = true;
// Including some necessary chamilo files.
require_once __DIR__ . '/../inc/global.inc.php';
require_once __DIR__.'/../inc/global.inc.php';
// Setting the section (for the tabs).
$this_section = SECTION_PLATFORM_ADMIN;
@ -73,10 +73,10 @@ $search_form = '
<form method="get" class="form-inline" action="user_list.php">
<div class="form-group mb-2">
<input class="form-control" type="text" name="keyword" value=""
aria-label="' . get_lang('Search') . '">
aria-label="'.get_lang('Search').'">
</div>
<button class="btn btn-primary mb-2" type="submit">
<em class="fa fa-search"></em> ' . get_lang('Search') . '
<em class="fa fa-search"></em> '.get_lang('Search').'
</button>
</form>';
$blocks['users']['search_form'] = $search_form;
@ -110,7 +110,6 @@ if (api_is_platform_admin()) {
['url' => 'usergroups.php', 'label' => get_lang('Classes')],
];
if (api_is_session_admin()) {
if ('true' === api_get_setting('limit_session_admin_role')) {
$items = array_filter($items, function (array $item) {
@ -149,10 +148,10 @@ if (api_is_platform_admin()) {
$search_form = ' <form method="get" class="form-inline" action="course_list.php">
<div class="form-group mb-2">
<input class="form-control" type="text" name="keyword" value=""
aria-label="' . get_lang('Search') . '">
aria-label="'.get_lang('Search').'">
</div>
<button class="btn btn-primary mb-2" type="submit">
<em class="fa fa-search"></em> ' . get_lang('Search') . '
<em class="fa fa-search"></em> '.get_lang('Search').'
</button>
</form>';
$blocks['courses']['search_form'] = $search_form;
@ -183,7 +182,7 @@ if (api_is_platform_admin()) {
$items[] = ['url' => 'extra_fields.php?type=course', 'label' => get_lang('ManageCourseFields')];
$items[] = [
'url' => api_get_path(WEB_CODE_PATH) . 'admin/teacher_time_report.php',
'url' => api_get_path(WEB_CODE_PATH).'admin/teacher_time_report.php',
'label' => get_lang('TeacherTimeReport'),
];
@ -205,28 +204,28 @@ if (api_is_platform_admin()) {
if (api_is_platform_admin()) {
$blocks['sessions']['editable'] = true;
}
$sessionPath = api_get_path(WEB_CODE_PATH) . 'session/';
$sessionPath = api_get_path(WEB_CODE_PATH).'session/';
$search_form = ' <form method="GET" class="form-inline" action="' . $sessionPath . 'session_list.php">
$search_form = ' <form method="GET" class="form-inline" action="'.$sessionPath.'session_list.php">
<div class="form-group mb-2">
<input class="form-control"
type="text"
name="keyword"
value=""
aria-label="' . get_lang('Search') . '">
aria-label="'.get_lang('Search').'">
</div>
<button class="btn btn-primary mb-2" type="submit">
<em class="fa fa-search"></em> ' . get_lang('Search') . '
<em class="fa fa-search"></em> '.get_lang('Search').'
</button>
</form>';
$blocks['sessions']['search_form'] = $search_form;
$items = [];
$items[] = ['url' => $sessionPath . 'session_list.php', 'label' => get_lang('ListSession')];
$items[] = ['url' => $sessionPath . 'session_add.php', 'label' => get_lang('AddSession')];
$items[] = ['url' => $sessionPath . 'session_category_list.php', 'label' => get_lang('ListSessionCategory')];
$items[] = ['url' => $sessionPath . 'session_import.php', 'label' => get_lang('ImportSessionListXMLCSV')];
$items[] = ['url' => $sessionPath . 'session_import_drh.php', 'label' => get_lang('ImportSessionDrhList')];
$items[] = ['url' => $sessionPath.'session_list.php', 'label' => get_lang('ListSession')];
$items[] = ['url' => $sessionPath.'session_add.php', 'label' => get_lang('AddSession')];
$items[] = ['url' => $sessionPath.'session_category_list.php', 'label' => get_lang('ListSessionCategory')];
$items[] = ['url' => $sessionPath.'session_import.php', 'label' => get_lang('ImportSessionListXMLCSV')];
$items[] = ['url' => $sessionPath.'session_import_drh.php', 'label' => get_lang('ImportSessionDrhList')];
if (isset($extAuthSource) && isset($extAuthSource['ldap']) && count($extAuthSource['ldap']) > 0) {
$items[] = [
'url' => 'ldap_import_students_to_session.php',
@ -234,7 +233,7 @@ if (api_is_platform_admin()) {
];
}
$items[] = [
'url' => $sessionPath . 'session_export.php',
'url' => $sessionPath.'session_export.php',
'label' => get_lang('ExportSessionListXMLCSV'),
];
@ -249,7 +248,7 @@ if (api_is_platform_admin()) {
if (api_is_platform_admin() || ($allowCareer && api_is_session_admin())) {
// option only visible in development mode. Enable through code if required
if (is_dir(api_get_path(SYS_TEST_PATH) . 'datafiller/')) {
if (is_dir(api_get_path(SYS_TEST_PATH).'datafiller/')) {
$items[] = ['url' => 'user_move_stats.php', 'label' => get_lang('MoveUserStats')];
}
$items[] = ['url' => 'career_dashboard.php', 'label' => get_lang('CareersAndPromotions')];
@ -291,7 +290,7 @@ if (api_is_platform_admin()) {
];
$items[] = [
'url' => api_get_path(WEB_CODE_PATH) . 'social/skills_ranking.php',
'url' => api_get_path(WEB_CODE_PATH).'social/skills_ranking.php',
'label' => get_lang('SkillsRanking'),
];
$items[] = [
@ -327,21 +326,21 @@ if (api_is_platform_admin()) {
$blocks['platform']['description'] = get_lang('Configure your platform, view reports, publish and send announcements globally');
$blocks['platform']['class'] = 'block-admin-platform';
$blocks['platform']['editable'] = true;
$search_form = ' <form method="get" action="' . api_get_path(WEB_PUBLIC_PATH) . 'admin/settings/search_settings' . '" class="form-inline">
$search_form = ' <form method="get" action="'.api_get_path(WEB_PUBLIC_PATH).'admin/settings/search_settings'.'" class="form-inline">
<div class="form-group mb-2">
<input class="form-control"
type="text"
name="keyword" value=""
aria-label="' . get_lang('Search') . '" >
aria-label="'.get_lang('Search').'" >
</div>
<button class="btn btn-primary mb-2" type="submit">
<em class="fa fa-search"></em> ' . get_lang('Search') . '
<em class="fa fa-search"></em> '.get_lang('Search').'
</button>
</form>';
$blocks['platform']['search_form'] = $search_form;
//$url = Container::getRouter()->generate('chamilo_platform_settings', ['namespace' => 'platform']);
$url = api_get_path(WEB_PUBLIC_PATH) . 'admin/settings/platform';
$url = api_get_path(WEB_PUBLIC_PATH).'admin/settings/platform';
$items = [];
$items[] = ['url' => $url, 'label' => get_lang('PlatformConfigSettings')];
$items[] = ['url' => 'languages.php', 'label' => get_lang('Languages')];
@ -349,7 +348,7 @@ if (api_is_platform_admin()) {
$items[] = ['url' => 'settings.php?category=Regions', 'label' => get_lang('Regions')];
$items[] = ['url' => 'system_announcements.php', 'label' => get_lang('SystemAnnouncements')];
$items[] = [
'url' => api_get_path(WEB_CODE_PATH) . 'calendar/agenda_js.php?type=admin',
'url' => api_get_path(WEB_CODE_PATH).'calendar/agenda_js.php?type=admin',
'label' => get_lang('GlobalAgenda'),
];
// Replaced by page blocks
@ -357,13 +356,13 @@ if (api_is_platform_admin()) {
$items[] = ['url' => 'configure_inscription.php', 'label' => get_lang('ConfigureInscription')];
$items[] = ['url' => 'statistics/index.php', 'label' => get_lang('Statistics')];
$items[] = [
'url' => api_get_path(WEB_CODE_PATH) . 'mySpace/company_reports.php',
'url' => api_get_path(WEB_CODE_PATH).'mySpace/company_reports.php',
'label' => get_lang('Reports'),
];
if (api_get_configuration_value('chamilo_cms')) {
$items[] = [
'url' => api_get_path(WEB_PATH) . 'web/app_dev.php/administration/dashboard',
'url' => api_get_path(WEB_PATH).'web/app_dev.php/administration/dashboard',
'label' => get_lang('CMS'),
];
}
@ -378,7 +377,7 @@ if (api_is_platform_admin()) {
if (api_get_plugin_setting('dictionary', 'enable_plugin_dictionary') == 'true') {
$items[] = [
'url' => api_get_path(WEB_PLUGIN_PATH) . 'dictionary/terms.php',
'url' => api_get_path(WEB_PLUGIN_PATH).'dictionary/terms.php',
'label' => get_lang('Dictionary'),
];
}
@ -387,7 +386,7 @@ if (api_is_platform_admin()) {
$items[] = ['url' => 'legal_add.php', 'label' => get_lang('TermsAndConditions')];
}
$items[] = ['url' => api_get_path(WEB_PUBLIC_PATH) . 'admin/lti/', 'label' => get_lang('External tools')];
$items[] = ['url' => api_get_path(WEB_PUBLIC_PATH).'admin/lti/', 'label' => get_lang('External tools')];
$blocks['platform']['items'] = $items;
$blocks['platform']['extra'] = null;
@ -420,7 +419,7 @@ if (api_is_platform_admin()) {
'url' => 'system_status.php',
'label' => get_lang('SystemStatus'),
];
if (is_dir(api_get_path(SYS_TEST_PATH) . 'datafiller/')) {
if (is_dir(api_get_path(SYS_TEST_PATH).'datafiller/')) {
$items[] = [
'url' => 'filler.php',
'label' => get_lang('DataFiller'),
@ -439,7 +438,7 @@ if (api_is_platform_admin()) {
}
$items[] = [
'url' => api_get_path(WEB_CODE_PATH) . 'ticket/tickets.php',
'url' => api_get_path(WEB_CODE_PATH).'ticket/tickets.php',
'label' => get_lang('TicketSystem'),
];
@ -459,7 +458,6 @@ if (api_is_platform_admin()) {
$blocks['settings']['items'] = $items;
$blocks['settings']['extra'] = null;
$blocks['settings']['search_form'] = null;
}
if (api_is_platform_admin()) {
@ -506,7 +504,6 @@ if (api_is_platform_admin()) {
}
}
/* Chamilo.org */
$blocks['chamilo']['icon'] = Display::return_icon(
'platform.png',
@ -588,7 +585,7 @@ if (api_is_platform_admin()) {
}
//end hack
}
$admin_ajax_url = api_get_path(WEB_AJAX_PATH) . 'admin.ajax.php';
$admin_ajax_url = api_get_path(WEB_AJAX_PATH).'admin.ajax.php';
$tpl = new Template();
@ -632,7 +629,7 @@ if (api_is_platform_admin()) {
if (!empty($extraData['block'])) {
//$fileSystem->put('admin/'.$extraData['block'].'_extra.html', $extraData['extra_content']);
header('Location: ' . api_get_self());
header('Location: '.api_get_self());
exit;
}
}

@ -174,7 +174,7 @@ if ($action_todo) {
'picture',
[
get_lang('Add Picture'),
get_lang('The image must have a maximum dimension of 950 x 712 pixelss')
get_lang('The image must have a maximum dimension of 950 x 712 pixelss'),
],
['id' => 'picture', 'class' => 'picture-form', 'crop_image' => true, 'crop_ratio' => '4/3']
);

@ -457,7 +457,7 @@ if ($form->validate()) {
$template
);
$studentBossListSent = isset($user['student_boss']) ? $user['student_boss'] : [];
$studentBossListSent = isset($user['student_boss']) ? $user['student_boss'] : [];
UserManager::subscribeUserToBossList(
$user_id,
$studentBossListSent,

@ -10,7 +10,7 @@ use ChamiloSession as Session;
* @package chamilo.admin
*/
$cidReset = true;
require_once __DIR__ . '/../inc/global.inc.php';
require_once __DIR__.'/../inc/global.inc.php';
api_protect_session_admin_list_users();
@ -32,7 +32,7 @@ if (isset($_GET['user_id']) && $action == 'login_as') {
$userId
);
$url = api_get_path(WEB_PATH) . 'user_portal.php';
$url = api_get_path(WEB_PATH).'user_portal.php';
$goTo = sprintf(get_lang('LoginSuccessfulGoToX'), Display::url($url, $url));
Display::display_header(get_lang('UserList'));
echo Display::return_message($message, 'normal', false);
@ -50,8 +50,8 @@ api_protect_admin_script(true);
trimVariables();
$url = api_get_path(WEB_AJAX_PATH) . 'course.ajax.php?a=get_user_courses';
$urlSession = api_get_path(WEB_AJAX_PATH) . 'session.ajax.php?a=get_user_sessions';
$url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=get_user_courses';
$urlSession = api_get_path(WEB_AJAX_PATH).'session.ajax.php?a=get_user_sessions';
$extraField = new ExtraField('user');
$variables = $extraField->get_all_extra_field_by_type(ExtraField::FIELD_TYPE_TAG);
$variablesSelect = $extraField->get_all_extra_field_by_type(ExtraField::FIELD_TYPE_SELECT);
@ -77,7 +77,7 @@ function load_course_list (div_course,my_user_id) {
beforeSend: function(myObject) {
$("div#"+div_course).html("<img src=\'../inc/lib/javascript/indicator.gif\' />"); },
type: "POST",
url: "' . $url . '",
url: "'.$url.'",
data: "user_id="+my_user_id,
success: function(datos) {
$("div#"+div_course).html(datos);
@ -93,7 +93,7 @@ function load_session_list(div_session, my_user_id) {
beforeSend: function(myObject) {
$("div#"+div_session).html("<img src=\'../inc/lib/javascript/indicator.gif\' />"); },
type: "POST",
url: "' . $urlSession . '",
url: "'.$urlSession.'",
data: "user_id="+my_user_id,
success: function(datos) {
$("div#"+div_session).html(datos);
@ -114,26 +114,26 @@ function active_user(element_div) {
}
user_id=id_image.split("_");
ident="#img_"+user_id[1];
if (confirm("' . get_lang('AreYouSureToEditTheUserStatus', '') . '")) {
if (confirm("'.get_lang('AreYouSureToEditTheUserStatus', '').'")) {
$.ajax({
contentType: "application/x-www-form-urlencoded",
beforeSend: function(myObject) {
$(ident).attr("src","' . Display::returnIconPath('loading1.gif') . '"); }, //candy eye stuff
$(ident).attr("src","'.Display::returnIconPath('loading1.gif').'"); }, //candy eye stuff
type: "GET",
url: "' . api_get_path(WEB_AJAX_PATH) . 'user_manager.ajax.php?a=active_user",
url: "'.api_get_path(WEB_AJAX_PATH).'user_manager.ajax.php?a=active_user",
data: "user_id="+user_id[1]+"&status="+status,
success: function(data) {
if (data == 1) {
$(ident).attr("src", "' . Display::returnIconPath('accept.png', ICON_SIZE_TINY) . '");
$(ident).attr("title","' . get_lang('Lock') . '");
$(ident).attr("src", "'.Display::returnIconPath('accept.png', ICON_SIZE_TINY).'");
$(ident).attr("title","'.get_lang('Lock').'");
}
if (data == 0) {
$(ident).attr("src","' . Display::returnIconPath('error.png') . '");
$(ident).attr("title","' . get_lang('Unlock') . '");
$(ident).attr("src","'.Display::returnIconPath('error.png').'");
$(ident).attr("title","'.get_lang('Unlock').'");
}
if (data == -1) {
$(ident).attr("src", "' . Display::returnIconPath('warning.png') . '");
$(ident).attr("title","' . get_lang('ActionNotAllowed') . '");
$(ident).attr("src", "'.Display::returnIconPath('warning.png').'");
$(ident).attr("title","'.get_lang('ActionNotAllowed').'");
}
}
});
@ -152,10 +152,10 @@ function clear_session_list(div_session) {
function display_advanced_search_form () {
if ($("#advanced_search_form").css("display") == "none") {
$("#advanced_search_form").css("display","block");
$("#img_plus_and_minus").html(\'&nbsp;' . Display::returnFontAwesomeIcon('arrow-down') . ' ' . get_lang('AdvancedSearch') . '\');
$("#img_plus_and_minus").html(\'&nbsp;'.Display::returnFontAwesomeIcon('arrow-down').' '.get_lang('AdvancedSearch').'\');
} else {
$("#advanced_search_form").css("display","none");
$("#img_plus_and_minus").html(\'&nbsp;' . Display::returnFontAwesomeIcon('arrow-right') . ' ' . get_lang('AdvancedSearch') . '\');
$("#img_plus_and_minus").html(\'&nbsp;'.Display::returnFontAwesomeIcon('arrow-right').' '.get_lang('AdvancedSearch').'\');
}
}
@ -174,7 +174,7 @@ $(document).ready(function() {
//Load user calendar
function load_calendar(user_id, month, year) {
var url = "' . api_get_path(WEB_AJAX_PATH) . 'agenda.ajax.php?a=get_user_agenda&user_id=" +user_id + "&month="+month+"&year="+year;
var url = "'.api_get_path(WEB_AJAX_PATH).'agenda.ajax.php?a=get_user_agenda&user_id=" +user_id + "&month="+month+"&year="+year;
$(".modal-body").load(url);
}
</script>';
@ -281,7 +281,7 @@ function prepare_user_sql_query($getCount)
*/
if (isset($_GET['keyword']) && !empty($_GET['keyword'])) {
$keywordFiltered = Database::escape_string("%" . $_GET['keyword'] . "%");
$keywordFiltered = Database::escape_string("%".$_GET['keyword']."%");
$sql .= " WHERE (
u.firstname LIKE '$keywordFiltered' OR
u.lastname LIKE '$keywordFiltered' OR
@ -315,13 +315,13 @@ function prepare_user_sql_query($getCount)
*/
$sql .= " $query_admin_table
WHERE (
u.firstname LIKE '" . Database::escape_string("%" . $keywordListValues['keyword_firstname'] . "%") . "' AND
u.lastname LIKE '" . Database::escape_string("%" . $keywordListValues['keyword_lastname'] . "%") . "' AND
u.username LIKE '" . Database::escape_string("%" . $keywordListValues['keyword_username'] . "%") . "' AND
u.email LIKE '" . Database::escape_string("%" . $keywordListValues['keyword_email'] . "%") . "' AND
u.status LIKE '" . Database::escape_string($keywordListValues['keyword_status']) . "' ";
u.firstname LIKE '".Database::escape_string("%".$keywordListValues['keyword_firstname']."%")."' AND
u.lastname LIKE '".Database::escape_string("%".$keywordListValues['keyword_lastname']."%")."' AND
u.username LIKE '".Database::escape_string("%".$keywordListValues['keyword_username']."%")."' AND
u.email LIKE '".Database::escape_string("%".$keywordListValues['keyword_email']."%")."' AND
u.status LIKE '".Database::escape_string($keywordListValues['keyword_status'])."' ";
if (!empty($keywordListValues['keyword_officialcode'])) {
$sql .= " AND u.official_code LIKE '" . Database::escape_string("%" . $keywordListValues['keyword_officialcode'] . "%") . "' ";
$sql .= " AND u.official_code LIKE '".Database::escape_string("%".$keywordListValues['keyword_officialcode']."%")."' ";
}
$sql .= "
@ -343,7 +343,7 @@ function prepare_user_sql_query($getCount)
$preventSessionAdminsToManageAllUsers = api_get_setting('prevent_session_admins_to_manage_all_users');
if (api_is_session_admin() && $preventSessionAdminsToManageAllUsers === 'true') {
$sql .= " AND u.creator_id = " . api_get_user_id();
$sql .= " AND u.creator_id = ".api_get_user_id();
}
$variables = Session::read('variables_to_show', []);
@ -352,11 +352,11 @@ function prepare_user_sql_query($getCount)
$extraFieldResult = [];
$extraFieldHasData = [];
foreach ($variables as $variable) {
if (isset($_GET['extra_' . $variable])) {
if (is_array($_GET['extra_' . $variable])) {
$values = $_GET['extra_' . $variable];
if (isset($_GET['extra_'.$variable])) {
if (is_array($_GET['extra_'.$variable])) {
$values = $_GET['extra_'.$variable];
} else {
$values = [$_GET['extra_' . $variable]];
$values = [$_GET['extra_'.$variable]];
}
if (empty($values)) {
@ -402,7 +402,7 @@ function prepare_user_sql_query($getCount)
}
if (!empty($extraFieldHasData)) {
$sql .= " AND (u.id IN ('" . implode("','", $extraFieldResult) . "')) ";
$sql .= " AND (u.id IN ('".implode("','", $extraFieldResult)."')) ";
}
}
@ -410,7 +410,7 @@ function prepare_user_sql_query($getCount)
if ((api_is_platform_admin() || api_is_session_admin()) &&
api_get_multiple_access_url()
) {
$sql .= " AND url_rel_user.access_url_id=" . api_get_current_access_url_id();
$sql .= " AND url_rel_user.access_url_id=".api_get_current_access_url_id();
}
return $sql;
@ -468,9 +468,9 @@ function get_user_data($from, $number_of_items, $column, $direction)
);
$is_admin = in_array($user[0], $_admins_list);
$photo = '<img
src="' . $userPicture . '" class="rounded-circle avatar"
alt="' . api_get_person_name($user[2], $user[3]) . '"
title="' . api_get_person_name($user[2], $user[3]) . '" />';
src="'.$userPicture.'" class="rounded-circle avatar"
alt="'.api_get_person_name($user[2], $user[3]).'"
title="'.api_get_person_name($user[2], $user[3]).'" />';
if ($user[7] == 1 && !empty($user[10])) {
// check expiration date
@ -508,7 +508,7 @@ function get_user_data($from, $number_of_items, $column, $direction)
if ($action === 'edit') {
$iconActive = Display::return_icon(
$image . '.png',
$image.'.png',
get_lang('AccountExpired'),
[],
16
@ -518,15 +518,15 @@ function get_user_data($from, $number_of_items, $column, $direction)
// accounts including your own => everybody is locked out and nobody
// can change it anymore.
$iconActive = Display::return_icon(
$image . '.png',
$image.'.png',
get_lang(ucfirst($action)),
['onclick' => 'active_user(this);', 'id' => 'img_' . $user['0']],
['onclick' => 'active_user(this);', 'id' => 'img_'.$user['0']],
16
);
}
$profile = '<div class="avatar-user">' . $photo . '<span class="is-admin">'
. $iconAdmin . '</span><span class="is-active">' . $iconActive . '</span></div>';
$profile = '<div class="avatar-user">'.$photo.'<span class="is-admin">'
.$iconAdmin.'</span><span class="is-active">'.$iconActive.'</span></div>';
// forget about the expiration date field
$users[] = [
@ -546,7 +546,6 @@ function get_user_data($from, $number_of_items, $column, $direction)
return $users;
}
/**
* Returns a mailto-link.
*
@ -562,15 +561,15 @@ function email_filter($email)
/**
* Returns a mailto-link.
*
* @param string $email An email-address
* @param array $params Deprecated
* @param array $row
* @param string $email An email-address
* @param array $params Deprecated
* @param array $row
*
* @return string HTML-code with a mailto-link
*/
function user_filter($name, $params, $row)
{
return '<a href="' . api_get_path(WEB_PATH) . 'whoisonline.php?origin=user_list&id=' . $row[0] . '">' . $name . '</a>';
return '<a href="'.api_get_path(WEB_PATH).'whoisonline.php?origin=user_list&id='.$row[0].'">'.$name.'</a>';
}
/**
@ -586,7 +585,6 @@ function user_filter($name, $params, $row)
*/
function modify_filter($user_id, $url_params, $row)
{
$statusname = api_get_status_langvars();
$user_is_anonymous = false;
$current_user_status_label = $row['7'];
@ -599,21 +597,21 @@ function modify_filter($user_id, $url_params, $row)
$icon = Display::return_icon(
'course.png',
get_lang('Courses'),
['onmouseout' => 'clear_course_list (\'div_' . $user_id . '\')']
['onmouseout' => 'clear_course_list (\'div_'.$user_id.'\')']
);
$result .= '<a href="javascript:void(0)" onclick="load_course_list(\'div_' . $user_id . '\',' . $user_id . ')" >
' . $icon . '
<div class="blackboard_hide" id="div_' . $user_id . '"></div>
$result .= '<a href="javascript:void(0)" onclick="load_course_list(\'div_'.$user_id.'\','.$user_id.')" >
'.$icon.'
<div class="blackboard_hide" id="div_'.$user_id.'"></div>
</a>';
$icon = Display::return_icon(
'session.png',
get_lang('Sessions'),
['onmouseout' => 'clear_session_list (\'div_s_' . $user_id . '\')']
['onmouseout' => 'clear_session_list (\'div_s_'.$user_id.'\')']
);
$result .= '<a href="javascript:void(0)" onclick="load_session_list(\'div_s_' . $user_id . '\',' . $user_id . ')" >
' . $icon . '
<div class="blackboard_hide" id="div_s_' . $user_id . '"></div>
$result .= '<a href="javascript:void(0)" onclick="load_session_list(\'div_s_'.$user_id.'\','.$user_id.')" >
'.$icon.'
<div class="blackboard_hide" id="div_s_'.$user_id.'"></div>
</a>';
} else {
$result .= Display::return_icon('course_na.png', get_lang('Courses'));
@ -622,8 +620,8 @@ function modify_filter($user_id, $url_params, $row)
if (api_is_platform_admin()) {
if (!$user_is_anonymous) {
$result .= '<a href="user_information.php?user_id=' . $user_id . '">' .
Display::return_icon('info2.png', get_lang('Info')) . '</a>';
$result .= '<a href="user_information.php?user_id='.$user_id.'">'.
Display::return_icon('info2.png', get_lang('Info')).'</a>';
} else {
$result .= Display::return_icon('info2_na.png', get_lang('Info'));
}
@ -643,8 +641,8 @@ function modify_filter($user_id, $url_params, $row)
if (api_is_platform_admin() || $sessionAdminCanLoginAs) {
if (!$user_is_anonymous) {
if (api_global_admin_can_edit_admin($user_id, null, $sessionAdminCanLoginAs)) {
$result .= '<a href="user_list.php?action=login_as&user_id=' . $user_id . '&sec_token=' . Security::getTokenFromSession() . '">' .
Display::return_icon('login_as.png', get_lang('LoginAs')) . '</a>';
$result .= '<a href="user_list.php?action=login_as&user_id='.$user_id.'&sec_token='.Security::getTokenFromSession().'">'.
Display::return_icon('login_as.png', get_lang('LoginAs')).'</a>';
} else {
$result .= Display::return_icon('login_as_na.png', get_lang('LoginAs'));
}
@ -661,8 +659,8 @@ function modify_filter($user_id, $url_params, $row)
get_lang('Reporting')
);
} else {
$result .= '<a href="../mySpace/myStudents.php?student=' . $user_id . '">' .
Display::return_icon('statistics.png', get_lang('Reporting')) .
$result .= '<a href="../mySpace/myStudents.php?student='.$user_id.'">'.
Display::return_icon('statistics.png', get_lang('Reporting')).
'</a>';
}
@ -671,13 +669,13 @@ function modify_filter($user_id, $url_params, $row)
if (!$user_is_anonymous &&
api_global_admin_can_edit_admin($user_id, null, true)
) {
$result .= '<a href="' . $editProfileUrl . '">' .
$result .= '<a href="'.$editProfileUrl.'">'.
Display::return_icon(
'edit.png',
get_lang('Edit'),
[],
ICON_SIZE_SMALL
) .
).
'</a>';
} else {
$result .= Display::return_icon(
@ -685,7 +683,7 @@ function modify_filter($user_id, $url_params, $row)
get_lang('Edit'),
[],
ICON_SIZE_SMALL
) . '</a>';
).'</a>';
}
}
@ -699,7 +697,7 @@ function modify_filter($user_id, $url_params, $row)
null,
ICON_SIZE_SMALL
),
api_get_path(WEB_CODE_PATH) . 'badge/assign.php?' . http_build_query(['user' => $user_id])
api_get_path(WEB_CODE_PATH).'badge/assign.php?'.http_build_query(['user' => $user_id])
);
}
@ -757,37 +755,37 @@ function modify_filter($user_id, $url_params, $row)
api_global_admin_can_edit_admin($user_id, null, true)
) {
// you cannot lock yourself out otherwise you could disable all the accounts including your own => everybody is locked out and nobody can change it anymore.
$result .= ' <a href="user_list.php?action=delete_user&user_id=' . $user_id . '&' . $url_params . '&sec_token=' . Security::getTokenFromSession() . '" onclick="javascript:if(!confirm(' . "'" . addslashes(api_htmlentities(get_lang("ConfirmYourChoice"))) . "'" . ')) return false;">' .
$result .= ' <a href="user_list.php?action=delete_user&user_id='.$user_id.'&'.$url_params.'&sec_token='.Security::getTokenFromSession().'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice")))."'".')) return false;">'.
Display::return_icon(
'delete.png',
get_lang('Delete'),
[],
ICON_SIZE_SMALL
) .
).
'</a>';
}
}
if (api_is_platform_admin()) {
$result .= ' <a data-title="' . get_lang('FreeBusyCalendar') . '" href="' . api_get_path(WEB_AJAX_PATH) . 'agenda.ajax.php?a=get_user_agenda&user_id=' . $user_id . '&modal_size=lg" class="agenda_opener ajax">' .
$result .= ' <a data-title="'.get_lang('FreeBusyCalendar').'" href="'.api_get_path(WEB_AJAX_PATH).'agenda.ajax.php?a=get_user_agenda&user_id='.$user_id.'&modal_size=lg" class="agenda_opener ajax">'.
Display::return_icon(
'calendar.png',
get_lang('FreeBusyCalendar'),
[],
ICON_SIZE_SMALL
) .
).
'</a>';
if ($user_id != api_get_user_id() &&
!$user_is_anonymous &&
api_global_admin_can_edit_admin($user_id)
) {
$result .= ' <a href="user_list.php?action=anonymize&user_id=' . $user_id . '&' . $url_params . '&sec_token=' . Security::getTokenFromSession() . '" onclick="javascript:if(!confirm(' . "'" . addslashes(api_htmlentities(get_lang("ConfirmYourChoice"))) . "'" . ')) return false;">' .
$result .= ' <a href="user_list.php?action=anonymize&user_id='.$user_id.'&'.$url_params.'&sec_token='.Security::getTokenFromSession().'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice")))."'".')) return false;">'.
Display::return_icon(
'anonymous.png',
get_lang('Anonymize'),
[],
ICON_SIZE_SMALL
) .
).
'</a>';
}
@ -799,13 +797,13 @@ function modify_filter($user_id, $url_params, $row)
) {
// you cannot lock yourself out otherwise you could disable all the accounts
// including your own => everybody is locked out and nobody can change it anymore.
$result .= ' <a href="user_list.php?action=delete_user&user_id=' . $user_id . '&' . $url_params . '&sec_token=' . Security::getTokenFromSession() . '" onclick="javascript:if(!confirm(' . "'" . addslashes(api_htmlentities(get_lang("ConfirmYourChoice"))) . "'" . ')) return false;">' .
$result .= ' <a href="user_list.php?action=delete_user&user_id='.$user_id.'&'.$url_params.'&sec_token='.Security::getTokenFromSession().'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice")))."'".')) return false;">'.
Display::return_icon(
'delete.png',
get_lang('Delete'),
[],
ICON_SIZE_SMALL
) .
).
'</a>';
} else {
$result .= Display::return_icon(
@ -828,9 +826,9 @@ function modify_filter($user_id, $url_params, $row)
*
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
*
* @param int $active the current state of the account
* @param int $active the current state of the account
* @param string $params
* @param array $row
* @param array $row
*
* @return string Some HTML-code with the lock/unlock button
*/
@ -853,7 +851,7 @@ function active_filter($active, $params, $row)
if ($action === 'edit') {
$result = Display::return_icon(
$image . '.png',
$image.'.png',
get_lang('AccountExpired'),
[],
16
@ -863,9 +861,9 @@ function active_filter($active, $params, $row)
// accounts including your own => everybody is locked out and nobody
// can change it anymore.
$result = Display::return_icon(
$image . '.png',
$image.'.png',
get_lang(ucfirst($action)),
['onclick' => 'active_user(this);', 'id' => 'img_' . $row['0']],
['onclick' => 'active_user(this);', 'id' => 'img_'.$row['0']],
16
);
}
@ -911,14 +909,14 @@ if (!empty($action)) {
$result = UrlManager::add_user_to_url($user_id, $urlId);
if ($result) {
$user_info = api_get_user_info($user_id);
$message = get_lang('UserAdded') . ' ' . $user_info['complete_name_with_username'];
$message = get_lang('UserAdded').' '.$user_info['complete_name_with_username'];
$message = Display::return_message($message, 'confirmation');
}
break;
case 'delete_user':
$message = UserManager::deleteUserWithVerification($_GET['user_id']);
Display::addFlash($message);
header('Location: ' . api_get_self());
header('Location: '.api_get_self());
exit;
break;
case 'delete':
@ -1002,7 +1000,7 @@ if (!empty($action)) {
case 'anonymize':
$message = UserManager::anonymizeUserWithVerification($_GET['user_id']);
Display::addFlash($message);
header('Location: ' . api_get_self());
header('Location: '.api_get_self());
exit;
break;
}
@ -1026,15 +1024,15 @@ $searchAdvanced = '
<a id="advanced_params" href="javascript://"
class="btn btn-light advanced_options" onclick="display_advanced_search_form();">
<span id="img_plus_and_minus">&nbsp;
' . Display::returnFontAwesomeIcon('arrow-right') . ' ' . get_lang('AdvancedSearch') . '
'.Display::returnFontAwesomeIcon('arrow-right').' '.get_lang('AdvancedSearch').'
</span>
</a>';
$actionsLeft = '';
$actionsCenter = '';
$actionsRight = '';
if (api_is_platform_admin()) {
$actionsRight .= '<a class="float-right" href="' . api_get_path(WEB_CODE_PATH) . 'admin/user_add.php">' .
Display::return_icon('new_user.png', get_lang('AddUsers'), '', ICON_SIZE_MEDIUM) . '</a>';
$actionsRight .= '<a class="float-right" href="'.api_get_path(WEB_CODE_PATH).'admin/user_add.php">'.
Display::return_icon('new_user.png', get_lang('AddUsers'), '', ICON_SIZE_MEDIUM).'</a>';
}
$actionsLeft .= $form->returnForm();
@ -1100,7 +1098,7 @@ $data = $extraField->addElements($form, 0, [], true, false, $variablesToShow);
$htmlHeadXtra[] = '
<script>
$(document).ready(function() {
' . $data['jquery_ready_content'] . '
'.$data['jquery_ready_content'].'
})
</script>
';
@ -1195,15 +1193,15 @@ if ($table->get_total_number_of_items() == 0) {
if ($urlId == $url_info['access_url_id']) {
$add_user = false;
}
$access_info_to_string .= $url_info['url'] . '<br />';
$access_info_to_string .= $url_info['url'].'<br />';
}
}
if ($add_user) {
$row_table = [];
$row_table[] = api_get_person_name($user['firstname'],
$user['lastname']) . ' (' . $user['username'] . ') ';
$user['lastname']).' ('.$user['username'].') ';
$row_table[] = $access_info_to_string;
$url = api_get_self() . '?action=add_user_to_my_url&user_id=' . $user['id'] . '&sec_token=' . Security::getTokenFromSession();
$url = api_get_self().'?action=add_user_to_my_url&user_id='.$user['id'].'&sec_token='.Security::getTokenFromSession();
$row_table[] = Display::url(
get_lang('AddUserToMyURL'),
$url,

@ -21,7 +21,7 @@ use Chamilo\CoreBundle\Repository\CourseCategoryRepository;
// Flag forcing the "current course" reset.
$cidReset = true;
require_once __DIR__ . '/../inc/global.inc.php';
require_once __DIR__.'/../inc/global.inc.php';
// Check access rights.
if (!api_is_allowed_to_create_course()) {
@ -58,7 +58,7 @@ $htmlHeadXtra[] = '<script>
</script>';
$interbreadcrumb[] = [
'url' => api_get_path(WEB_PATH) . 'user_portal.php',
'url' => api_get_path(WEB_PATH).'user_portal.php',
'name' => get_lang('MyCourses'),
];
@ -93,12 +93,12 @@ $form->addElement(
$form->addFile(
'picture',
[
get_lang('AddPicture')
get_lang('AddPicture'),
],
[
'id' => 'picture',
'class' => 'picture-form',
'crop_image' => true
'crop_image' => true,
]
);
@ -106,7 +106,7 @@ $allowed_picture_types = api_get_supported_image_extensions(false);
$form->addRule(
'picture',
get_lang('OnlyImagesAllowed') . ' (' . implode(',', $allowed_picture_types) . ')',
get_lang('OnlyImagesAllowed').' ('.implode(',', $allowed_picture_types).')',
'filetype',
$allowed_picture_types
);
@ -118,7 +118,7 @@ $countCategories = $courseCategoriesRepo->countAllInAccessUrl(
if ($countCategories >= 100) {
// Category code
$url = api_get_path(WEB_AJAX_PATH) . 'course.ajax.php?a=search_category';
$url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=search_category';
$form->addElement(
'select_ajax',
'category_code',
@ -229,7 +229,7 @@ if ($course_validation_feature) {
// if it is activated.
if (empty($terms_and_conditions_url)) {
if (api_get_setting('allow_terms_conditions') === 'true') {
$terms_and_conditions_url = api_get_path(WEB_CODE_PATH) . 'auth/inscription.php?legal';
$terms_and_conditions_url = api_get_path(WEB_CODE_PATH).'auth/inscription.php?legal';
}
}
@ -277,7 +277,7 @@ if (api_get_setting('teacher_can_select_course_template') === 'true') {
get_lang('PickACourseAsATemplateForThisNewCourse'),
],
null,
['url' => api_get_path(WEB_AJAX_PATH) . 'course.ajax.php?a=search_course']
['url' => api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=search_course']
);
}
@ -340,8 +340,8 @@ if ($form->validate()) {
$params['gradebook_model_id'] = isset($course_values['gradebook_model_id']) ? $course_values['gradebook_model_id'] : null;
$params['course_template'] = isset($course_values['course_template']) ? $course_values['course_template'] : '';
include_once api_get_path(SYS_CODE_PATH) . 'lang/english/trad4all.inc.php';
$file_to_include = api_get_path(SYS_CODE_PATH) . 'lang/' . $course_language . '/trad4all.inc.php';
include_once api_get_path(SYS_CODE_PATH).'lang/english/trad4all.inc.php';
$file_to_include = api_get_path(SYS_CODE_PATH).'lang/'.$course_language.'/trad4all.inc.php';
if (file_exists($file_to_include)) {
include $file_to_include;
@ -350,7 +350,6 @@ if ($form->validate()) {
$course_info = CourseManager::create_course($params);
if (!empty($course_info)) {
// update course picture
$picture = $_FILES['picture'];
if (!empty($picture['name'])) {
@ -378,13 +377,13 @@ if ($form->validate()) {
$splash = api_get_setting('course_creation_splash_screen');
if ($splash === 'true') {
$url = api_get_path(WEB_CODE_PATH);
$url .= 'course_info/start.php?' . api_get_cidreq_params($course_info['code']);
$url .= 'course_info/start.php?'.api_get_cidreq_params($course_info['code']);
$url .= '&first=1';
header('Location: ' . $url);
header('Location: '.$url);
exit;
} else {
$url = api_get_path(WEB_COURSE_PATH) . $course_info['directory'] . '/';
header('Location: ' . $url);
$url = api_get_path(WEB_COURSE_PATH).$course_info['directory'].'/';
header('Location: '.$url);
exit;
}
} else {
@ -412,7 +411,7 @@ if ($form->validate()) {
if ($request_id) {
$course_request_info = CourseRequestManager::get_course_request_info($request_id);
$message = (is_array($course_request_info) ? '<strong>' . $course_request_info['code'] . '</strong> : ' : '') . get_lang('CourseRequestCreated');
$message = (is_array($course_request_info) ? '<strong>'.$course_request_info['code'].'</strong> : ' : '').get_lang('CourseRequestCreated');
$message = Display::return_message(
$message,
'confirmation',
@ -422,7 +421,7 @@ if ($form->validate()) {
'div',
Display::url(
get_lang('Enter'),
api_get_path(WEB_PATH) . 'user_portal.php',
api_get_path(WEB_PATH).'user_portal.php',
['class' => 'btn btn-primary']
),
['style' => 'float: left; margin:0px; padding: 0px;']
@ -454,7 +453,6 @@ if ($form->validate()) {
$formContent = $form->returnForm();
}
$tpl->assign('form', $formContent);
$layout = $tpl->fetch($tpl->get_template('create_course/add_course.html.twig'));
$tpl->assign('message', $message);

@ -5273,7 +5273,7 @@ class Exercise
}
if ($debug > 0) {
error_log(__LINE__.' - answerId is >1 so we\'re probably in OAR', 0);
}
}
$delineation_cord = $objAnswerTmp->selectHotspotCoordinates($answerId);
$poly_answer = convert_coordinates($delineation_cord, '|');
$max_coord = poly_get_max($poly_user, $poly_answer);

@ -197,7 +197,7 @@ if ($form->validate()) {
}
$lp_id = (int) $lp_id;
echo "<a href=\"../lp/lp_controller.php?".api_get_cidreq()."&gradebook=&action=add_item&type=step&lp_id=".$lp_id."#resource_tab-2\">".Display::return_icon('back.png', get_lang("BackTo").' '.get_lang("LearningPaths"), '', ICON_SIZE_MEDIUM)."</a>";
Display::return_icon('back.png', get_lang("BackTo").' '.get_lang("LearningPaths"), '', ICON_SIZE_MEDIUM)."</a>";
Display::return_icon('back.png', get_lang("BackTo").' '.get_lang("LearningPaths"), '', ICON_SIZE_MEDIUM)."</a>";
} else {
echo '<a href="exercise.php?'.api_get_cidreq().'">'.
Display::return_icon('back.png', get_lang('BackToExercisesList'), '', ICON_SIZE_MEDIUM).

@ -34,7 +34,7 @@ if (!api_is_allowed_to_edit(null, true)) {
if (empty($exeId)) {
api_not_allowed();
}
if (empty($trackExerciseInfo)) {
api_not_allowed();
}

@ -4348,8 +4348,8 @@ function send_notification_mails($forumId, $thread_id, $reply_info)
* be new posts and the user might have indicated that (s)he wanted to be
* informed about the new posts by mail.
*
* @param string $content Content type (post, thread, forum, forum_category)
* @param int $id Item DB ID of the corresponding content type
* @param string $content Content type (post, thread, forum, forum_category)
* @param int $id Item DB ID of the corresponding content type
*
* @return string language variable
*

@ -536,7 +536,8 @@ function email_filter($email)
return Display::encrypted_mailto_link($email, $email);
}
function activeFilter($isActive) {
function activeFilter($isActive)
{
if ($isActive) {
return Display::return_icon('accept.png', get_lang('Active'), [], ICON_SIZE_TINY);
}

@ -79,11 +79,10 @@ if ($form->validate()) {
$text,
api_get_person_name($_user['firstname'], $_user['lastname']),
'',
['reply_to' =>
[
['reply_to' => [
'mail' => $_user['mail'],
'name' => api_get_person_name($_user['firstname'], $_user['lastname'])
]
'name' => api_get_person_name($_user['firstname'], $_user['lastname']),
],
]
);
} else {

@ -56,10 +56,10 @@ if (!empty($courseId)) {
$config = [
'ToolbarSet' => 'Basic',
'Width' => '100%',
'Height' => '300'
'Height' => '300',
];
$form->addHtmlEditor('intro_content', null, false, false, $config, ['card-full'=>true]);
$form->addHtmlEditor('intro_content', null, false, false, $config, ['card-full' => true]);
$form->addButtonSave(get_lang('SaveIntroText'), 'intro_cmdUpdate');
/* INTRODUCTION MICRO MODULE - COMMANDS SECTION (IF ALLOWED) */
@ -375,7 +375,7 @@ if ($intro_dispDefault) {
'id' => 'introduction-tool',
'name' => $nameSection,
'help' => $helpSection,
'text' => $intro_content
'text' => $intro_content,
];
} else {
if (api_is_allowed_to_edit()) {
@ -383,7 +383,7 @@ if ($intro_dispDefault) {
'id' => 'introduction-course',
'name' => $nameSection,
'help' => $helpSection,
'text' => $intro_content
'text' => $intro_content,
];
}
}

@ -46,7 +46,7 @@ function getCustomTabs()
/**
* Return the active logo of the portal, based on a series of settings.
*
* @param string $theme The name of the theme folder from web/css/themes/
* @param string $theme The name of the theme folder from web/css/themes/
* @param bool $responsive add class img-responsive
*
* @return string HTML string with logo as an HTML element

@ -660,9 +660,10 @@ class Display
}
// Return encrypted mailto hyperlink
$classCut = '';
if($cut){
if ($cut) {
$classCut = 'cut-email';
}
return '<a href="'.$hmail.'"'.$style_class.' class="clickable_email_link '.$classCut.'">'.$hclickable_text.'</a>';
}

@ -285,8 +285,9 @@ class DocumentManager
return 'application/octet-stream';
}
/**
* This function smart streams a file to the client using HTTP headers
/**
* This function smart streams a file to the client using HTTP headers.
*
* @param string $fullFilename The full path of the file to be sent
* @param string $filename The name of the file as shown to the client
@ -294,25 +295,27 @@ class DocumentManager
*
* @return bool false if file doesn't exist, true if stream succeeded
*/
public static function smartReadFile($fullFilename, $filename, $contentType = 'application/octet-stream')
{
public static function smartReadFile($fullFilename, $filename, $contentType = 'application/octet-stream')
{
if (!file_exists($fullFilename)) {
header ("HTTP/1.1 404 Not Found");
header("HTTP/1.1 404 Not Found");
return false;
}
$size = filesize($fullFilename);
$time = date('r', filemtime($fullFilename));
$fm = @fopen($fullFilename, 'rb');
if (!$fm) {
header ("HTTP/1.1 505 Internal server error");
header("HTTP/1.1 505 Internal server error");
return false;
}
$begin = 0;
$end = $size - 1;
if (isset($_SERVER['HTTP_RANGE'])) {
if (preg_match('/bytes=\h*(\d+)-(\d*)[\D.*]?/i', $_SERVER['HTTP_RANGE'], $matches)) {
$begin = intval($matches[1]);
@ -321,33 +324,34 @@ class DocumentManager
}
}
}
if (isset($_SERVER['HTTP_RANGE'])) {
header('HTTP/1.1 206 Partial Content');
} else {
header('HTTP/1.1 200 OK');
}
header("Content-Type: $contentType");
header("Content-Type: $contentType");
header('Cache-Control: public, must-revalidate, max-age=0');
header('Pragma: no-cache');
header('Pragma: no-cache');
header('Accept-Ranges: bytes');
header('Content-Length:' . (($end - $begin) + 1));
header('Content-Length:'.(($end - $begin) + 1));
if (isset($_SERVER['HTTP_RANGE'])) {
header("Content-Range: bytes $begin-$end/$size");
}
header("Content-Disposition: inline; filename=$filename");
header("Content-Transfer-Encoding: binary");
header("Last-Modified: $time");
$cur = $begin;
fseek($fm, $begin, 0);
while(!feof($fm) && $cur <= $end && (connection_status() == 0)) {
print fread($fm, min(1024 * 16, ($end - $cur) + 1));
while (!feof($fm) && $cur <= $end && (connection_status() == 0)) {
echo fread($fm, min(1024 * 16, ($end - $cur) + 1));
$cur += 1024 * 16;
}
}
/**
* This function streams a file to the client.
*
@ -444,16 +448,16 @@ class DocumentManager
}
}
break;
case 'video/mp4':
case 'audio/mpeg':
case 'audio/mp4':
case 'audio/ogg':
case 'audio/webm':
case 'audio/wav':
case 'video/ogg':
case 'video/webm':
self::smartReadFile($full_file_name,$filename,$contentType);
exit;
case 'video/mp4':
case 'audio/mpeg':
case 'audio/mp4':
case 'audio/ogg':
case 'audio/webm':
case 'audio/wav':
case 'video/ogg':
case 'video/webm':
self::smartReadFile($full_file_name, $filename, $contentType);
exit;
case 'application/vnd.dwg':
case 'application/vnd.dwf':
header('Content-type: application/octet-stream');
@ -3590,11 +3594,11 @@ class DocumentManager
}
/**
* @param int $doc_id
* @param int $doc_id
* @param array $courseInfo
* @param int $sessionId
* @param int $user_id
* @param int $groupId iid
* @param int $user_id
* @param int $groupId iid
* @param bool $checkParentVisibility
*
* @return bool
@ -5622,7 +5626,7 @@ class DocumentManager
// Cannot copy dir into his own subdir
$path_displayed = self::get_titles_of_path($folder);
$display_folder = substr($path_displayed, strlen($group_dir));
$display_folder = ($display_folder == '') ? get_lang('Documents') : $display_folder;
$display_folder = ($display_folder == '') ? get_lang('Documents') : $display_folder;
$options[$folder] = $display_folder;
}
}

@ -1,8 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CoreBundle\Entity\TrackEExercises;
use Chamilo\CoreBundle\Framework\Container;
use ChamiloSession as Session;
/**
@ -4847,7 +4847,7 @@ EOT;
}
/**
* Display the ranking of results in a exercise
* Display the ranking of results in a exercise.
*
* @param int $exerciseId
* @param int $currentUserId
@ -4893,7 +4893,7 @@ EOT;
/**
* Get the ranking for results in a exercise.
* Function used internally by ExerciseLib::displayResultsInRanking
* Function used internally by ExerciseLib::displayResultsInRanking.
*
* @param int $exerciseId
* @param int $courseId
@ -4944,7 +4944,7 @@ EOT;
$data = array_map(
function ($item) use (&$lastScore, &$position) {
if ($item['exe_result'] < $lastScore) {
++$position;
$position++;
}
$lastScore = $item['exe_result'];

@ -999,11 +999,12 @@ EOT;
* Adds a HTML-editor to the form.
*
* @param string $name
* @param string $label The label for the form-element
* @param bool $required (optional) Is the form-element required (default=true)
* @param bool $fullPage (optional) When it is true, the editor loads completed html code for a full page
* @param array $config (optional) Configuration settings for the online editor
* @param array $attributes
* @param string $label The label for the form-element
* @param bool $required (optional) Is the form-element required (default=true)
* @param bool $fullPage (optional) When it is true, the editor loads completed html code for a full page
* @param array $config (optional) Configuration settings for the online editor
* @param array $attributes
*
* @throws Exception
* @throws HTML_QuickForm_Error
*/

@ -1,8 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
use Chamilo\CourseBundle\Entity\CGroupRelUser;
/**
* This library contains some functions for group-management.
*
@ -1320,7 +1318,7 @@ class GroupManager
/**
* Get only students from a group (not tutors).
*
* @param int $group_id iid
* @param int $group_id iid
* @param bool $filterOnlyActive
*
* @return array

@ -577,7 +577,7 @@ class SortableTable extends HTML_Table
$nav = $pager_links['first'].' '.$pager_links['back'];
$nav .= '<div class="btn btn-outline-secondary">'.$pager->getCurrentPageId().' / '.$pager->numPages().' </div>';
$nav .= $pager_links['next'].' '.$pager_links['last'];
$html = Display::tag('div',$nav,['class'=>'btn-group btn-group-sm', 'role' => 'group']);
$html = Display::tag('div', $nav, ['class' => 'btn-group btn-group-sm', 'role' => 'group']);
return $html;
}

@ -1894,8 +1894,8 @@ class Tracking
$where_condition = ' AND access_date < "'.$last_access.'" ';
}
$tbl_track_e_access = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ACCESS);
$sql = 'SELECT access_date
$tbl_track_e_access = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ACCESS);
$sql = 'SELECT access_date
FROM '.$tbl_track_e_access.'
WHERE access_user_id = '.$student_id.' AND
c_id = "'.$courseId.'" AND
@ -1903,17 +1903,17 @@ class Tracking
ORDER BY access_date DESC
LIMIT 0,1';
$rs = Database::query($sql);
if (Database::num_rows($rs) > 0) {
if ($last_login_date = Database::result($rs, 0, 0)) {
if (empty($last_login_date)) {
return false;
}
//see #5736
$last_login_date_timestamp = api_strtotime($last_login_date);
$now = time();
//If the last connection is > than 7 days, the text is red
//345600 = 7 days in seconds
$rs = Database::query($sql);
if (Database::num_rows($rs) > 0) {
if ($last_login_date = Database::result($rs, 0, 0)) {
if (empty($last_login_date)) {
return false;
}
//see #5736
$last_login_date_timestamp = api_strtotime($last_login_date);
$now = time();
//If the last connection is > than 7 days, the text is red
//345600 = 7 days in seconds
/*
if ($now - $last_login_date_timestamp > 604800) {
if ($convert_date) {
@ -1960,8 +1960,8 @@ class Tracking
//345600 = 7 days in seconds
if ($now - $last_login_date_timestamp > 604800) {
if ($convert_date) {
$last_login_date = api_convert_and_format_date($last_login_date, DATE_FORMAT_SHORT);
$icon = api_is_allowed_to_edit() ?
$last_login_date = api_convert_and_format_date($last_login_date, DATE_FORMAT_SHORT);
$icon = api_is_allowed_to_edit() ?
'<a href="'.api_get_path(
WEB_CODE_PATH
).'announcements/announcements.php?action=add&remind_inactive='.$student_id.'&cidReq='.$courseInfo['code'].'" title="'.get_lang(
@ -1979,7 +1979,7 @@ class Tracking
if ($convert_date) {
return api_convert_and_format_date($last_login_date, DATE_FORMAT_SHORT);
} else {
return $last_login_date;
return $last_login_date;
}
}
}
@ -5803,7 +5803,7 @@ class Tracking
if (!$learnpath['lp_visibility']) {
continue;
}
$progress = self::get_avg_student_progress(
$user_id,
$course,
@ -5935,23 +5935,23 @@ class Tracking
public static function generate_session_exercise_graph($names, $my_results, $average)
{
$cdnChartJs = 'https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.3/Chart.min.js';
$html .= Display::tag('script', '', array('src' => $cdnChartJs));
$canvas = Display::tag('canvas', '', array('id' => 'session_graph_chart'));
$html .= Display::tag('div',$canvas, array('style' => 'width:100%'));
$html .= Display::tag('script', '', ['src' => $cdnChartJs]);
$canvas = Display::tag('canvas', '', ['id' => 'session_graph_chart']);
$html .= Display::tag('div', $canvas, ['style' => 'width:100%']);
$jsStr = " var data = {
labels:". json_encode($names).",
labels:".json_encode($names).",
datasets: [
{
label: '".get_lang('MyResults')."',
backgroundColor: 'rgb(255, 99, 132)',
stack: 'Stack1',
data: ". json_encode($my_results).",
data: ".json_encode($my_results).",
},
{
label: '".get_lang('AverageScore')."',
backgroundColor: 'rgb(75, 192, 192)',
stack: 'Stack2',
data: ". json_encode($average).",
data: ".json_encode($average).",
},
],
};
@ -5982,6 +5982,7 @@ class Tracking
}
});";
$html .= Display::tag('script', $jsStr);
return $html;
}
@ -6354,7 +6355,7 @@ class Tracking
$myCache->saveFromCache($chartHash, $imgPath);
$imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash;
}
return $imgPath;
}

@ -1359,10 +1359,10 @@ class UserGroup extends Model
* Note: This method relies on configuration setting from main/inc/conf/profile.conf.php.
*
* @param int The group id
* @param string $file The common file name for the newly created photos.
* It will be checked and modified for compatibility with the file system.
* If full name is provided, path component is ignored.
* If an empty name is provided, then old user photos are deleted only,
* @param string $file The common file name for the newly created photos.
* It will be checked and modified for compatibility with the file system.
* If full name is provided, path component is ignored.
* If an empty name is provided, then old user photos are deleted only,
*
* @see UserManager::delete_user_picture() as the prefered way for deletion.
*

@ -2,7 +2,6 @@
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\Message;
use Chamilo\CourseBundle\Entity\CLp;
use Chamilo\CourseBundle\Entity\CLpCategory;
use ChamiloSession as Session;

@ -6076,7 +6076,7 @@ class Wiki
get_lang('RecentChanges'),
'',
ICON_SIZE_MEDIUM
) .'</a>';
).'</a>';
echo Display::toolbarAction('toolbar-wiki', [$actionsLeft]);
}

@ -12,5 +12,4 @@ use Symfony\Component\HttpKernel\Bundle\Bundle;
*/
class ChamiloGraphQlBundle extends Bundle
{
}

@ -3,9 +3,9 @@
namespace Chamilo\GraphQlBundle\Map;
use Chamilo\CourseBundle\Entity\CTool;
use Chamilo\GraphQlBundle\Resolver\CourseResolver;
use Chamilo\GraphQlBundle\Traits\GraphQLTrait;
use Chamilo\CourseBundle\Entity\CTool;
use Overblog\GraphQLBundle\Resolver\ResolverMap;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;

@ -3,13 +3,12 @@
namespace Chamilo\GraphQlBundle\Map;
use Chamilo\CoreBundle\Security\Authorization\Voter\SessionVoter;
use Chamilo\GraphQlBundle\Traits\GraphQLTrait;
use Chamilo\CoreBundle\Entity\Course;
use Chamilo\CoreBundle\Entity\Message;
use Chamilo\CoreBundle\Entity\Session;
use Chamilo\CoreBundle\Entity\SessionCategory;
use Chamilo\CoreBundle\Security\Authorization\Voter\CourseVoter;
use Chamilo\CoreBundle\Security\Authorization\Voter\SessionVoter;
use Chamilo\CourseBundle\Entity\CForumCategory;
use Chamilo\CourseBundle\Entity\CForumForum;
use Chamilo\CourseBundle\Entity\CForumPost;
@ -17,6 +16,7 @@ use Chamilo\CourseBundle\Entity\CForumThread;
use Chamilo\CourseBundle\Entity\CLpCategory;
use Chamilo\CourseBundle\Entity\CNotebook;
use Chamilo\CourseBundle\Entity\CTool;
use Chamilo\GraphQlBundle\Traits\GraphQLTrait;
use Chamilo\UserBundle\Entity\User;
use GraphQL\Type\Definition\ResolveInfo;
use Overblog\GraphQLBundle\Definition\Argument;

@ -3,7 +3,6 @@
namespace Chamilo\GraphQlBundle\Resolver;
use Chamilo\GraphQlBundle\Traits\GraphQLTrait;
use Chamilo\CoreBundle\Entity\Course;
use Chamilo\CoreBundle\Entity\Session;
use Chamilo\CoreBundle\Entity\SessionRelCourseRelUser;
@ -15,6 +14,7 @@ use Chamilo\CourseBundle\Entity\CItemProperty;
use Chamilo\CourseBundle\Entity\CLpCategory;
use Chamilo\CourseBundle\Entity\CTool;
use Chamilo\CourseBundle\Repository\CNotebookRepository;
use Chamilo\GraphQlBundle\Traits\GraphQLTrait;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Criteria;
use Firebase\JWT\JWT;

@ -3,10 +3,10 @@
namespace Chamilo\GraphQlBundle\Resolver;
use Chamilo\GraphQlBundle\Traits\GraphQLTrait;
use Chamilo\CoreBundle\Entity\Session;
use Chamilo\CoreBundle\Entity\SessionRelCourse;
use Chamilo\CoreBundle\Security\Authorization\Voter\SessionVoter;
use Chamilo\GraphQlBundle\Traits\GraphQLTrait;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
/**

@ -3,8 +3,8 @@
namespace Chamilo\GraphQlBundle\Resolver;
use Chamilo\GraphQlBundle\Traits\GraphQLTrait;
use Chamilo\CoreBundle\Entity\Course;
use Chamilo\GraphQlBundle\Traits\GraphQLTrait;
use Chamilo\UserBundle\Entity\User;
use Doctrine\Common\Collections\ArrayCollection;
use Overblog\GraphQLBundle\Definition\Argument;

@ -280,5 +280,5 @@ Session::erase('session_id');
Session::erase('studentview');
api_remove_in_gradebook();
$controller->tpl->assign('content',$controller->tpl->fetch('@ChamiloTheme/Index/userportal.html.twig'));
$controller->tpl->assign('content', $controller->tpl->fetch('@ChamiloTheme/Index/userportal.html.twig'));
$controller->tpl->display_one_col_template();

Loading…
Cancel
Save