Jelajahi Sumber

More cleaning in the main page adding home icon

Julio Montoya 14 tahun lalu
induk
melakukan
ce92cd82e6

+ 6 - 6
index.php

@@ -11,7 +11,7 @@
 // Only this script should have this constant defined. This is used to activate the javascript that
 // Only this script should have this constant defined. This is used to activate the javascript that
 // gives the login name automatic focus in header.inc.html.
 // gives the login name automatic focus in header.inc.html.
 /** @todo Couldn't this be done using the $HtmlHeadXtra array? */
 /** @todo Couldn't this be done using the $HtmlHeadXtra array? */
-define('DOKEOS_HOMEPAGE', true);
+define('CHAMILO_HOMEPAGE', true);
 
 
 $language_file = array('courses', 'index');
 $language_file = array('courses', 'index');
 
 
@@ -125,12 +125,12 @@ else {
 }
 }
 
 
 // The header.
 // The header.
-$header_title = get_lang('Homepage');
-$sitename = api_get_setting('siteName');
-if (!empty($sitename)) {
+/*$header_title = get_lang('Homepage');
+//$sitename = api_get_setting('siteName');
+if (!api_get_user_id()) { 
     $header_title = null;
     $header_title = null;
-}
-Display::display_header($header_title);
+}*/
+Display::display_header(" ");
 
 
 /* MAIN CODE */
 /* MAIN CODE */
 
 

+ 7 - 8
main/auth/inscription.php

@@ -11,7 +11,6 @@ if (!empty($_POST['language'])) { //quick hack to adapt the registration form re
     $_GET['language'] = $_POST['language'];
     $_GET['language'] = $_POST['language'];
 }
 }
 require_once '../inc/global.inc.php';
 require_once '../inc/global.inc.php';
-
 require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
 require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
 require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
 require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
 require_once api_get_path(CONFIGURATION_PATH).'profile.conf.php';
 require_once api_get_path(CONFIGURATION_PATH).'profile.conf.php';
