@ -1,5 +1,4 @@
<?php //$id: $
<?php
/* For licensing terms, see /dokeos_license.txt */
/**
/**
==============================================================================
==============================================================================
* This script contains the actual html code to display the "header"
* This script contains the actual html code to display the "header"
@ -9,21 +8,15 @@
==============================================================================
==============================================================================
*/
*/
?>
?>
< div id = "header" >
< div id = "header" > <!-- header section start -->
< div id = "header1" >
< div id = "header1" > <!-- top of banner with institution name/hompage link -- >
< div id = "top_corner" > < / div >
< div id = "top_corner" > < / div >
< div id = "institution" >
< div id = "institution" >
< a href = " <?php echo api_get_path ( WEB_PATH ); ?> index.php" target = "_top" > <?php echo api_get_setting ( 'siteName' ) ?> </ a >
< a href = " <?php echo api_get_path ( WEB_PATH ); ?> index.php" target = "_top" > <?php echo api_get_setting ( 'siteName' ) ?> </ a >
<?php
-
$iurl = api_get_setting('InstitutionUrl');
< a href = " <?php echo api_get_setting ( 'InstitutionUrl' ) ?> " target = "_top" > <?php echo api_get_setting ( 'Institution' ) ?> </ a >
$iname = api_get_setting('Institution');
if (!empty($iname))
{
echo '- < a href = "'.$iurl.'" target = "_top" > '.$iname.'< / a > ';
}
?>
< / div >
< / div >
<?php
<?php
/*
/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
@ -32,9 +25,11 @@
*/
*/
if (!empty($_cid) and $_cid != -1 and isset($_course)) {
if (!empty($_cid) and $_cid != -1 and isset($_course)) {
//Put the name of the course in the header
//Put the name of the course in the header
echo '
?>
< div id = "my_courses" >
< div id = "my_courses" >< a href = " <?php echo api_get_path ( WEB_COURSE_PATH ) . $_course [ 'path' ]; ?> /index.php" target = "_top" >
< a href = "'.api_get_path(WEB_COURSE_PATH).$_course['path'].'/index.php" target = "_top" > '.$_course['name'].' ';
<?php
echo $_course['name']." ";
if (api_get_setting("display_coursecode_in_courselist") == "true") {
if (api_get_setting("display_coursecode_in_courselist") == "true") {
echo $_course['official_code'];
echo $_course['official_code'];
}
}
@ -48,9 +43,7 @@ if (!empty($_cid) and $_cid != -1 and isset($_course)) {
if (api_get_setting("display_teacher_in_courselist") == "true") {
if (api_get_setting("display_teacher_in_courselist") == "true") {
echo stripslashes($_course['titular']);
echo stripslashes($_course['titular']);
}
}
echo ' < / a > ';
echo "< / a > < / div > ";
echo '
< / div > ';
} elseif (isset ($nameTools) & & $language_file != 'course_home') {
} elseif (isset ($nameTools) & & $language_file != 'course_home') {
//Put the name of the user-tools in the header
//Put the name of the user-tools in the header
if (!isset ($_user['user_id'])) {
if (!isset ($_user['user_id'])) {
@ -87,22 +80,17 @@ if (isset($_course['extLink']) && $_course['extLink']['name'] != "") {
} else {
} else {
echo $_course['extLink']['name'];
echo $_course['extLink']['name'];
}
}
}
}
?>
echo "< / div > <!-- end of #header1 --> ";
< / div >
echo '< div id = "header2" > ';
echo '< div id = "Header2Right" > ';
echo '< ul > ';
< div id = "header2" >
< div id = "Header2Right" >
< ul >
<?php
if ((api_get_setting('showonline','world') == "true" AND !$_user['user_id']) OR (api_get_setting('showonline','users') == "true" AND $_user['user_id']) OR (api_get_setting('showonline','course') == "true" AND $_user['user_id'] AND $_cid)) {
if ((api_get_setting('showonline','world') == "true" AND !$_user['user_id']) OR (api_get_setting('showonline','users') == "true" AND $_user['user_id']) OR (api_get_setting('showonline','course') == "true" AND $_user['user_id'] AND $_cid)) {
if (api_get_setting("use_session_mode") == "true" & & isset($_user['user_id']) & & api_is_coach()) {
if (api_get_setting("use_session_mode") == "true" & & isset($_user['user_id']) & & api_is_coach()) {
echo ' < li > < a href = "'.api_get_path(WEB_PATH).'whoisonlinesession.php?id_coach='.$_user['user_id'].'&referer='.urlencode($_SERVER['REQUEST_URI']).'" target = "_top" > '.get_lang('UsersConnectedToMySessions').'< / a > < / li > ' ;
echo "< li > < a href = '".api_get_path(WEB_PATH)."whoisonlinesession.php?id_coach=".$_user[' user_id ' ] . " & referer = ".urlencode($_SERVER['REQUEST_URI'])." ' target = '_top' > ".get_lang('UsersConnectedToMySessions')."< / a > < / li > ";
}
}
$statistics_database = Database :: get_statistic_database();
$statistics_database = Database :: get_statistic_database();
$number = count(WhoIsOnline(api_get_user_id(), $statistics_database, api_get_setting('time_limit_whosonline')));
$number = count(WhoIsOnline(api_get_user_id(), $statistics_database, api_get_setting('time_limit_whosonline')));
if(!empty($_course['id'])) {
if(!empty($_course['id'])) {
@ -111,24 +99,22 @@ if ((api_get_setting('showonline','world') == "true" AND !$_user['user_id']) OR
} else {
} else {
$number_online_in_course = 0;
$number_online_in_course = 0;
}
}
echo ' < li > '.get_lang('UsersOnline').': ' ;
echo " < li > ".get_lang('UsersOnline').": " ;
// Display the who's online of the platform
// Display the who's online of the platform
if ((api_get_setting('showonline','world') == "true" AND !$_user['user_id']) OR (api_get_setting('showonline','users') == "true" AND $_user['user_id'])) {
if ((api_get_setting('showonline','world') == "true" AND !$_user['user_id']) OR (api_get_setting('showonline','users') == "true" AND $_user['user_id'])) {
echo ' < a href = "'.api_get_path(WEB_PATH).'whoisonline.php" target = "_top" > '.$number.'< / a > ' ;
echo " < a href = '".api_get_path(WEB_PATH)."whoisonline.php' target = '_top' > ".$number."< / a > " ;
}
}
// Display the who's online for the course
// Display the who's online for the course
if (is_array($_course) AND api_get_setting('showonline','course') == "true" AND isset($_course['sysCode'])) {
if (is_array($_course) AND api_get_setting('showonline','course') == "true" AND isset($_course['sysCode'])) {
echo "(< a href = '".api_get_path(WEB_PATH)."whoisonline.php?cidReq=".$_course[' sysCode ' ] . " ' target = '_top' > $number_online_in_course ".get_lang('InThisCourse')."< / a > )";
echo "(< a href = '".api_get_path(WEB_PATH)."whoisonline.php?cidReq=".$_course[' sysCode ' ] . " ' target = '_top' > $number_online_in_course ".get_lang('InThisCourse')."< / a > )";
}
}
echo '< / li > ';
echo '< / li > ';
}
}
if ($_user['user_id'] & & isset($_cid)) {
if ($_user['user_id'] & & isset($_cid)) {
if (( api_is_course_admin() || api_is_platform_admin() ) & & api_get_setting('student_view_enabled') == 'true') {
if (api_is_course_admin() & & api_get_setting('student_view_enabled') == 'true') {
echo '< li > | ';
echo '< li > | ';
api_display_tool_view_option();
api_display_tool_view_option();
echo '< / li > ';
echo '< / li > ';
@ -148,9 +134,14 @@ if ( api_is_allowed_to_edit() ) {
?>
?>
< / ul >
< / ul >
< / div >
< / div >
< div class = "clear" > < / div >
<!-- link to campus home (not logged in)
< / div >
< a href = " <?php echo api_get_path ( WEB_PATH ); ?> index.php" target = "_top" > <?php echo api_get_setting ( 'siteName' ); ?> </ a >
-->
<?php
//not to let the empty header disappear and ensure help pic is inside the header
echo "< div class = \"clear\" > < / div > ";
?>
< / div > <!-- End of header 2 -->
< div id = "header3" >
< div id = "header3" >
<?php
<?php
/*
/*
@ -169,14 +160,20 @@ if ($_user['user_id']) {
?>
?>
<!-- start user section line with name, my course, my profile, scorm info, etc -->
<!-- start user section line with name, my course, my profile, scorm info, etc -->
< form method = "get" action = " <?php echo api_get_path ( WEB_PATH ); ?> index.php" class = "banner_links" target = "_top" >
< input type = "hidden" name = "logout" value = "true" / >
< input type = "hidden" name = "uid" value = " <?php echo $_user [ 'user_id' ]; ?> " />
< ul id = "logout" >
< ul id = "logout" >
< li >< a href = " <?php echo api_get_path ( WEB_PATH ); ?> index.php?action=logout" >< span > <?php echo get_lang ( 'Logout' ) . ' ' . $login ; ?> </ span ></ a ></ li >
< li >
< input type = "submit" name = "submit" value = " <?php echo get_lang ( "Logout" ) . ' ' . $login ; ?> "
onmouseover="this.style.textDecoration='underline'" onmouseout="this.style.textDecoration='none'"
class="logout" style=" height:20px;" />
< / li >
< / ul >
< / ul >
< / form >
<?php
<?php
}
}
?>
echo "< ul > \n";
< ul >
<?php
$navigation = array();
$navigation = array();
$possible_tabs = get_tabs();
$possible_tabs = get_tabs();
@ -251,14 +248,21 @@ foreach($navigation as $section => $navigation_info) {
} else {
} else {
$current = '';
$current = '';
}
}
echo ' < li ' . $ current . ' > < a href = "'.$navigation_info['url'].'" target = "_top" > < span > '.$navigation_info['title'].'< / span > < / a > < / li > '."\n";
echo '< li ' . $ current . ' > ';
echo '< a href = "'.$navigation_info['url'].'" target = "_top" > '.$navigation_info['title'].'< / a > ';
echo '< / li > ';
echo "\n";
}
}
?>
?>
< / ul >
< / ul > <!-- small hack to have it look good in opera -->
< div style = "clear: both;" class = "clear" > < / div >
< / div > <!-- end of header3 (user) section -->
< / div >
<?php
/*
-----------------------------------------------------------------------------
BREADCRUMBS
-----------------------------------------------------------------------------
*/
?>
< div id = "header4" >
< div id = "header4" >
<?php
<?php
/*
/*
@ -266,8 +270,7 @@ foreach($navigation as $section => $navigation_info) {
*/
*/
$navigation = array();
$navigation = array();
// part 1: Course Homepage. If we are in a course then the first breadcrumb is a link to the course homepage
// part 1: Course Homepage. If we are in a course then the first breadcrumb is a link to the course homepage
//hide_course_breadcrumb the parameter has been added to hide the name of the course, that appeared in the default $interbreadcrumb
if (isset ($_cid) and $_cid!=-1 and isset($_course)) {
if (isset ($_cid) and $_cid!=-1 and isset($_course) and !isset($_GET['hide_course_breadcrumb'])) {
$navigation_item['url'] = $web_course_path . $_course['path'].'/index.php';
$navigation_item['url'] = $web_course_path . $_course['path'].'/index.php';
switch(api_get_setting('breadcrumbs_course_homepage')) {
switch(api_get_setting('breadcrumbs_course_homepage')) {
case 'get_lang':
case 'get_lang':
@ -302,14 +305,13 @@ if (isset ($nameTools) AND $language_file<>"course_home") {
$final_navigation = array();
$final_navigation = array();
foreach ($navigation as $index => $navigation_info) {
foreach ($navigation as $index => $navigation_info) {
if (!empty($navigation_info['title'])) {
if (!empty($navigation_info['title'])) {
$final_navigation[$index] = '< a href = "'.$navigation_info['url'].'" class = "breadcrumb breadcrumb'.$index.'" target = "_top" > '.$navigation_info['title'].'< / a > ';
$final_navigation[$index] = '< a href = "'.$navigation_info['url'].'" target = "_top" > '.$navigation_info['title'].'< / a > ';
}
}
}
}
echo implode(' > ',$final_navigation);
echo implode(' > ',$final_navigation);
?>
?>
< / div >
< / div > <!-- end of header4 -->
<?php
<?php
if (api_get_setting('show_toolshortcuts')=='true') {
if (api_get_setting('show_toolshortcuts')=='true') {
echo '< div id = "toolshortcuts" > ';
echo '< div id = "toolshortcuts" > ';
@ -413,6 +415,13 @@ function get_tabs() {
$navigation['mycourses']['title'] = get_lang('MyCourses');
$navigation['mycourses']['title'] = get_lang('MyCourses');
}
}
// Link to active sessions
//$navigation[SECTION_ACTIVESESSIONS]['url'] = api_get_path(WEB_PATH).'user_portal.php';
//$navigation[SECTION_ACTIVESESSIONS]['title'] = get_lang('myActiveSessions');
// Link to inactive sessions
//$navigation[SECTION_INACTIVESESSIONS]['url'] = api_get_path(WEB_PATH).'user_portal.php?inactives';
//$navigation[SECTION_INACTIVESESSIONS]['title'] = get_lang('myInActiveSessions');
} else {
} else {
// Link to my courses
// Link to my courses
$navigation['mycourses']['url'] = api_get_path(WEB_PATH).'user_portal.php';
$navigation['mycourses']['url'] = api_get_path(WEB_PATH).'user_portal.php';
@ -436,18 +445,17 @@ function get_tabs() {
// Reporting
// Reporting
if(api_is_allowed_to_create_course() || $_user['status']==DRH) {
if(api_is_allowed_to_create_course() || $_user['status']==DRH) {
// Link to my space
// Link to my space
$navigation['session_my_space']['url'] = api_get_path(WEB_CODE_ PATH).'mySpace/';
$navigation['session_my_space']['url'] = api_get_path(WEB_PATH).'main/ mySpace/';
$navigation['session_my_space']['title'] = get_lang('MySpace');
$navigation['session_my_space']['title'] = get_lang('MySpace');
} else {
} else {
// Link to my progress
// Link to my progress
$navigation['session_my_progress']['url'] = api_get_path(WEB_CODE_ PATH).'auth/my_progress.php';
$navigation['session_my_progress']['url'] = api_get_path(WEB_PATH).'main/ auth/my_progress.php';
$navigation['session_my_progress']['title'] = get_lang('MyProgress');
$navigation['session_my_progress']['title'] = get_lang('MyProgress');
}
}
// Platform administration
// Platform administration
if (api_is_platform_admin(true)) {
if (api_is_platform_admin(true)) {
//$navigation['platform_admin']['url'] = $rootAdminWeb;
$navigation['platform_admin']['url'] = $rootAdminWeb;
$navigation['platform_admin']['url'] = api_get_path(WEB_CODE_PATH).'admin/';
$navigation['platform_admin']['title'] = get_lang('PlatformAdmin');
$navigation['platform_admin']['title'] = get_lang('PlatformAdmin');
}
}