X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fpage_header.php;h=fb92f887c02885c172b65b50ad40cc030dc6a185;hb=e4ff0781eb2e324ffcc003d2fe46cd4b02f260c8;hp=815855702d2c276939ee63907258e78893d6e335;hpb=8dc0fb27d62a0f73b4170b81d1ad1e15e03bcd91;p=squirrelmail.git diff --git a/functions/page_header.php b/functions/page_header.php index 81585570..fb92f887 100644 --- a/functions/page_header.php +++ b/functions/page_header.php @@ -6,25 +6,57 @@ ** **/ + $page_header_php = true; + + if (!isset($prefs_php)) + include ("../functions/prefs.php"); + + // This is done to ensure that the character set is correct when + // receiving input from HTTP forms + if ($default_charset != "") + header ("Content-Type: text/html; charset=$default_charset"); + + // Check to see if gettext is installed + if (function_exists("_")) { + // Setting the language to use for gettext if it is not English + // (the default language) or empty. + $squirrelmail_language = getPref ($data_dir, $username, "language"); + if ($squirrelmail_language != "en" && $squirrelmail_language != "") { + putenv("LANG=$squirrelmail_language"); + bindtextdomain("squirrelmail", "../locale/"); + textdomain("squirrelmail"); + + // Setting cookie to use on the login screen the next time the + // same user logs in. + setcookie("squirrelmail_language", $squirrelmail_language, + time()+2592000); + } + } else { + function _($string) { + return $string; + } + } + function displayPageHeader($color, $mailbox) { /** Here is the header and wrapping table **/ $shortBoxName = readShortMailboxName($mailbox, "."); + $shortBoxName = stripslashes($shortBoxName); echo ""; - echo " "; + echo " "; echo " "; echo "
"; - echo " Sign Out"; + echo " " . _("Sign Out") . ""; echo " "; - echo "
Current Folder: $shortBoxName 
"; + echo "
" . _("Current Folder: ") . "$shortBoxName 
"; echo "
\n"; echo ""; echo " "; echo "
"; - echo " Compose  "; - echo " Addresses  "; - echo " Folders  "; - echo " Options  "; + echo " " . _("Compose") . "  "; + echo " ". _("Addresses") ."  "; + echo " " . _("Folders") . "  "; + echo " " . _("Options") . "  "; echo " "; - echo " SquirrelMail"; + echo " SquirrelMail"; echo "
"; }