@@ -51,9 +50,7 @@ if (api_get_setting('allow_terms_conditions') == 'true') {
 $tool_name = get_lang('Registration',null,(!empty($_POST['language'])?api_get_valid_language($_POST['language']):$_user['language']));
 $tool_name = get_lang('Registration',null,(!empty($_POST['language'])?api_get_valid_language($_POST['language']):$_user['language']));
 Display :: display_header($tool_name);
 Display :: display_header($tool_name);
 
 
-echo '<div class="actions-title">';
-echo $tool_name;
-echo '</div>';
+echo Display::tag('h1', $tool_name);
 
 
 $home = api_get_path(SYS_PATH).'home/';
 $home = api_get_path(SYS_PATH).'home/';
 if ($_configuration['multiple_access_urls']) {
 if ($_configuration['multiple_access_urls']) {
@@ -601,11 +598,13 @@ if ($form->validate()) {
 <br />
 <br />
 <?php
 <?php
 if (!isset($_POST['username'])) {
 if (!isset($_POST['username'])) {
-?>
-<div class="actions">
+/*    
+    <div class="actions">
 <a href="<?php echo api_get_path(WEB_PATH); ?>" class="fake_button_back" ><?php echo get_lang('Back'); ?></a>
 <a href="<?php echo api_get_path(WEB_PATH); ?>" class="fake_button_back" ><?php echo get_lang('Back'); ?></a>
 </div>
 </div>
+*/
+?>
+
 <?php
 <?php
 }
 }
-
-Display :: display_footer();
+Display :: display_footer();

+ 9 - 18
main/auth/lostPassword.php

@@ -32,27 +32,21 @@ $tool_name 		= get_lang('LostPass');
 if (api_get_setting('allow_lostpassword') == 'false') {
 if (api_get_setting('allow_lostpassword') == 'false') {
 	api_not_allowed();
 	api_not_allowed();
 }
 }
-
-echo '<div class="actions-title">';
-echo $tool_name;
-echo '</div>';
+echo Display::tag('h1', $tool_name);
 
 
 if (isset ($_GET['reset']) && isset ($_GET['id'])) {
 if (isset ($_GET['reset']) && isset ($_GET['id'])) {
 	$msg = Login::reset_password($_GET["reset"], $_GET["id"], true);
 	$msg = Login::reset_password($_GET["reset"], $_GET["id"], true);
-	$msg1= '<a href="'.api_get_path(WEB_CODE_PATH).'auth/lostPassword.php" class="fake_button_back" >'.get_lang('Back').'</a>';
+	$msg1= '<a href="'.api_get_path(WEB_CODE_PATH).'auth/lostPassword.php" class="fake_button_back" >'.get_lang('Back').'</a>';	
 	echo '<br /><br /><div class="actions" >'.$msg1.'</div>';
 	echo '<br /><br /><div class="actions" >'.$msg1.'</div>';
-
 } else {
 } else {
-
 	$form = new FormValidator('lost_password');
 	$form = new FormValidator('lost_password');
 	$form->addElement('text', 'user', get_lang('LoginOrEmailAddress'), array('size'=>'40'));
 	$form->addElement('text', 'user', get_lang('LoginOrEmailAddress'), array('size'=>'40'));
-	//$form->addElement('text', 'email', get_lang('Email'), array('size'=>'40'));
 
 
 	//$form->applyFilter('email','strtolower');
 	//$form->applyFilter('email','strtolower');
 	$form->addElement('style_submit_button', 'submit', get_lang('Send'),'class="save"');
 	$form->addElement('style_submit_button', 'submit', get_lang('Send'),'class="save"');
 
 
 	// setting the rules
 	// setting the rules
-	$form->addRule('user', '<div class="required">'.get_lang('ThisFieldIsRequired'), 'required');
+	$form->addRule('user', '<div class="required">'.get_lang('ThisFieldIsRequired').'</div>', 'required');
 
 
 	if ($form->validate()) {
 	if ($form->validate()) {
 		$values = $form->exportValues();
 		$values = $form->exportValues();
@@ -84,7 +78,6 @@ if (isset ($_GET['reset']) && isset ($_GET['id'])) {
 
 
 		if ($result && $num_rows > 0) {
 		if ($result && $num_rows > 0) {
             $by_username = true;
             $by_username = true;
-//            $user = Database::fetch_array($result);
             $users = Database::store_result($result);
             $users = Database::store_result($result);
             foreach( $users as $user ) {
             foreach( $users as $user ) {
                 if ($userPasswordCrypted != 'none') {
                 if ($userPasswordCrypted != 'none') {
@@ -94,17 +87,15 @@ if (isset ($_GET['reset']) && isset ($_GET['id'])) {
                 }
                 }
             }
             }
 		} else {
 		} else {
-			Display::display_error_message(get_lang('NoUserAccountWithThisEmailAddress'));
+			Display::display_error_message(get_lang('NoUserAccountWithThisEmailAddress'));			
 		}
 		}
+		//$msg .= '<a href="'.api_get_path(WEB_CODE_PATH).'auth/lostPassword.php" class="fake_button_back" >'.get_lang('Back').'</a>';
+		//echo '<br /><br /><div class="actions" >'.$msg.'</div>';
 
 
-		$msg .= '<a href="'.api_get_path(WEB_CODE_PATH).'auth/lostPassword.php" class="fake_button_back" >'.get_lang('Back').'</a>';
-		echo '<br /><br /><div class="actions" >'.$msg.'</div>';
-
-	} else {
-		echo '<p>';
+	} else {		
 		echo get_lang('EnterEmailUserAndWellSendYouPassword');
 		echo get_lang('EnterEmailUserAndWellSendYouPassword');
-		echo '</p>';
+		echo '<br /><br />';				
 		$form->display();
 		$form->display();
 	}
 	}
 }
 }
-Display :: display_footer();
+Display::display_footer();

+ 21 - 6
main/css/base.css

@@ -411,25 +411,30 @@ table.lp_build td.tree {
 
 
 /* Breadcrumb */
 /* Breadcrumb */
 
 
-
 .bread {
 .bread {
     //border: 1px solid #DEDEDE;
     //border: 1px solid #DEDEDE;
     height: 25px;
     height: 25px;
     margin: 0px;	
     margin: 0px;	
-	padding:0px 0px 0px 12px; 
+	padding:0px; 
 }
 }
 
 
 .bread li {
 .bread li {
     color: #777777;
     color: #777777;
     float: left;
     float: left;
     line-height: 25px;
     line-height: 25px;
-    padding-left: 0.75em;
+    
 }
 }
 
 
+.bread span {
+    display: block;
+    font-size:11px;
+    padding: 0 15px 0 9px;
+}
+
+
 .bread a {
 .bread a {
     display: block;
     display: block;
-	font-size:11px;
-    padding: 0 15px 0 10px;
+	font-size:11px;    
 }
 }
 
 
 .bread a:hover {
 .bread a:hover {
@@ -437,13 +442,23 @@ table.lp_build td.tree {
 }
 }
 
 
 .bread li {    
 .bread li {    
+    display: block;
+    
+}
+
+.bread li a {    
 	background: url("crumbs.gif") no-repeat scroll right center transparent;
 	background: url("crumbs.gif") no-repeat scroll right center transparent;
     display: block;
     display: block;
-    padding: 0 15px 0 0;	
+    
     background-repeat:no-repeat; 
     background-repeat:no-repeat; 
     background-position:right;
     background-position:right;
 }
 }
 
 
+
+.bread .home {
+	padding:5px 15px 4px 8px;
+}    
+
 #logo {    
 #logo {    
     height:85px;
     height:85px;
     overflow:hidden;
     overflow:hidden;

TEMPAT SAMPAH
main/css/home.png


+ 86 - 61
main/inc/banner.inc.php

@@ -4,6 +4,7 @@
 /**
 /**
  *  This script contains the actual html code to display the "header"
  *  This script contains the actual html code to display the "header"
  *  or "banner" on top of every Chamilo page.
  *  or "banner" on top of every Chamilo page.
+ *  @todo this should be remove we should only use header.inc.php
  *
  *
  *  @package chamilo.include
  *  @package chamilo.include
  */
  */
@@ -93,14 +94,14 @@ function show_header_1($language_file, $nameTools) {
     } 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'])) {
-            echo '<div id="my_courses"></div>';
+            //echo '<div id="my_courses"></div>';
         } elseif (!$noPHP_SELF) {
         } 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 {
         } else {
             echo '<div id="my_courses">'.$nameTools.'</div>';
             echo '<div id="my_courses">'.$nameTools.'</div>';
         }   
         }   
     } else {        
     } else {        
-        echo '<div id="my_courses"></div>';
+        //echo '<div id="my_courses"></div>';
     }
     }
     
     
     echo '<div id="plugin-header">';
     echo '<div id="plugin-header">';
@@ -123,28 +124,29 @@ function show_header_2($help) {
     echo '<ul>';
     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)) {
     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 = who_is_online_count(api_get_setting('time_limit_whosonline'));            
         
         
         $number_online_in_course = 0;
         $number_online_in_course = 0;
         if(!empty($_course['id'])) {
         if(!empty($_course['id'])) {
             $number_online_in_course = who_is_online_in_this_course_count($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>';
         echo '<li>';
+        
         // 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_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>';
+        if ($number) {
+            if ((api_get_setting('showonline', 'world') == 'true' AND !$user_id) OR (api_get_setting('showonline', 'users') == 'true' AND $user_id)) {
+                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>';
+            }
         }
         }
     
     
         // 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'])) {
-            //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>| <a href="'.api_get_path(WEB_PATH).'whoisonline.php?cidReq='.$_course['sysCode'].'" target="_top">'.Display::return_icon('course.gif', get_lang('UsersOnline').' '.get_lang('InThisCourse'), array('width'=>'13px')).' '.$number_online_in_course.' </a></li>';
+        if ($number_online_in_course) {
+            if (is_array($_course) AND api_get_setting('showonline', 'course') == 'true' AND isset($_course['sysCode'])) {
+                echo '<li>| <a href="'.api_get_path(WEB_PATH).'whoisonline.php?cidReq='.$_course['sysCode'].'" target="_top">'.Display::return_icon('course.gif', get_lang('UsersOnline').' '.get_lang('InThisCourse'), array('width'=>'13px')).' '.$number_online_in_course.' </a></li>';
+            }
         }
         }
         
         
         // Display the who's online for the session 
         // Display the who's online for the session 
-        //if (api_get_setting('use_session_mode') == 'true' && isset($user_id) && api_is_coach()) {
-        
         if (api_get_setting('use_session_mode') == 'true' && isset($user_id) && api_get_session_id() != 0) {
         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.'&amp;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.'&amp;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.'&amp;referer='.urlencode($_SERVER['REQUEST_URI']).'" target="_top">'.Display::return_icon('session.png', get_lang('UsersConnectedToMySessions'), array('width'=>'13px')).' </a></li>';
             echo '<li>| <a href="'.api_get_path(WEB_PATH).'whoisonlinesession.php?id_coach='.$user_id.'&amp;referer='.urlencode($_SERVER['REQUEST_URI']).'" target="_top">'.Display::return_icon('session.png', get_lang('UsersConnectedToMySessions'), array('width'=>'13px')).' </a></li>';
@@ -170,6 +172,7 @@ function show_header_2($help) {
             echo "</li>";       
             echo "</li>";       
         }
         }
     }
     }
+    
     if (api_get_setting('accessibility_font_resize') == 'true') {
     if (api_get_setting('accessibility_font_resize') == 'true') {
         echo '<li class="resize_font">';
         echo '<li class="resize_font">';
         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 '<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>';
@@ -182,31 +185,10 @@ function show_header_2($help) {
 
 
 
 
 function show_header_3() {
 function show_header_3() {
-    echo '<div id="header3">'; 
-    
-    // Logout    
-    if (api_get_user_id()) {
-        $login = '';
-        if (api_is_anonymous()) {
-            $login = get_lang('Anonymous');
-        } else {
-            $uinfo = api_get_user_info(api_get_user_id());
-            $login = $uinfo['username'];
-        }
-        
-        //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>';    
-    }   
-    
-    echo '<ul>';
     
     
     $navigation = $menu_navigation = array();
     $navigation = $menu_navigation = array();
     $possible_tabs = get_tabs();
     $possible_tabs = get_tabs();
-    
+        
     // Campus Homepage
     // Campus Homepage
     if (api_get_setting('show_tabs', 'campus_homepage') == 'true') {
     if (api_get_setting('show_tabs', 'campus_homepage') == 'true') {
         $navigation[SECTION_CAMPUS] = $possible_tabs[SECTION_CAMPUS];
         $navigation[SECTION_CAMPUS] = $possible_tabs[SECTION_CAMPUS];
@@ -287,15 +269,8 @@ function show_header_3() {
             }
             }
         }
         }
     }
     }
+    
     // Displaying the tabs
     // Displaying the tabs
-    foreach ($navigation as $section => $navigation_info) {
-        if (isset($GLOBALS['this_section'])) {
-            $current = $section == $GLOBALS['this_section'] ? ' id="current"' : '';
-        } else {
-            $current = '';
-        }
-        echo '<li'.$current.'><a  href="'.$navigation_info['url'].'" target="_top"><span id="tab_active">'.$navigation_info['title'].'</span></a></li>'."\n";
-    }
     
     
     $lang = ''; //el for "Edit Language"
     $lang = ''; //el for "Edit Language"
     if (!empty($_SESSION['user_language_choice'])) {
     if (!empty($_SESSION['user_language_choice'])) {
@@ -316,7 +291,7 @@ function show_header_3() {
             $clean_url = replace_dangerous_char($url);
             $clean_url = replace_dangerous_char($url);
             $clean_url = str_replace('/', '-', $clean_url);
             $clean_url = str_replace('/', '-', $clean_url);
             $clean_url .= '/';
             $clean_url .= '/';
-            $homep            = api_get_path(SYS_PATH).'home/'.$clean_url; //homep for Home Path               
+            $homep     = api_get_path(SYS_PATH).'home/'.$clean_url; //homep for Home Path               
             //we create the new dir for the new sites
             //we create the new dir for the new sites
             if (!is_dir($homep)) {
             if (!is_dir($homep)) {
                 mkdir($homep, api_get_permissions_for_new_directories());
                 mkdir($homep, api_get_permissions_for_new_directories());
@@ -336,14 +311,17 @@ function show_header_3() {
     } else {
     } else {
         $errorMsg = get_lang('HomePageFilesNotReadable');
         $errorMsg = get_lang('HomePageFilesNotReadable');
     }
     }
-    
+        
     $home_top = api_to_system_encoding($home_top, api_detect_encoding(strip_tags($home_top)));
     $home_top = api_to_system_encoding($home_top, api_detect_encoding(strip_tags($home_top)));
     
     
-    if (api_get_self() != '/main/admin/configure_homepage.php') {
+    if (api_get_self() != '/main/admin/configure_homepage.php') {        
         $open = str_replace('{rel_path}',api_get_path(REL_PATH), $home_top);
         $open = str_replace('{rel_path}',api_get_path(REL_PATH), $home_top);
         $open = api_to_system_encoding($open, api_detect_encoding(strip_tags($open)));
         $open = api_to_system_encoding($open, api_detect_encoding(strip_tags($open)));
-        echo $open;
-    } else {
+        if (!empty($open)) {
+            $lis .= Display::tag('li', $open);
+            $show_bar = true;
+        }
+    } else {        
         $home_menu = '';
         $home_menu = '';
         if (file_exists($homep.$menutabs.'_'.$lang.$ext)) {
         if (file_exists($homep.$menutabs.'_'.$lang.$ext)) {
             $home_menu = @file($homep.$menutabs.'_'.$lang.$ext);
             $home_menu = @file($homep.$menutabs.'_'.$lang.$ext);
@@ -359,28 +337,70 @@ function show_header_3() {
             $home_menu = explode("\n", $home_menu);
             $home_menu = explode("\n", $home_menu);
         }
         }
         $tab_counter = 0;
         $tab_counter = 0;
+        if (!empty($home_menu)) {
+            $show_bar = true;    
+        }        
         foreach ($home_menu as $enreg) {
         foreach ($home_menu as $enreg) {
             $enreg = trim($enreg);
             $enreg = trim($enreg);
             if (!empty($enreg)) {
             if (!empty($enreg)) {
                 $edit_link = '<a href="'.api_get_self().'?action=edit_tabs&amp;link_index='.$tab_counter.'" ><span>'.Display::return_icon('edit.gif', get_lang('Edit')).'</span></a>';
                 $edit_link = '<a href="'.api_get_self().'?action=edit_tabs&amp;link_index='.$tab_counter.'" ><span>'.Display::return_icon('edit.gif', get_lang('Edit')).'</span></a>';
                 $delete_link = '<a href="'.api_get_self().'?action=delete_tabs&amp;link_index='.$tab_counter.'"  onclick="javascript: if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES)).'\')) return false;"><span>'.Display::return_icon('delete.gif', get_lang('Delete')).'</span></a>';
                 $delete_link = '<a href="'.api_get_self().'?action=delete_tabs&amp;link_index='.$tab_counter.'"  onclick="javascript: if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES)).'\')) return false;"><span>'.Display::return_icon('delete.gif', get_lang('Delete')).'</span></a>';
-                $tab_string = str_replace(array('href="'.api_get_path(WEB_PATH).'index.php?include=', '</li>'), array('href="'.api_get_path(WEB_CODE_PATH).'admin/'.basename(api_get_self()).'?action=open_link&link=', $edit_link.$delete_link.'</li>'), $enreg);
-                echo $tab_string;
+                $tab_string = str_replace(array('href="'.api_get_path(WEB_PATH).'index.php?include=', '</li>'), array('href="'.api_get_path(WEB_CODE_PATH).'admin/'.basename(api_get_self()).'?action=open_link&link=', $edit_link.$delete_link.'</li>'), $enreg);                
+                $lis .= $tab_string;
                 $tab_counter++;
                 $tab_counter++;
             }
             }
         }
         }
-        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>';
+        $lis .= '<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>';
+    }
+    
+    if (count($navigation) > 1 || !empty($lis)) {        
+        $pre_lis = '';
+        foreach ($navigation as $section => $navigation_info) {
+            if (isset($GLOBALS['this_section'])) {
+                $current = $section == $GLOBALS['this_section'] ? ' id="current"' : '';
+            } else {
+                $current = '';
+            }
+            $pre_lis .= '<li'.$current.'><a  href="'.$navigation_info['url'].'" target="_top"><span id="tab_active">'.$navigation_info['title'].'</span></a></li>';
+        }
+        $lis = $pre_lis.$lis;
+        $show_bar = true;
+    }
+    
+    
+    // Logout    
+    if ($show_bar) {
+        echo '<div id="header3">';
+    
+        if (api_get_user_id()) {
+            $login = '';
+            if (api_is_anonymous()) {
+                $login = get_lang('Anonymous');
+            } else {
+                $uinfo = api_get_user_info(api_get_user_id());
+                $login = $uinfo['username'];
+            }
+            
+            //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>';    
+        }   
+      
+        echo '<ul>';
+        echo $lis;
+        echo '</ul>';
+        echo '</div>';
     }    
     }    
-    echo '</ul>';
-    echo '</div>';
 }
 }
 
 
 //Header 4
 //Header 4
 function show_header_4($interbreadcrumb, $language_file, $nameTools) {   
 function show_header_4($interbreadcrumb, $language_file, $nameTools) {   
     $session_id     = api_get_session_id();
     $session_id     = api_get_session_id();
     $session_name   = api_get_session_name($session_id);
     $session_name   = api_get_session_name($session_id);
-    $_course        = api_get_course_info();
-    
+    $_course        = api_get_course_info();    
     
     
     /*  Plugins for banner section */
     /*  Plugins for banner section */
     $web_course_path = api_get_path(WEB_COURSE_PATH);
     $web_course_path = api_get_path(WEB_COURSE_PATH);
@@ -457,7 +477,11 @@ function show_header_4($interbreadcrumb, $language_file, $nameTools) {
     $counter = 0;
     $counter = 0;
     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"><span>'.$navigation_info['title'].'</span></a>';
+            if ($navigation_info['url'] == '#') {
+                $final_navigation[$index] = '<span>'.$navigation_info['title'].'</span>';
+            } else {
+                $final_navigation[$index] = '<a href="'.$navigation_info['url'].'" class="breadcrumb breadcrumb'.$index.'" target="_top"><span>'.$navigation_info['title'].'</span></a>';
+            }
             $counter++;
             $counter++;
         }
         }
     }
     }
@@ -500,23 +524,22 @@ function show_header_4($interbreadcrumb, $language_file, $nameTools) {
                     //background:none;
                     //background:none;
                 }
                 }
                 #header4 {  
                 #header4 {  
-                    height:2.3em;
+                    height:26px;
                     padding:0px;
                     padding:0px;
                     background:none;                    
                     background:none;                    
                     width: 92%;
                     width: 92%;
-                }
-                
+                }                
                 #main {
                 #main {
                     border : 1px solid #ddd;
                     border : 1px solid #ddd;
                 }
                 }
             }</style>';
             }</style>';
