Andrew Rawlins
[squirrelmail.git] / functions / page_header.php
index 07f53446a9f4071c618b73a27eaa7cf5943a4a50..bf731b50f10be978eb8d89c9110bc1c0a7e9c197 100644 (file)
@@ -3,7 +3,7 @@
 /**
  * page_header.php
  *
- * Copyright (c) 1999-2002 The SquirrelMail Project Team
+ * Copyright (c) 1999-2003 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  * Prints the page header (duh)
@@ -18,20 +18,15 @@ require_once(SM_PATH . 'functions/global.php');
 
 /* Always set up the language before calling these functions */
 function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE ) {
+    global $squirrelmail_language;
 
-    if ( !check_php_version(4,1) ) {
-            global $_SESSION;
-    }
-    if (isset($_SESSION['base_uri'])) {
-        $base_uri = $_SESSION['base_uri'];
-    }
-    else {
+    if ( !sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION) ) {
         global $base_uri;
     }
     global $theme_css, $custom_css;
 
     echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">' .
-         "\n\n<html>\n<head>\n";
+         "\n\n" . html_tag( 'html' ,'' , '', '', '' ) . "\n<head>\n";
 
     if ( !isset( $custom_css ) || $custom_css == 'none' ) {
         if ($theme_css != '') {
@@ -42,6 +37,11 @@ function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE
              $base_uri . 'themes/css/'.$custom_css.'" />';
     }
     
+    if ($squirrelmail_language == 'ja_JP') {
+        echo "<!-- \xfd\xfe -->\n";
+        echo '<meta http-equuiv="Content-type" content="text/html; charset=euc-jp">' . "\n";
+    }
+    
     if ($do_hook) {
         do_hook('generic_header');
     }
@@ -68,11 +68,7 @@ ECHO;
 
 
 function displayInternalLink($path, $text, $target='') {
-    if ( !check_php_version(4,1) ) {
-            global $_SESSION;
-    }
-
-    $base_uri = $_SESSION['base_uri']; 
+    sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION);
     if ($target != '') {
         $target = " target=\"$target\"";
     }
@@ -85,12 +81,8 @@ function displayPageHeader($color, $mailbox, $xtra='', $session=false) {
            $compose_new_win, $compose_width, $compose_height,
            $attachemessages, $provider_name, $provider_uri;
 
-    if ( !check_php_version(4,1) ) {
-            global $_SESSION;
-    }
-
-    $base_uri = $_SESSION['base_uri'];
-    $delimiter = $_SESSION['delimiter'];
+    sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION );
+    sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION );
     $module = substr( $PHP_SELF, ( strlen( $PHP_SELF ) - strlen( $base_uri ) ) * -1 );
     if ($qmark = strpos($module, '?')) {
         $module = substr($module, 0, $qmark);
@@ -181,7 +173,8 @@ function displayPageHeader($color, $mailbox, $xtra='', $session=false) {
                     "var e = document.forms[i].elements.length;\n".
                     "var j = 0;\n".
                     "while( pos == -1 && j < e ) {\n".
-                        "if ( document.forms[i].elements[j].type == 'text' ) {\n".
+                        "if ( document.forms[i].elements[j].type == 'text' " .
+                        "|| document.forms[i].elements[j].type == 'password' ) {\n".
                             "pos = j;\n".
                         "}\n".
                         "j++;\n".
@@ -329,4 +322,5 @@ function compose_Header($color, $mailbox) {
 
     echo "<body text=\"$color[8]\" bgcolor=\"$color[4]\" link=\"$color[7]\" vlink=\"$color[7]\" alink=\"$color[7]\" $onload>\n\n";
 }
-?>
+
+?>
\ No newline at end of file