Moved display functions from user_portal to course.lib.php and display.lib.php

skala
ywarnier 15 years ago
parent 35e349366d
commit b07956be40
  1. 4
      main/inc/lib/course.lib.php
  2. 37
      main/inc/lib/display.lib.php
  3. 59
      user_portal.php

@ -2618,7 +2618,7 @@ class CourseManager {
$all_user_categories = get_user_course_categories();
// Step 0: We display the course without a user category.
display_courses_in_category(0, 'true');
self :: display_courses_in_category(0, 'true');
// Step 1: We get all the categories of the user.
$tucc = Database::get_user_personal_table(TABLE_USER_COURSE_CATEGORY);
@ -2635,7 +2635,7 @@ class CourseManager {
echo $row['title'];
echo '</span>';
echo '</li>';
display_courses_in_category($row['id']);
self :: display_courses_in_category($row['id']);
echo '</ul>';
echo '</div>';
}

@ -935,5 +935,42 @@ class Display {
}
}); */
}
/**
* Display create course link
*
*/
function display_create_course_link() {
echo '<li><a href="main/create_course/add_course.php">'.(api_get_setting('course_validation') == 'true' ? get_lang('CreateCourseRequest') : get_lang('CourseCreate')).'</a></li>';
}
/**
* Display dashboard link
*
*/
function display_dashboard_link() {
echo '<li><a href="main/dashboard/index.php">'.get_lang('Dashboard').'</a></li>';
}
/**
* Display edit course list links
*
*/
function display_edit_course_list_links() {
echo '<li><a href="main/auth/courses.php">'.get_lang('CourseManagement').'</a></li>';
}
/**
* Show history sessions
*
*/
function display_history_course_session() {
if (api_get_setting('use_session_mode') == 'true') {
if (isset($_GET['history']) && intval($_GET['history']) == 1) {
echo '<li><a href="user_portal.php">'.get_lang('DisplayTrainingList').'</a></li>';
} else {
echo '<li><a href="user_portal.php?history=1">'.get_lang('HistoryTrainingSessions').'</a></li>';
}
}
}
} //end class Display

@ -153,9 +153,6 @@ Display :: display_header($nameTools);
/*
FUNCTIONS
display_admin_links()
display_create_course_link()
display_edit_course_list_links()
display_digest($toolsList, $digest, $orderKey, $courses)
show_notification($my_course)
@ -163,54 +160,6 @@ Display :: display_header($nameTools);
get_user_course_categories()
*/
/**
* Warning: This function defines a global variable.
* @todo Use the correct get_path function.
*/
function display_admin_links() {
global $rootAdminWeb;
echo '<li><a href="'.$rootAdminWeb.'">'.get_lang('PlatformAdmin').'</a></li>';
}
/**
* Display create course link
*
*/
function display_create_course_link() {
echo '<li><a href="main/create_course/add_course.php">'.(api_get_setting('course_validation') == 'true' ? get_lang('CreateCourseRequest') : get_lang('CourseCreate')).'</a></li>';
}
/**
* Display dashboard link
*
*/
function display_dashboard_link() {
echo '<li><a href="main/dashboard/index.php">'.get_lang('Dashboard').'</a></li>';
}
/**
* Display edit course list links
*
*/
function display_edit_course_list_links() {
echo '<li><a href="main/auth/courses.php">'.get_lang('CourseManagement').'</a></li>';
}
/**
* Show history sessions
*
*/
function display_history_course_session() {
if (api_get_setting('use_session_mode') == 'true') {
if (isset($_GET['history']) && intval($_GET['history']) == 1) {
echo '<li><a href="user_portal.php">'.get_lang('DisplayTrainingList').'</a></li>';
} else {
echo '<li><a href="user_portal.php?history=1">'.get_lang('HistoryTrainingSessions').'</a></li>';
}
}
}
/**
* Displays a digest e.g. short summary of new agenda and announcements items.
* This used to be displayed in the right hand menu, but is now
@ -1277,14 +1226,14 @@ echo '<span class="menusectioncaption">'.get_lang('MenuUser').'</span>';
if ($show_menu) {
echo '<ul class="menulist">';
if ($show_create_link) {
display_create_course_link();
Display :: display_create_course_link();
}
if ($show_course_link) {
if (!api_is_drh()) {
display_edit_course_list_links();
display_history_course_session();
Display :: display_edit_course_list_links();
Display :: display_history_course_session();
} else {
display_dashboard_link();
Display :: display_dashboard_link();
}
}
if ($show_digest_link) {

Loading…
Cancel
Save