From 686051142e67e12175b9c08a88cea70d82c175ed Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Thu, 22 Mar 2012 18:05:55 +0100 Subject: [PATCH] Fixing page headers --- main/mySpace/course.php | 18 ++---------------- main/mySpace/index.php | 12 ++++-------- main/mySpace/lp_tracking.php | 21 +-------------------- main/mySpace/myStudents.php | 6 +++--- main/mySpace/student.php | 2 +- main/tracking/courseLog.php | 22 +++++++++++----------- 6 files changed, 22 insertions(+), 59 deletions(-) diff --git a/main/mySpace/course.php b/main/mySpace/course.php index 206efbf984..0fd9d18214 100644 --- a/main/mySpace/course.php +++ b/main/mySpace/course.php @@ -7,7 +7,6 @@ $language_file = array ('admin', 'registration', 'index', 'trad4all', 'tracking' $cidReset = true; require_once '../inc/global.inc.php'; - require_once api_get_path(LIBRARY_PATH).'export.lib.inc.php'; require_once api_get_path(LIBRARY_PATH).'thematic.lib.php'; @@ -98,15 +97,10 @@ if (api_is_drh() || api_is_session_admin() || api_is_platform_admin()) { echo ''; } echo ''; - echo '

'.$title.'

'; + echo Display::page_subheader($title); } // Database Table Definitions -$tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE); -$tbl_user_course = Database :: get_main_table(TABLE_MAIN_COURSE_USER); -$tbl_user = Database :: get_main_table(TABLE_MAIN_USER); -$tbl_session_course = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE); -$tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION); $tbl_session_course_user = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE_USER); if (isset($_GET['action'])) { @@ -126,15 +120,7 @@ if ($show_import_icon) { } if (!api_is_drh() && !api_is_session_admin() && !api_is_platform_admin()) { - /*if (api_is_platform_admin()) { - if (empty($id_session)) { - $courses = CourseManager::get_real_course_list(); - } else { - $courses = Tracking::get_courses_list_from_session($id_session); - } - } else {*/ - $courses = Tracking::get_courses_followed_by_coach($_user['user_id'], $id_session); - //} + $courses = Tracking::get_courses_followed_by_coach($_user['user_id'], $id_session); $a_courses = array_keys($courses); } diff --git a/main/mySpace/index.php b/main/mySpace/index.php index dd298eb3be..6f4ff15703 100644 --- a/main/mySpace/index.php +++ b/main/mySpace/index.php @@ -259,7 +259,7 @@ if (empty($session_id)) { if ($nb_students > 0 && $view != 'admin') { - echo Display::tag('h2', ' '.get_lang('Students').' ('.$nb_students.')'); + echo Display::page_subheader(' '.get_lang('Students').' ('.$nb_students.')'); // average progress $avg_total_progress = $avg_total_progress / $nb_students; @@ -352,14 +352,12 @@ if ($count_courses || $count_sessions) { } } - - if (api_is_allowed_to_create_course() && $view == 'teacher') { //Courses if ($count_courses) { - echo Display::tag('h2', $title); + echo Display::page_subheader($title); $table = new SortableTable('courses_my_space', 'get_number_of_courses', array('MySpace','get_course_data')); $parameters['view'] = 'teacher'; @@ -390,7 +388,7 @@ if (api_is_allowed_to_create_course() && $view == 'teacher') { // Display list of sessions if ($count_sessions > 0 && !isset($_GET['session_id'])) { - echo '

 '.get_lang('Sessions').' ('.$count_sessions.')'.'

'; + echo Display::page_subheader(' '.get_lang('Sessions').' ('.$count_sessions.')'); $table = new SortableTable('tracking_sessions_myspace', 'count_sessions_coached'); $table->set_header(0, get_lang('Title'), false); $table->set_header(1, get_lang('Date'), false); @@ -730,6 +728,4 @@ if (!$export_csv) { function get_number_of_courses() { global $courses; return count($courses); -} - - +} \ No newline at end of file diff --git a/main/mySpace/lp_tracking.php b/main/mySpace/lp_tracking.php index 7ef66de8d4..7daa3566e2 100644 --- a/main/mySpace/lp_tracking.php +++ b/main/mySpace/lp_tracking.php @@ -65,26 +65,7 @@ if (!empty($_GET['origin']) && $_GET['origin'] == 'user_course') { } $interbreadcrumb[] = array("url" => "myStudents.php?student=".Security::remove_XSS($_GET['student_id'])."&course=".$cidReq."&details=true&origin=".Security::remove_XSS($_GET['origin']) , "name" => get_lang("DetailsStudentInCourse")); - $nameTools = get_lang('LearningPathDetails'); - -$htmlHeadXtra[] = ' -'; - Display :: display_header($nameTools); $lp_id = intval($_GET['lp_id']); @@ -106,7 +87,7 @@ $session_name = api_get_session_name($session_id); $table_title = ($session_name? Display::return_icon('session.png', get_lang('Session'), array(), ICON_SIZE_SMALL).' '.$session_name.' ':' '). Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL).' '.$course_info['name'].' '. Display::return_icon('user.png', get_lang('User'), array(), ICON_SIZE_SMALL).' '.$name; -echo '

'.$table_title.'

'; +echo Display::page_subheader($table_title); echo '

'.Display::return_icon('learnpath.png', get_lang('ToolLearnpath'), array(), ICON_SIZE_SMALL).' '.$lp_title.'

'; $list = learnpath :: get_flat_ordered_items_list($lp_id, 0, $course_info['real_id']); diff --git a/main/mySpace/myStudents.php b/main/mySpace/myStudents.php index 2680a5fbbe..297735c083 100644 --- a/main/mySpace/myStudents.php +++ b/main/mySpace/myStudents.php @@ -261,6 +261,7 @@ while ($row = Database :: fetch_array($rs)) { } if (empty($courses_in_session)) { + Display :: display_header($nameTools); echo '
'; echo ''.Display::return_icon('back.png', get_lang('Back'),'',ICON_SIZE_MEDIUM).''; echo '
'; @@ -271,7 +272,6 @@ if (empty($courses_in_session)) { Display :: display_header($nameTools); - if (!empty($student_id)) { if (api_is_drh() && !UserManager::is_user_followed_by_drh($student_id, api_get_user_id())) { @@ -398,7 +398,7 @@ if (!empty($student_id)) { $info_course = CourseManager :: get_course_information($get_course_code); $table_title = Display::return_icon('user.png', get_lang('User'), array(), ICON_SIZE_SMALL).api_get_person_name($info_user['firstname'], $info_user['lastname']); - echo '

'.$table_title.'

'; + echo Display::page_subheader($table_title); ?> @@ -538,7 +538,7 @@ if (!empty($info_course['title'])) { $table_title .= ($info_course ? Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL).' '.$info_course['title'].' ':''); } -echo Display::tag('h2', $table_title); +echo Display::page_subheader($table_title); if (empty($_GET['details'])) { diff --git a/main/mySpace/student.php b/main/mySpace/student.php index 526919ef9e..69f6fcda77 100644 --- a/main/mySpace/student.php +++ b/main/mySpace/student.php @@ -118,7 +118,7 @@ if (api_is_allowed_to_create_course() || api_is_drh()) {  '.get_lang('Print').' '.get_lang('ExportAsCSV').''; - echo '

'.$title.'

'; + echo Display::page_subheader($title); } if (isset($_GET['id_coach'])) { diff --git a/main/tracking/courseLog.php b/main/tracking/courseLog.php index 354d9f52dc..49c0773cf4 100644 --- a/main/tracking/courseLog.php +++ b/main/tracking/courseLog.php @@ -231,7 +231,7 @@ if ($_GET['studentlist'] == 'false') { // learning path tracking echo '
-

'.Display::return_icon('scorms.gif',get_lang('AverageProgressInLearnpath')).get_lang('AverageProgressInLearnpath').'

+ '.Display::page_subheader(Display::return_icon('scorms.gif',get_lang('AverageProgressInLearnpath')).get_lang('AverageProgressInLearnpath')).'
'; $list = new LearnpathList('', $course_code, $session_id); @@ -281,7 +281,7 @@ if ($_GET['studentlist'] == 'false') { // Exercices tracking. echo '
-

'.Display::return_icon('quiz.gif',get_lang('AverageResultsToTheExercices')).get_lang('AverageResultsToTheExercices').'

+ '.Display::page_subheader(Display::return_icon('quiz.gif',get_lang('AverageResultsToTheExercices')).get_lang('AverageResultsToTheExercices')).'
'; $course_id = api_get_course_int_id(); @@ -327,8 +327,8 @@ if ($_GET['studentlist'] == 'false') { // Forums tracking. echo '
-

'.Display::return_icon('forum.gif', get_lang('Forum')).get_lang('Forum').' - '.get_lang('SeeDetail').'

-
'; + '.Display::page_subheader(Display::return_icon('forum.gif', get_lang('Forum')).get_lang('Forum').' - '.get_lang('SeeDetail').''). + '
'; $count_number_of_posts_by_course = Tracking :: count_number_of_posts_by_course($course_code, $session_id); $count_number_of_forums_by_course = Tracking :: count_number_of_forums_by_course($course_code, $session_id); $count_number_of_threads_by_course = Tracking :: count_number_of_threads_by_course($course_code, $session_id); @@ -347,7 +347,7 @@ if ($_GET['studentlist'] == 'false') { // Chat tracking. echo '
-

'.Display::return_icon('chat.gif',get_lang('Chat')).get_lang('Chat').'

+ '.Display::page_subheader(Display::return_icon('chat.gif',get_lang('Chat')).get_lang('Chat')).'
'; $chat_connections_during_last_x_days_by_course = Tracking::chat_connections_during_last_x_days_by_course($course_code, 7, $session_id); if ($export_csv) { @@ -361,7 +361,7 @@ if ($_GET['studentlist'] == 'false') { // Tools tracking. echo '
-

'.Display::return_icon('acces_tool.gif', get_lang('ToolsMostUsed')).get_lang('ToolsMostUsed').'

+ '.Display::page_subheader(Display::return_icon('acces_tool.gif', get_lang('ToolsMostUsed')).get_lang('ToolsMostUsed')).'
'; $tools_most_used = Tracking::get_tools_most_used_by_course($course_code, $session_id); @@ -398,7 +398,7 @@ if ($_GET['studentlist'] == 'false') { } echo '
-

'.Display::return_icon('documents.gif',get_lang('DocumentsMostDownloaded')).' '.get_lang('DocumentsMostDownloaded').$link.'

+ '.Display::page_subheader(Display::return_icon('documents.gif',get_lang('DocumentsMostDownloaded')).' '.get_lang('DocumentsMostDownloaded').$link).'
'; $documents_most_downloaded = Tracking::get_documents_most_downloaded_by_course($course_code, $session_id, $num); @@ -433,7 +433,7 @@ if ($_GET['studentlist'] == 'false') { // links tracking echo '
-

'.Display::return_icon('link.gif',get_lang('LinksMostClicked')).' '.get_lang('LinksMostClicked').'

+ '.Display::page_subheader(Display::return_icon('link.gif',get_lang('LinksMostClicked')).' '.get_lang('LinksMostClicked')).'
'; $links_most_visited = Tracking::get_links_most_visited_by_course($course_code, $session_id); @@ -503,10 +503,10 @@ if ($_GET['studentlist'] == 'false') { $course_name = get_lang('Course').' '.$course_info['name']; if ($session_id) { - echo '

'.Display::return_icon('session.png', get_lang('Session'), array(), ICON_SIZE_SMALL).' '.api_get_session_name($session_id).' '. - Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL).' '.$course_name.'

'; + echo Display::page_subheader(Display::return_icon('session.png', get_lang('Session'), array(), ICON_SIZE_SMALL).' '.api_get_session_name($session_id).' '. + Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL).' '.$course_name); } else { - echo '

'.Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL).' '.$course_info['name'].'

'; + echo Display::page_subheader(Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL).' '.$course_info['name']); } $extra_field_select = TrackingCourseLog::display_additional_profile_fields();