Just give focus to <input type=text>
[squirrelmail.git] / functions / page_header.php
index 6b6663edb6df6eab77bb48d85a2d55faca4b00c7..ffe67d3a3cb1115867cce89f200e64f3292f8bf0 100644 (file)
        return;
    define('page_header_php', true);
 
-   include('../src/validate.php');
-   include("../functions/prefs.php");
-   include("../functions/plugin.php");
-
-   // Check to see if gettext is installed
-   $headers_sent=set_up_language(getPref($data_dir, $username, "language"));
-
-   // This is done to ensure that the character set is correct.
-   // But first checks whether we have already sent headers
-   // with charset when we were setting up the user language.
-   // Otherwise user ends up with the default charset overriding
-   // his selected one.
-   if (!$headers_sent && $default_charset != "")
-      header ("Content-Type: text/html; charset=$default_charset");
+   // Always set up the language before calling these functions
 
    function displayHtmlHeader ($title="SquirrelMail") {
      global $theme_css;
@@ -57,9 +44,7 @@
    function displayPageHeader($color, $mailbox) {
       displayHtmlHeader ();
 
-      printf('<BODY TEXT="%s" BGCOLOR="%s" LINK="%s" VLINK="%s" ALINK="%s">',
-             $color[8], $color[4], $color[7], $color[7], $color[7]);
-      echo "\n\n";
+      echo "<BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\" onLoad='if ( document.form[0].elements[0].type == \"text\" ) { document.forms[0].elements[0].focus(); }'>\n\n";
 
       /** Here is the header and wrapping table **/
       $shortBoxName = readShortMailboxName($mailbox, ".");