From 49582f9e0dad9cbf5e2641b7f7cab6a6b844c003 Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Tue, 3 Oct 2017 12:16:32 +0200 Subject: [PATCH] Minor - format code, fix $_GET['id_coach'] calls --- main/mySpace/myStudents.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/main/mySpace/myStudents.php b/main/mySpace/myStudents.php index 41f17b3e31..8233a0815d 100755 --- a/main/mySpace/myStudents.php +++ b/main/mySpace/myStudents.php @@ -19,6 +19,7 @@ $origin = isset($_GET['origin']) ? Security::remove_XSS($_GET['origin']) : ''; $course_code = isset($_GET['course']) ? Security::remove_XSS($_GET['course']) : ''; $courseInfo = api_get_course_info($course_code); $student_id = isset($_GET['student']) ? (int) $_GET['student'] : 0; +$coachId = isset($_GET['id_coach']) ? (int) $_GET['id_coach'] : 0; $details = isset($_GET['details']) ? Security::remove_XSS($_GET['details']) : ''; $currentUrl = api_get_self().'?student='.$student_id.'&course='.$course_code.'&id_session='.$sessionId.'&origin='.$origin.'&details='.$details; $allowMessages = api_get_configuration_value('private_messages_about_user'); @@ -129,13 +130,13 @@ if (!empty($details)) { "url" => api_is_student_boss() ? "#" : "index.php", "name" => get_lang('MySpace') ); - if (isset($_GET['id_coach']) && intval($_GET['id_coach']) != 0) { + if (!empty($coachId)) { $interbreadcrumb[] = array( - "url" => "student.php?id_coach=".Security::remove_XSS($_GET['id_coach']), + "url" => "student.php?id_coach=".$coachId, "name" => get_lang("CoachStudents") ); $interbreadcrumb[] = array( - "url" => "myStudents.php?student=".$student_id.'&id_coach='.Security::remove_XSS($_GET['id_coach']), + "url" => "myStudents.php?student=".$student_id.'&id_coach='.$coachId, "name" => get_lang("StudentDetails") ); } else { @@ -174,15 +175,15 @@ if (!empty($details)) { "url" => api_is_student_boss() ? "#" : "index.php", "name" => get_lang('MySpace') ); - if (isset($_GET['id_coach']) && intval($_GET['id_coach']) != 0) { + if (!empty($coachId)) { if ($sessionId) { $interbreadcrumb[] = array( - "url" => "student.php?id_coach=".Security::remove_XSS($_GET['id_coach'])."&id_session=".$sessionId, + "url" => "student.php?id_coach=".$coachId."&id_session=".$sessionId, "name" => get_lang("CoachStudents") ); } else { $interbreadcrumb[] = array( - "url" => "student.php?id_coach=".Security::remove_XSS($_GET['id_coach']), + "url" => "student.php?id_coach=".$coachId, "name" => get_lang("CoachStudents") ); } @@ -398,14 +399,14 @@ echo $send_mail; if (!empty($student_id) && !empty($course_code)) { // Only show link to connection details if course and student were defined in the URL echo ''. - Display::return_icon('statistics.png', get_lang('AccessDetails'), '', ICON_SIZE_MEDIUM).''; + Display::return_icon('statistics.png', get_lang('AccessDetails'), '', ICON_SIZE_MEDIUM). + ''; } if (api_can_login_as($student_id)) { echo ''. Display::return_icon('login_as.png', get_lang('LoginAs'), null, ICON_SIZE_MEDIUM).'  '; } - if (Skill::isAllow($student_id, false)) { echo Display::url( Display::return_icon( @@ -906,8 +907,8 @@ if (empty($details)) { '.$attendances_faults_avg.' '.$scoretotal_display.''; - if (isset($_GET['id_coach']) && intval($_GET['id_coach']) != 0) { - echo ' + if (!empty($coachId)) { + echo ' '.Display::return_icon('2rightarrow.png', get_lang('Details')).''; } else { echo '