@ -12,10 +12,8 @@ require_once api_get_path(LIBRARY_PATH).'banner.lib.php';
$session_id = api_get_session_id();
$session_name = api_get_session_name($my_session_id);
echo '< div id = "wrapper" > ';
?>
< div id = "wrapper" >
< ul id = "navigation" >
<?php
if (!empty($help)) {
@ -26,32 +24,33 @@ if (!empty($help)) {
if (api_get_setting('show_link_bug_notification') == 'true') {
?>
< li class = "report" >< a href = "http://support.chamilo.org/projects/chamilo-18/wiki/How_to_report_bugs" target = "_blank" >< img src = " <?php echo api_get_path ( WEB_IMG_PATH ) ?> bug.large.png" style = "vertical-align: middle;" alt = " <?php echo get_lang ( 'ReportABug' ) ?> " title = " <?php echo get_lang ( 'ReportABug' ); ?> " /></ a ></ li >
< / ul >
<?php
}
/*
< li class = "student" > < a href = " <?php echo api_get_path ( WEB_CODE_PATH ); ?> help/help.php?open=Home&height=400&width=600" class = "thickbox" title = " <?php echo get_lang ( 'Help' ); ?> " ></ a > </ li >
< li class = "user-online" > < a href = " <?php echo api_get_path ( WEB_CODE_PATH ); ?> help/help.php?open=Home&height=400&width=600" class = "thickbox" title = " <?php echo get_lang ( 'Help' ); ?> " ></ a > </ li >
< li class = "user-connect" > < a href = " <?php echo api_get_path ( WEB_CODE_PATH ); ?> help/help.php?open=Home&height=400&width=600" class = "thickbox" title = " <?php echo get_lang ( 'Help' ); ?> " ></ a > </ li >
< li class = "student-connect" > < a href = " <?php echo api_get_path ( WEB_CODE_PATH ); ?> help/help.php?open=Home&height=400&width=600" class = "thickbox" title = " <?php echo get_lang ( 'Help' ); ?> " ></ a > </ li >
<?php }
*/
?>
< / ul >
< div id = "header" >
< div id = "header1" >
< div id = "top_corner" > < / div >
< div id = "institution" >
< a href = " <?php echo api_get_path ( WEB_PATH ); ?> index.php" target = "_top" > <?php echo api_get_setting ( 'siteName' ); ?> </ a >
<?php
echo '< div id = "header" > ';
function show_header_1($language_file, $nameTools) {
$_course = api_get_course_info();
echo '< div id = "header1" > ';
echo '< div id = "top_corner" > < / div > ';
$logo = api_get_path(SYS_CODE_PATH).'css/'.api_get_visual_theme().'/images/header-logo.png';
$site_name = api_get_setting('siteName');
if (file_exists($logo)) {
echo '< div id = "logo" > ';
$image_url = api_get_path(WEB_CSS_PATH).api_get_visual_theme().'/images/header-logo.png';
$logo = Display::img($image_url, $site_name, array('title'=>$site_name));
echo Display::url($logo, api_get_path(WEB_PATH).'index.php');
echo '< / div > ';
} else {
echo '< a href = "'.api_get_path(WEB_PATH).'index.php" target = "_top" > '.$site_name.'< / a > ';
$iurl = api_get_setting('InstitutionUrl');
$iname = api_get_setting('Institution');
if (!empty($iname)) {
echo '- < a href = "'.$iurl.'" target = "_top" > '.$iname.'< / a > ';
}
/* External link section a.k.a Department - Department URL */
// External link section a.k.a Department - Department URL
if (isset($_course['extLink']) & & $_course['extLink']['name'] != '') {
echo '< span class = "extLinkSeparator" > - < / span > ';
if ($_course['extLink']['url'] != '') {
@ -62,16 +61,15 @@ if (api_get_setting('show_link_bug_notification') == 'true') {
echo $_course['extLink']['name'];
}
}
?>
< / div >
<?php
}
/* Course title section */
if (!empty($_cid) and $_cid != -1 and isset($_course)) {
//Put the name of the course in the header
?>
< div id = "my_courses" >
<?php
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" >
echo $_course['name'].' ';
@ -92,13 +90,12 @@ if (!empty($_cid) and $_cid != -1 and isset($_course)) {
}
echo '< / a > ';*/
echo '< / div > ';
} elseif (isset($nameTools) & & $language_file != 'course_home') {
//Put the name of the user-tools in the header
if (!isset($_user['user_id'])) {
echo '< div id = "my_courses" > < / div > ';
} elseif (!$noPHP_SELF) {
echo '< div id = "my_courses" > < a href = "'.api_get_self().'?'.api_get_cidreq(), '" target = "_top" > ', $nameTools, '< / a > < / div > ';
echo '< div id = "my_courses" > < a href = "'.api_get_self().'?'.api_get_cidreq(), '" target = "_top" > '.$nameTools. '< / a > < / div > ';
} else {
echo '< div id = "my_courses" > '.$nameTools.'< / div > ';
}
@ -111,27 +108,30 @@ api_plugin('header');
echo '< / div > ';
//Don't let the header disappear if there's nothing on the left
echo '< div class = "clear" > < / div > ';
//echo '< div class = "clear" > < / div > ';
echo '< / div > ';
}
/* Plugins for banner section */
$web_course_path = api_get_path(WEB_COURSE_PATH);
?>
< / div >
< 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)) {
function show_header_2($help) {
$_course = api_get_course_info();
$course_id = api_get_course_id();
$user_id = api_get_user_id();
echo '< div id = "header2" > ';
echo '< div id = "Header2Right" > ';
echo '< ul > ';
if ((api_get_setting('showonline', 'world') == 'true' AND !$user_id) OR (api_get_setting('showonline', 'users') == 'true' AND $user_id) OR (api_get_setting('showonline', 'course') == 'true' AND $user_id AND $course_id)) {
$number = who_is_online_count(api_get_setting('time_limit_whosonline'));
$number_online_in_course = 0;
if(!empty($_course['id'])) {
$number_online_in_course = who_is_online_in_this_course_count(api_get_user_id() , api_get_setting('time_limit_whosonline'), $_course['id']);
$number_online_in_course = who_is_online_in_this_course_count($user_id , api_get_setting('time_limit_whosonline'), $_course['id']);
}
echo '< li > ';
// 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_id) OR (api_get_setting('showonline', 'users') == 'true' AND $user_id)) {
//echo '< a href = "'.api_get_path(WEB_PATH).'whoisonline.php" target = "_top" title = "'.get_lang('UsersOnline').'" > < img width = "12px" src = "'.api_get_path(WEB_IMG_PATH).'online.png" title = "'.get_lang('UsersOnline').'" > '.get_lang('OnLine').' '.$number.'< / a > ';
echo '< li > < a href = "'.api_get_path(WEB_PATH).'whoisonline.php" target = "_top" title = "'.get_lang('UsersOnline').'" > < img width = "13px" src = "'.api_get_path(WEB_IMG_PATH).'members.gif" title = "'.get_lang('UsersOnline').'" > '.$number.'< / a > < / li > ';
}
@ -143,17 +143,16 @@ if ((api_get_setting('showonline', 'world') == 'true' AND !$_user['user_id']) OR
}
// Display the who's online for the session
//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_id) & & api_is_coach()) {
if (api_get_setting('use_session_mode') == 'true' & & isset($_user[' user_id'] ) & & api_get_session_id() != 0) {
//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" > '.Display::return_icon('session.png', get_lang('UsersConnectedToMySessions'), array('width'=>'13px')).' < / a > < / li > ';
if (api_get_setting('use_session_mode') == 'true' & & isset($user_id) & & api_get_session_id() != 0) {
//echo '< li > < a href = "'.api_get_path(WEB_PATH).'whoisonlinesession.php?id_coach='.$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_id.'&referer='.urlencode($_SERVER['REQUEST_URI']).'" target = "_top" > '.Display::return_icon('session.png', get_lang('UsersConnectedToMySessions'), array('width'=>'13px')).' < / a > < / li > ';
}
echo '< / li > ';
}
if ($_user[' user_id'] & & isset($_c id)) {
if ($user_id & & isset($course _id)) {
if ((api_is_course_admin() || api_is_platform_admin()) & & api_get_setting('student_view_enabled') == 'true') {
echo '< li > | ';
api_display_tool_view_option();
@ -161,7 +160,6 @@ if ($_user['user_id'] && isset($_cid)) {
}
}
if (api_is_allowed_to_edit()) {
if (!empty($help)) {
echo '< li > ';
@ -169,12 +167,6 @@ if (api_is_allowed_to_edit()) {
if (api_get_setting('show_link_bug_notification') != 'true') {
echo '|';
}
//echo get_lang('Help');
/*
< a href = "#" onclick = "javascript: MyWindow=window.open(' <?php echo api_get_path ( WEB_CODE_PATH ) . 'help/help.php' ; ?> ?open= <?php echo $help ; ?> ','MyWindow','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=620,height=600,left=200,top=20'); return false;" >
< img src = " <?php echo api_get_path ( WEB_IMG_PATH ); ?> help.png" style = "vertical-align: middle;" title = " <?php echo get_lang ( 'Help' ); ?> " alt = " <?php echo get_lang ( 'Help' ); ?> " /></ a >
*/?>
<?php
echo "< / li > ";
}
}
@ -183,37 +175,36 @@ if (api_get_setting('accessibility_font_resize') == 'true') {
echo '< span class = "decrease_font" title = "'.get_lang('DecreaseFontSize').'" > A< / span > < span class = "reset_font" title = "'.get_lang('ResetFontSize').'" > A< / span > < span class = "increase_font" title = "'.get_lang('IncreaseFontSize').'" > A< / span > ';
echo '< / li > ';
}
?>
< / ul >
< / div >
< div class = "clear" > < / div >
< / div >
< div id = "header3" >
<?php
echo '< / ul > ';
echo '< / div > ';
echo '< / div > ';
}
/* User section */
function show_header_3() {
echo '< div id = "header3" > ';
if ($_user['user_id']) {
// Logout
if (api_get_user_id()) {
$login = '';
if (api_is_anonymous()) {
$login = '('.get_lang('Anonymous').')' ;
$login = get_lang('Anonymous') ;
} else {
$uinfo = api_get_user_info(api_get_user_id());
$login = '('.$uinfo['username'].')' ;
$login = $uinfo['username'] ;
}
?>
<!-- start user section line with name, my course, my profile, scorm info, etc -->
< ul id = "logout" >
< li >< a href = " <?php echo api_get_path ( WEB_PATH ); ?> index.php?logout=logout&uid= <?php echo $_user [ 'user_id' ]; ?> " target = "_top" >< span > <?php echo get_lang ( 'Logout' ) . ' ' . $login ; ?> </ span ></ a ></ li >
< / ul >
<?php
//start user section line with name, my course, my profile, scorm info, etc
echo '< ul id = "logout" > ';
//echo '< li > < span > '.get_lang('LoggedInAsX').' '.$login.'< / span > < / li > ';
//echo '< li > < a href = "'.api_get_path(WEB_PATH).'main/auth/profile.php" target = "_top" > < span > '.get_lang('Profile').'< / span > < / a > < / li > ';
echo '< li > < a href = "'.api_get_path(WEB_PATH).'index.php?logout=logout&uid='.api_get_user_id().'" target = "_top" > < span > '.get_lang('Logout').' ('.$login.')< / span > < / a > < / li > ';
echo '< / ul > ';
}
?>
< ul >
<?php
$navigation = array();
echo ' < ul > ';
$navigation = $menu_ navigation = array();
$possible_tabs = get_tabs();
// Campus Homepage
@ -223,7 +214,7 @@ if (api_get_setting('show_tabs', 'campus_homepage') == 'true') {
$menu_navigation[SECTION_CAMPUS] = $possible_tabs[SECTION_CAMPUS];
}
if ($_user['user_id'] & & !api_is_anonymous()) {
if (api_get_user_id() & & !api_is_anonymous()) {
// My Courses
if (api_get_setting('show_tabs', 'my_courses') == 'true') {
$navigation['mycourses'] = $possible_tabs['mycourses'];
@ -380,13 +371,20 @@ if (api_get_self() != '/main/admin/configure_homepage.php') {
}
echo '< li id = "insert-link" > < a href = "'.api_get_self().'?action=insert_tabs" style = "padding-right:0px;" > < span > '. Display::return_icon('addd.gif', get_lang('InsertLink'), array('style' => 'vertical-align:middle')).' '.get_lang('InsertLink').'< / span > < / a > < / li > ';
}
echo '< / ul > ';
echo '< / div > ';
}
//Header 4
function show_header_4($interbreadcrumb, $language_file, $nameTools) {
$session_id = api_get_session_id();
$session_name = api_get_session_name($session_id);
$_course = api_get_course_info();
/* Plugins for banner section */
$web_course_path = api_get_path(WEB_COURSE_PATH);
if ($_self == 'admin_intro_edition_page')
?>
< / ul >
< div style = "clear: both;" class = "clear" > < / div >
< / div >
<?php
/*
* if the user is a coach he can see the users who are logged in its session
*/
@ -394,7 +392,7 @@ $navigation = array();
// 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
$my_session_name = is_null($session_name) ? '' : ' ('.$session_name.')';
if (isset($_cid) and $_cid != -1 and isset($_course) and !isset($_GET['hide_course_breadcrumb'])) {
if (!empty($_course) & & !isset($_GET['hide_course_breadcrumb'])) {
$navigation_item['url'] = $web_course_path . $_course['path'].'/index.php'.(!empty($session_id) ? '?id_session='.$session_id : '');
switch (api_get_setting('breadcrumbs_course_homepage')) {
case 'get_lang':
@ -425,42 +423,28 @@ if (isset($interbreadcrumb) && is_array($interbreadcrumb)) {
// titles for shared folders
if ($breadcrumb_step['name'] == 'shared_folder') {
$navigation_item['title'] = get_lang('UserFolders');
}
elseif(strstr($breadcrumb_step['name'], 'shared_folder_session_')) {
} elseif(strstr($breadcrumb_step['name'], 'shared_folder_session_')) {
$navigation_item['title'] = get_lang('UserFolders');
}
elseif(strstr($breadcrumb_step['name'], 'sf_user_')) {
} elseif(strstr($breadcrumb_step['name'], 'sf_user_')) {
$userinfo = Database::get_user_info_from_id(substr($breadcrumb_step['name'], 8));
$navigation_item['title'] = api_get_person_name($userinfo['firstname'], $userinfo['lastname']);
}
elseif($breadcrumb_step['name'] == 'chat_files') {
} elseif($breadcrumb_step['name'] == 'chat_files') {
$navigation_item['title'] = get_lang('ChatFiles');
}
elseif($breadcrumb_step['name'] == 'images') {
} elseif($breadcrumb_step['name'] == 'images') {
$navigation_item['title'] = get_lang('Images');
}
elseif($breadcrumb_step['name'] == 'video') {
} elseif($breadcrumb_step['name'] == 'video') {
$navigation_item['title'] = get_lang('Video');
}
elseif($breadcrumb_step['name'] == 'audio') {
} elseif($breadcrumb_step['name'] == 'audio') {
$navigation_item['title'] = get_lang('Audio');
}
elseif($breadcrumb_step['name'] == 'flash') {
} elseif($breadcrumb_step['name'] == 'flash') {
$navigation_item['title'] = get_lang('Flash');
}
elseif($breadcrumb_step['name'] == 'gallery') {
} elseif($breadcrumb_step['name'] == 'gallery') {
$navigation_item['title'] = get_lang('Gallery');
}
$navigation[] = $navigation_item;
}
}
// part 3: The tool itself. If we are on the course homepage we do not want to display the title of the course because this
// is the same as the first part of the breadcrumbs (see part 1)
if (isset($nameTools) & & $language_file != 'course_home') { // TODO: This condition $language_file != 'course_home' might bring surprises.
@ -470,26 +454,109 @@ if (isset($nameTools) && $language_file != 'course_home') { // TODO: This condit
}
$final_navigation = array();
$counter = 0;
foreach ($navigation as $index => $navigation_info) {
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'].'" class = "breadcrumb breadcrumb'.$index.'" target = "_top" > < span > '.$navigation_info['title'].'< / span > < / a > ';
$counter++;
}
}
if (in_array(api_get_visual_theme(), array('chamilo','chamilo_red','chamilo_blue','chamilo_orange','chamilo_green','chamilo_electric_blue'))) {
//@todo move this in CSS
$style = '< style >
#header3 {
background:none;
//padding:2px;
border-bottom:1px solid #ccc;
width: 92%;
margin-bottom:0px;
padding:0px;
}
#header2 {
min-height: 28px;
}
#current {
margin-right: 2px;
}
#current #tab_active {
//background:none;
}
#header3 a {
//background:none;
}
#header3 li {
//background:none;
//background-color: #CCCCCC;
//border-radius:5px;
//margin:0px 1px 0px 1px;
}
#header3 li a span {
//background:none;
}
#header4 {
height:2.3em;
padding:0px;
background:none;
width: 92%;
}
#main {
border : 1px solid #ddd;
}
}< / style > ';
echo $style;
if (!empty($final_navigation)) {
echo '< div id = "header4" > ';
echo implode(' > ', $final_navigation);
$lis = '';
$i = 0;
foreach($final_navigation as $bread) {
$lis.= Display::tag('li', $bread);
$i++;
}
echo Display::tag('ul',$lis, array('class'=>'bread'));
echo '< / div > ';
} else {
echo '< div id = "header4" > ';
echo '< / div > ';
}
} else {
if (!empty($final_navigation)) {
echo '< div id = "header4" > ';
$i = 0;
$count = count($final_navigation);
foreach($final_navigation as $bread) {
if ($i < $count -1 & & $count != 1) {
$bread .=' > ';
}
echo $bread;
$i++;
}
echo '< / div > ';
} else {
echo '< div id = "header4" > ';
echo '< / div > ';
}
}
echo '< div class = "clear" > < / div > ';
if (api_get_setting('show_toolshortcuts') == 'true') {
echo '< div id = "toolshortcuts" > ';
require_once 'tool_navigation_menu.inc.php';
show_navigation_tool_shortcuts();
echo '< / div > ';
}
}
show_header_1($language_file, $nameTools);
show_header_2($help);
show_header_3();
show_header_4($interbreadcrumb, $language_file, $nameTools);
if (isset($database_connection)) {
// connect to the main database.
@ -500,20 +567,16 @@ if (isset($database_connection)) {
// (ex. SELECT * FROM table_from_main_db - SELECT * FROM courseDB.table_from_course_db)
Database::select_db($_configuration['main_database'], $database_connection);
}
?>
< / div > <!-- end of the whole #header section -->
< div class = "clear" > < / div >
<?php
echo '< / div > '; // <!-- end of the whole #header section -- >
//to mask the main div, set $header_hide_main_div to true in any script just before calling Display::display_header();
global $header_hide_main_div;
if (!empty($header_hide_main_div) & & $header_hide_main_div === true) {
//do nothing
} else {
?>
< div id = "main" > <!-- start of #main wrapper for #content and #menu divs -->
<?php
echo '< div id = "main" > '; //<!-- start of #main wrapper for #content and #menu divs -->
}
/* "call for chat" module section */
@ -540,18 +603,16 @@ if (api_get_setting('show_navigation_menu') != 'false' && api_get_setting('show_
if (isset($_SESSION['hideMenu'])) {
if ($_SESSION['hideMenu'] == 'shown') {
if (isset($_cid)) {
echo '< div id = "centerwrap" > <!-- start of #centerwrap --> ';
echo '< div id = "center" > <!-- start of #center --> ';
echo '< div id = "centerwrap" > '; // <!-- start of #centerwrap -->
echo '< div id = "center" > '; // <!-- start of #center -->
}
}
} else {
if (isset($_cid)) {
echo '< div id = "centerwrap" > <!-- start of #centerwrap --> ';
echo '< div id = "center" > <!-- start of #center --> ';
echo '< div id = "centerwrap" > '; // <!-- start of #centerwrap -->
echo '< div id = "center" > '; // <!-- start of #center -->
}
}
}
}
?>
<!-- Begin Of script Output -->
//<!-- Begin Of script Output -->