diff --git a/main/admin/index.php b/main/admin/index.php
index 18b0c11b0e..ccec065511 100644
--- a/main/admin/index.php
+++ b/main/admin/index.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 = '
';
$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 = ' ';
$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 = ' ';
$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 = ' ';
$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;
}
}
diff --git a/main/admin/system_announcements.php b/main/admin/system_announcements.php
index 0f7ff25618..9014c814fe 100755
--- a/main/admin/system_announcements.php
+++ b/main/admin/system_announcements.php
@@ -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']
);
diff --git a/main/admin/user_edit.php b/main/admin/user_edit.php
index fe111f227b..e0615c2f81 100755
--- a/main/admin/user_edit.php
+++ b/main/admin/user_edit.php
@@ -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,
diff --git a/main/admin/user_list.php b/main/admin/user_list.php
index ea58cff10d..2d92c5353f 100755
--- a/main/admin/user_list.php
+++ b/main/admin/user_list.php
@@ -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(""); },
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(""); },
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(\' ' . Display::returnFontAwesomeIcon('arrow-down') . ' ' . get_lang('AdvancedSearch') . '\');
+ $("#img_plus_and_minus").html(\' '.Display::returnFontAwesomeIcon('arrow-down').' '.get_lang('AdvancedSearch').'\');
} else {
$("#advanced_search_form").css("display","none");
- $("#img_plus_and_minus").html(\' ' . Display::returnFontAwesomeIcon('arrow-right') . ' ' . get_lang('AdvancedSearch') . '\');
+ $("#img_plus_and_minus").html(\' '.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);
}
';
@@ -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 = '';
+ 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 = '' . $photo . ''
- . $iconAdmin . '' . $iconActive . '
';
+ $profile = ''.$photo.''
+ .$iconAdmin.''.$iconActive.'
';
// 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 '' . $name . '';
+ return ''.$name.'';
}
/**
@@ -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 .= '
- ' . $icon . '
-
+ $result .= '
+ '.$icon.'
+
';
$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 .= '
- ' . $icon . '
-
+ $result .= '
+ '.$icon.'
+
';
} 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 .= '' .
- Display::return_icon('info2.png', get_lang('Info')) . '';
+ $result .= ''.
+ Display::return_icon('info2.png', get_lang('Info')).'';
} 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 .= '' .
- Display::return_icon('login_as.png', get_lang('LoginAs')) . '';
+ $result .= ''.
+ Display::return_icon('login_as.png', get_lang('LoginAs')).'';
} 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 .= '' .
- Display::return_icon('statistics.png', get_lang('Reporting')) .
+ $result .= ''.
+ Display::return_icon('statistics.png', get_lang('Reporting')).
'';
}
@@ -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 .= '' .
+ $result .= ''.
Display::return_icon(
'edit.png',
get_lang('Edit'),
[],
ICON_SIZE_SMALL
- ) .
+ ).
'';
} else {
$result .= Display::return_icon(
@@ -685,7 +683,7 @@ function modify_filter($user_id, $url_params, $row)
get_lang('Edit'),
[],
ICON_SIZE_SMALL
- ) . '';
+ ).'';
}
}
@@ -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 .= ' ' .
+ $result .= ' '.
Display::return_icon(
'delete.png',
get_lang('Delete'),
[],
ICON_SIZE_SMALL
- ) .
+ ).
'';
}
}
if (api_is_platform_admin()) {
- $result .= ' ' .
+ $result .= ' '.
Display::return_icon(
'calendar.png',
get_lang('FreeBusyCalendar'),
[],
ICON_SIZE_SMALL
- ) .
+ ).
'';
if ($user_id != api_get_user_id() &&
!$user_is_anonymous &&
api_global_admin_can_edit_admin($user_id)
) {
- $result .= ' ' .
+ $result .= ' '.
Display::return_icon(
'anonymous.png',
get_lang('Anonymize'),
[],
ICON_SIZE_SMALL
- ) .
+ ).
'';
}
@@ -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 .= ' ' .
+ $result .= ' '.
Display::return_icon(
'delete.png',
get_lang('Delete'),
[],
ICON_SIZE_SMALL
- ) .
+ ).
'';
} else {
$result .= Display::return_icon(
@@ -828,9 +826,9 @@ function modify_filter($user_id, $url_params, $row)
*
* @author Patrick Cool , 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 = '
- ' . Display::returnFontAwesomeIcon('arrow-right') . ' ' . get_lang('AdvancedSearch') . '
+ '.Display::returnFontAwesomeIcon('arrow-right').' '.get_lang('AdvancedSearch').'
';
$actionsLeft = '';
$actionsCenter = '';
$actionsRight = '';
if (api_is_platform_admin()) {
- $actionsRight .= '' .
- Display::return_icon('new_user.png', get_lang('AddUsers'), '', ICON_SIZE_MEDIUM) . '';
+ $actionsRight .= ''.
+ Display::return_icon('new_user.png', get_lang('AddUsers'), '', ICON_SIZE_MEDIUM).'';
}
$actionsLeft .= $form->returnForm();
@@ -1100,7 +1098,7 @@ $data = $extraField->addElements($form, 0, [], true, false, $variablesToShow);
$htmlHeadXtra[] = '
';
@@ -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'] . '
';
+ $access_info_to_string .= $url_info['url'].'
';
}
}
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,
diff --git a/main/create_course/add_course.php b/main/create_course/add_course.php
index 8c05412664..e253bfdb74 100755
--- a/main/create_course/add_course.php
+++ b/main/create_course/add_course.php
@@ -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[] = '';
$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) ? '' . $course_request_info['code'] . ' : ' : '') . get_lang('CourseRequestCreated');
+ $message = (is_array($course_request_info) ? ''.$course_request_info['code'].' : ' : '').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);
diff --git a/main/exercise/exercise.class.php b/main/exercise/exercise.class.php
index 0788dff7bb..b722932f03 100755
--- a/main/exercise/exercise.class.php
+++ b/main/exercise/exercise.class.php
@@ -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);
diff --git a/main/exercise/exercise_admin.php b/main/exercise/exercise_admin.php
index fcadc6ab57..1786a812e7 100755
--- a/main/exercise/exercise_admin.php
+++ b/main/exercise/exercise_admin.php
@@ -197,7 +197,7 @@ if ($form->validate()) {
}
$lp_id = (int) $lp_id;
echo "".Display::return_icon('back.png', get_lang("BackTo").' '.get_lang("LearningPaths"), '', ICON_SIZE_MEDIUM)."";
- Display::return_icon('back.png', get_lang("BackTo").' '.get_lang("LearningPaths"), '', ICON_SIZE_MEDIUM)."";
+ Display::return_icon('back.png', get_lang("BackTo").' '.get_lang("LearningPaths"), '', ICON_SIZE_MEDIUM)."";
} else {
echo ''.
Display::return_icon('back.png', get_lang('BackToExercisesList'), '', ICON_SIZE_MEDIUM).
diff --git a/main/exercise/hotspot_answers.as.php b/main/exercise/hotspot_answers.as.php
index 42a0240790..6d78044bb7 100755
--- a/main/exercise/hotspot_answers.as.php
+++ b/main/exercise/hotspot_answers.as.php
@@ -34,7 +34,7 @@ if (!api_is_allowed_to_edit(null, true)) {
if (empty($exeId)) {
api_not_allowed();
}
-
+
if (empty($trackExerciseInfo)) {
api_not_allowed();
}
diff --git a/main/forum/forumfunction.inc.php b/main/forum/forumfunction.inc.php
index 03fc0edef0..5e6de4aff3 100755
--- a/main/forum/forumfunction.inc.php
+++ b/main/forum/forumfunction.inc.php
@@ -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
*
diff --git a/main/group/group_space.php b/main/group/group_space.php
index 6b2182c7a0..537c6bccc3 100755
--- a/main/group/group_space.php
+++ b/main/group/group_space.php
@@ -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);
}
diff --git a/main/inc/email_editor.php b/main/inc/email_editor.php
index 0a4b3d4cd1..3b75805298 100755
--- a/main/inc/email_editor.php
+++ b/main/inc/email_editor.php
@@ -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 {
diff --git a/main/inc/introductionSection.inc.php b/main/inc/introductionSection.inc.php
index b61cd4c738..f089796056 100755
--- a/main/inc/introductionSection.inc.php
+++ b/main/inc/introductionSection.inc.php
@@ -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,
];
}
}
diff --git a/main/inc/lib/banner.lib.php b/main/inc/lib/banner.lib.php
index ac354c52c2..4186321947 100755
--- a/main/inc/lib/banner.lib.php
+++ b/main/inc/lib/banner.lib.php
@@ -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
diff --git a/main/inc/lib/display.lib.php b/main/inc/lib/display.lib.php
index e39c32eab5..18c335bb65 100755
--- a/main/inc/lib/display.lib.php
+++ b/main/inc/lib/display.lib.php
@@ -660,9 +660,10 @@ class Display
}
// Return encrypted mailto hyperlink
$classCut = '';
- if($cut){
+ if ($cut) {
$classCut = 'cut-email';
}
+
return ''.$hclickable_text.'';
}
diff --git a/main/inc/lib/document.lib.php b/main/inc/lib/document.lib.php
index c1d6cdeb2e..27c3bb260e 100644
--- a/main/inc/lib/document.lib.php
+++ b/main/inc/lib/document.lib.php
@@ -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;
}
}
diff --git a/main/inc/lib/exercise.lib.php b/main/inc/lib/exercise.lib.php
index 309d17d944..bd86ff4d72 100644
--- a/main/inc/lib/exercise.lib.php
+++ b/main/inc/lib/exercise.lib.php
@@ -1,8 +1,8 @@
'.$pager->getCurrentPageId().' / '.$pager->numPages().' ';
$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;
}
diff --git a/main/inc/lib/tracking.lib.php b/main/inc/lib/tracking.lib.php
index ba1333f3cb..257227ce7a 100755
--- a/main/inc/lib/tracking.lib.php
+++ b/main/inc/lib/tracking.lib.php
@@ -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() ?
'saveFromCache($chartHash, $imgPath);
$imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash;
}
-
+
return $imgPath;
}
diff --git a/main/inc/lib/usergroup.lib.php b/main/inc/lib/usergroup.lib.php
index 0c03045b0b..4fcfb76610 100755
--- a/main/inc/lib/usergroup.lib.php
+++ b/main/inc/lib/usergroup.lib.php
@@ -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.
*
diff --git a/main/mySpace/myStudents.php b/main/mySpace/myStudents.php
index 91d2c6dfa0..bd0e3c0021 100755
--- a/main/mySpace/myStudents.php
+++ b/main/mySpace/myStudents.php
@@ -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;
diff --git a/main/wiki/wiki.inc.php b/main/wiki/wiki.inc.php
index bf80b63771..a597e10add 100755
--- a/main/wiki/wiki.inc.php
+++ b/main/wiki/wiki.inc.php
@@ -6076,7 +6076,7 @@ class Wiki
get_lang('RecentChanges'),
'',
ICON_SIZE_MEDIUM
- ) .'';
+ ).'';
echo Display::toolbarAction('toolbar-wiki', [$actionsLeft]);
}
diff --git a/src/GraphQlBundle/ChamiloGraphQlBundle.php b/src/GraphQlBundle/ChamiloGraphQlBundle.php
index 6d73333c9c..d0ba44bc43 100644
--- a/src/GraphQlBundle/ChamiloGraphQlBundle.php
+++ b/src/GraphQlBundle/ChamiloGraphQlBundle.php
@@ -12,5 +12,4 @@ use Symfony\Component\HttpKernel\Bundle\Bundle;
*/
class ChamiloGraphQlBundle extends Bundle
{
-
}
diff --git a/src/GraphQlBundle/Map/InterfaceMap.php b/src/GraphQlBundle/Map/InterfaceMap.php
index 1e82e3c1ae..0109818c7c 100644
--- a/src/GraphQlBundle/Map/InterfaceMap.php
+++ b/src/GraphQlBundle/Map/InterfaceMap.php
@@ -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;
diff --git a/src/GraphQlBundle/Map/QueryMap.php b/src/GraphQlBundle/Map/QueryMap.php
index 58cd7d280d..30bf6ed578 100644
--- a/src/GraphQlBundle/Map/QueryMap.php
+++ b/src/GraphQlBundle/Map/QueryMap.php
@@ -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;
diff --git a/src/GraphQlBundle/Resolver/CourseResolver.php b/src/GraphQlBundle/Resolver/CourseResolver.php
index 51dedb4c87..fa2f14f2cf 100644
--- a/src/GraphQlBundle/Resolver/CourseResolver.php
+++ b/src/GraphQlBundle/Resolver/CourseResolver.php
@@ -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;
diff --git a/src/GraphQlBundle/Resolver/SessionResolver.php b/src/GraphQlBundle/Resolver/SessionResolver.php
index f62fafdc6e..94b1a24131 100644
--- a/src/GraphQlBundle/Resolver/SessionResolver.php
+++ b/src/GraphQlBundle/Resolver/SessionResolver.php
@@ -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;
/**
diff --git a/src/GraphQlBundle/Resolver/UserResolver.php b/src/GraphQlBundle/Resolver/UserResolver.php
index 8187383752..e07d27e1d5 100644
--- a/src/GraphQlBundle/Resolver/UserResolver.php
+++ b/src/GraphQlBundle/Resolver/UserResolver.php
@@ -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;
diff --git a/user_portal.php b/user_portal.php
index 5565fc5816..ea94127878 100755
--- a/user_portal.php
+++ b/user_portal.php
@@ -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();