Browse Source

Fixing Chamilo title (partial) see #2095

Julio Montoya 14 years ago
parent
commit
1649a16792
2 changed files with 21 additions and 8 deletions
  1. 7 2
      index.php
  2. 14 6
      main/inc/header.inc.php

+ 7 - 2
index.php

@@ -123,9 +123,14 @@ else {
 	// only if login form was not sent because if the form is sent the user was already on the page.
 	event_open();
 }
-
+ 
 // the header
-Display::display_header(get_lang('Homepage'));
+$header_title = get_lang('Homepage');
+$sitename = api_get_setting('siteName');
+if (!empty($sitename)) {
+	$header_title = null;
+}
+Display::display_header($header_title);
 
 /*
 	MAIN CODE

+ 14 - 6
main/inc/header.inc.php

@@ -53,15 +53,23 @@ $document_language = api_get_language_isocode();
 <head>
 <title>
 <?php
-if (!empty($nameTools)) {
-	echo $nameTools.' - ';
-}
 
-if (!empty($_course['official_code'])) {
-	echo $_course['official_code'].' - ';
+$title_list[] = api_get_setting('siteName');
+$title_list[] = $nameTools;
+$title_list[] = $_course['official_code'];
+
+$title_string = '';
+for($i=0; $i<count($title_list);$i++) {
+    if (!empty($title_list[$i])) {
+    	$title_string .=$title_list[$i];
+        
+        if (isset($title_list[$i+1])) {
+            $title_string .=' - ';
+        }
+    }
 }
+echo $title_string;
 
-echo api_get_setting('siteName');
 
 ?>
 </title>