X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=functions%2Fpage_header.php;h=1cde34cfbc0285ab03b71f19d6bfdfe24fe7cb8c;hp=8b1d1d9e531e024177c650f9476a821a57bbcf8c;hb=efe9ae2aa367382336c29928e8188dfad60129be;hpb=7aaa81fcf8383ee72ee0e4fd3cb2fd8d5f9708b5
diff --git a/functions/page_header.php b/functions/page_header.php
index 8b1d1d9e..1cde34cf 100644
--- a/functions/page_header.php
+++ b/functions/page_header.php
@@ -4,51 +4,22 @@
**
** Prints the page header (duh)
**
+ ** $Id$
**/
- session_start();
+ if (defined('page_header_php'))
+ return;
+ define('page_header_php', true);
- $page_header_php = true;
-
- if (!isset($prefs_php))
- include ("../functions/prefs.php");
- if (!isset($i18n_php))
- include ("../functions/i18n.php");
- if (!isset($plugin_php))
- include ("../functions/plugin.php");
-
- // 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("LC_ALL=$squirrelmail_language");
- bindtextdomain("squirrelmail", "../locale/");
- textdomain("squirrelmail");
- $default_charset = $languages[$squirrelmail_language]["CHARSET"];
- }
- } else {
- function _($string) {
- return $string;
- }
- }
-
- // This is done to ensure that the character set is correct.
- if ($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;
- echo '';
- echo "\n\n";
- echo "\n";
- echo "
\n";
- if ($theme_css != "") {
- printf ('',
- $theme_css);
- echo "\n";
+ echo '' .
+ "\n\n\n\n";
+ if ($theme_css != '') {
+ echo "\n";
}
do_hook ("generic_header");
@@ -57,38 +28,34 @@
echo "\n\n";
}
- function displayInternalLink ($path, $text, $target="") {
+ function displayInternalLink ($path, $text, $target='') {
global $base_uri;
- if ($target != "")
+ if ($target != '')
$target = " target=\"$target\"";
echo ''.$text.'';
}
function displayPageHeader($color, $mailbox) {
- displayHtmlHeader ($color);
+ displayHtmlHeader ();
- printf('',
- $color[8], $color[4], $color[7], $color[7], $color[7]);
- echo "\n\n";
+ echo "\n\n";
/** Here is the header and wrapping table **/
$shortBoxName = readShortMailboxName($mailbox, ".");
- $shortBoxName = sqStripSlashes($shortBoxName);
echo "\n";
- echo "