From f50e7309614575f906cf13c4eff7c9df054b245f Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Thu, 13 Aug 2015 09:15:35 +0200 Subject: [PATCH] Fix icons and URLs see #7619 --- main/inc/lib/sessionmanager.lib.php | 25 +++++------ main/inc/lib/userportal.lib.php | 64 ++++++++++++++++------------- 2 files changed, 49 insertions(+), 40 deletions(-) diff --git a/main/inc/lib/sessionmanager.lib.php b/main/inc/lib/sessionmanager.lib.php index fd6fc201fe..119ec228fb 100755 --- a/main/inc/lib/sessionmanager.lib.php +++ b/main/inc/lib/sessionmanager.lib.php @@ -7338,7 +7338,8 @@ class SessionManager $listOneCourse = array(); $listOneCourse['courseId'] = $courseId; $listOneCourse['title'] = $courseInfo['title']; - $listOneCourse['courseCode'] = $courseInfo['code']; + //$listOneCourse['courseCode'] = $courseInfo['code']; + $listOneCourse['course'] = $courseInfo; $listOneCourse['sessionCatList'] = array(); $listCat = array(); foreach ($listSessionId as $i => $sessionId) { @@ -7474,17 +7475,18 @@ class SessionManager $htmlRes = ''; $listInfo = self::getNamedSessionCourseForCoach($userId); - foreach($listInfo as $i => $listCoursesInfo) { - $courseCode = $listCoursesInfo['courseCode']; - $courseTitle = $listCoursesInfo['title']; + foreach ($listInfo as $i => $listCoursesInfo) { + $courseInfo = $listCoursesInfo['course']; + $courseCode = $listCoursesInfo['course']['code']; + $listParamsCourse = array(); $listParamsCourse['icon'] = '
'. - Display::return_icon('blackboard.png', $listCoursesInfo['title'], array(), ICON_SIZE_LARGE); + Display::return_icon('blackboard.png', $courseInfo['title'], array(), ICON_SIZE_LARGE); $listParamsCourse['link'] = ''; $listParamsCourse['title'] = Display::tag( 'a', - $listCoursesInfo['title'], + $courseInfo['title'], array('href' => $listParamsCourse['link']) ); $htmlCourse = '
'. @@ -7517,10 +7519,11 @@ class SessionManager $listParamsSession['icon'] = Display::return_icon('blackboard_blue.png', $sessionName, array(), ICON_SIZE_LARGE); $listParamsSession['link'] = ''; - $linkToCourseSession = api_get_path(WEB_PATH).'courses/'.$courseCode.'/?id_session='.$sessionId; - $listParamsSession['title'] = $sessionName.'
- - '.get_lang('GoToCourseInsideSession').'
'; + $linkToCourseSession = $courseInfo['course_public_url'].'?id_session='.$sessionId; + $listParamsSession['title'] = + $sessionName.'
+ '.get_lang('GoToCourseInsideSession').' +
'; $htmlSession .= '
'. CourseManager::course_item_html($listParamsSession, true).'
'; } @@ -7531,6 +7534,4 @@ class SessionManager return $htmlRes; } - - } diff --git a/main/inc/lib/userportal.lib.php b/main/inc/lib/userportal.lib.php index abf97b8e87..d08d11a014 100755 --- a/main/inc/lib/userportal.lib.php +++ b/main/inc/lib/userportal.lib.php @@ -1363,8 +1363,7 @@ class IndexManager } } - $special_courses = ''; - + $specialCourses = ''; $loadDirs = $this->load_directories_preview; // If we're not in the history view... @@ -1387,6 +1386,7 @@ class IndexManager ); $listCourse = api_get_course_info_by_id($listCourseCodeId['real_id']); $listCoursesInfo[] = array( + 'course' => $listCourse, 'code' => $listCourseCodeId['code'], 'id' => $listCourseCodeId['real_id'], 'title' => $listCourse['title'], @@ -1432,17 +1432,16 @@ class IndexManager } else { $htmlCategory .= '
'; } + $coursesInfo = $listCourse['course']; $htmlCategory .= self::getHtmlForCourse( - $listCourse['courseId'], - $listCourse['title'], - $listCourse['courseCode'], + $coursesInfo, $userCategoryId, 1, $loadDirs ); // list of session category - $htmlSessionCategory = '