-        echo $style;
-        
+        echo $style;        
         if (!empty($final_navigation)) {
         if (!empty($final_navigation)) {
             echo '<div id="header4">';
             echo '<div id="header4">';
             $lis = '';
             $lis = '';
-            $i = 0;        
-            foreach($final_navigation as $bread) {       
+            $i = 0;
+            $lis.= Display::tag('li', Display::url(Display::img(api_get_path(WEB_CSS_PATH).'home.png', get_lang('Homepage'), array('align'=>'middle')), api_get_path(WEB_PATH), array('class'=>'home')));        
+            foreach ($final_navigation as $bread) {       
                 $lis.= Display::tag('li', $bread);
                 $lis.= Display::tag('li', $bread);
                 $i++;
                 $i++;
             }
             }
@@ -553,9 +576,11 @@ function show_header_4($interbreadcrumb, $language_file, $nameTools) {
     }
     }
 }
 }
 
 
+
 show_header_1($language_file, $nameTools);
 show_header_1($language_file, $nameTools);
 show_header_2($help);
 show_header_2($help);
 show_header_3();
 show_header_3();
+
 show_header_4($interbreadcrumb, $language_file, $nameTools);
 show_header_4($interbreadcrumb, $language_file, $nameTools);
 
 
 if (isset($database_connection)) {
 if (isset($database_connection)) {

+ 1 - 1
main/inc/header.inc.php

@@ -181,7 +181,7 @@ echo $favico;
 ?>
 ?>
 </head>
 </head>
 <body dir="<?php echo api_get_text_direction(); ?>" <?php
 <body dir="<?php echo api_get_text_direction(); ?>" <?php
- if (defined('DOKEOS_HOMEPAGE') && DOKEOS_HOMEPAGE)
+ if (defined('CHAMILO_HOMEPAGE') && CHAMILO_HOMEPAGE)
  echo 'onload="javascript: if(document.formLogin) { document.formLogin.login.focus(); }"'; ?>>
  echo 'onload="javascript: if(document.formLogin) { document.formLogin.login.focus(); }"'; ?>>
 <div class="skip">
 <div class="skip">
 <ul>
 <ul>

+ 1 - 6
main/inc/lib/display.lib.php

@@ -413,12 +413,7 @@ class Display {
                         /*]]>*/
                         /*]]>*/
                         </style>'; // TODO: There is no "default.css" file in this location.
                         </style>'; // TODO: There is no "default.css" file in this location.
         }
         }
-        echo '<div class="error-message">';
-        //Display :: display_icon('message_error.png', get_lang('ErrorMessage'), array ('style' => 'float:left; margin-right:10px;'));
-        /*
-        get_lang('ErrorMessage', array ('style' => 'float:left; margin-right:10px;'));
-        */
-        echo $message.'</div>';
+        echo '<div class="error-message">'.$message.'</div>';
     }
     }
 
 
     /**
     /**

+ 2 - 5
main/inc/lib/login.lib.php

@@ -184,8 +184,5 @@ class Login
 		} else {
 		} else {
 			return get_lang('NotAllowed');
 			return get_lang('NotAllowed');
 		}
 		}
-	}
-	
-	
-}
-?>
+	}	
+}

+ 1 - 1
plugin/search/client/www/indexer_login.php

@@ -40,7 +40,7 @@ if($_SERVER['REMOTE_ADDR']==$ip_address_of_search_server
   //now login the user to the platform (put everything needed inside the
   //now login the user to the platform (put everything needed inside the
   // session) and then redirect the search engine to the courses list
   // session) and then redirect the search engine to the courses list
   $_SESSION['_user']['user_id'] = $id;
   $_SESSION['_user']['user_id'] = $id;
-  define('DOKEOS_HOMEPAGE', true);
+  define('CHAMILO_HOMEPAGE', true);
   require('main/inc/global.inc.php');
   require('main/inc/global.inc.php');
   require('user_portal.php');
   require('user_portal.php');
 }
 }

+ 8 - 10
whoisonline.php

@@ -133,7 +133,11 @@ if ((api_get_setting('showonline', 'world') == 'true' && !$_user['user_id']) ||
 
 
 	$total = count($user_list);
 	$total = count($user_list);
 	if (!isset($_GET['id'])) {
 	if (!isset($_GET['id'])) {
-		Display::display_header(get_lang('UsersOnLineList'));
+	    $header_title  = get_lang('UsersOnLineList');
+        if (!api_get_user_id()) { 
+            $header_title = null;
+        }
+		Display::display_header($header_title);
 		if (api_get_setting('allow_social_tool') == 'true') {
 		if (api_get_setting('allow_social_tool') == 'true') {
 			if (!api_is_anonymous()) {
 			if (!api_is_anonymous()) {
 				echo '<div id="social-content-left">';
 				echo '<div id="social-content-left">';
@@ -141,10 +145,6 @@ if ((api_get_setting('showonline', 'world') == 'true' && !$_user['user_id']) ||
 				SocialManager::show_social_menu('whoisonline');
 				SocialManager::show_social_menu('whoisonline');
 				echo '</div>';
 				echo '</div>';
 			}			
 			}			
-			/*
-			if ($_GET['id'] == '') {
-				echo '<p><a class="refresh" href="javascript:window.location.reload()">'.get_lang('Refresh').'</a></p>';
-			}*/			
 		} else {
 		} else {
 			echo '<div class="actions-title">';
 			echo '<div class="actions-title">';
 			echo get_lang('UsersOnLineList');
 			echo get_lang('UsersOnLineList');
@@ -155,16 +155,15 @@ if ((api_get_setting('showonline', 'world') == 'true' && !$_user['user_id']) ||
 	if ($user_list) {
 	if ($user_list) {
 		if (!isset($_GET['id'])) {
 		if (!isset($_GET['id'])) {
 			if (api_get_setting('allow_social_tool') == 'true') {
 			if (api_get_setting('allow_social_tool') == 'true') {
-				echo '<div id="social-content-right">';				
-				echo '<div class="social-box-container2">';
+				echo '<div id="social-content-right">';			
 				//this include the social menu div
 				//this include the social menu div
 				if (!api_is_anonymous()) {
 				if (!api_is_anonymous()) {
 					echo UserManager::get_search_form($_GET['q']);
 					echo UserManager::get_search_form($_GET['q']);
 				}
 				}
 			}
 			}
+			echo Display::tag('h2', get_lang('UsersOnLineList'));
 			SocialManager::display_user_list($user_list);			
 			SocialManager::display_user_list($user_list);			
-			if (api_get_setting('allow_social_tool') == 'true') {
-				echo '</div>';
+			if (api_get_setting('allow_social_tool') == 'true') {				
 				echo '</div>';
 				echo '</div>';
 			}			
 			}			
 		} else {
 		} else {
@@ -183,5 +182,4 @@ if ((api_get_setting('showonline', 'world') == 'true' && !$_user['user_id']) ||
 }
 }
 $referer = empty($_GET['referer']) ? 'index.php' : api_htmlentities(strip_tags($_GET['referer']), ENT_QUOTES);
 $referer = empty($_GET['referer']) ? 'index.php' : api_htmlentities(strip_tags($_GET['referer']), ENT_QUOTES);
 
 
-/*	FOOTER  */
 Display::display_footer();
 Display::display_footer();