Added setting of language and a brief Norwegian translation.
[squirrelmail.git] / functions / page_header.php
1 <?
2 /**
3 ** page_header.php
4 **
5 ** Prints the page header (duh)
6 **
7 **/
8
9 $page_header_php = true;
10
11 if (!isset($prefs_php))
12 include ("../functions/prefs.php");
13
14 // This is done to ensure that the character set is correct when
15 // receiving input from HTTP forms
16 header ("Content-Type: text/html; charset=iso-8859-1");
17
18 // Setting the language to use for gettext if it is not English
19 // (the default language) or empty.
20 if (!isset($squirrelmail_language))
21 $squirrelmail_language = getPref ($data_dir, $username, "language");
22
23 if ($squirrelmail_language != "en" && $squirrelmail_language != "") {
24 putenv("LANG=$use_language");
25 bindtextdomain("squirrelmail", "../locale/");
26 textdomain("squirrelmail");
27
28 // Setting cookie to use on the login screen the next time the
29 // same user logs in.
30 if (!isset($HTTP_COOKIE_VARS["squirrelmail_language"]))
31 setcookie("squirrelmail_language", $squirrelmail_language,
32 time()+2592000);
33 }
34
35 function displayPageHeader($color, $mailbox) {
36 /** Here is the header and wrapping table **/
37 $shortBoxName = readShortMailboxName($mailbox, ".");
38 echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 COLS=2 WIDTH=100% CELLSPACING=0 CELLPADDING=2>";
39 echo " <TR BGCOLOR=\"$color[9]\" WIDTH=100%>";
40 echo " <TD ALIGN=left WIDTH=30%>";
41 echo " <FONT FACE=\"Arial,Helvetica\"><A HREF=\"signout.php\" TARGET=_top><B>" . _("Sign Out") . "</B></A></FONT>";
42 echo " </TD><TD ALIGN=right WIDTH=70%>";
43 echo " <FONT FACE=\"Arial,Helvetica\"><div align=right>" . _("Current Folder: ") . "<B>$shortBoxName&nbsp;</div></B></FONT>";
44 echo " </TD>";
45 echo " </TR></TABLE>\n";
46 echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 COLS=2 WIDTH=100% CELLSPACING=0 CELLPADDING=2><TR>";
47 echo " <TD ALIGN=left WIDTH=70%>";
48 echo " <FONT FACE=\"Arial,Helvetica\"><A HREF=\"compose.php\">" . _("Compose") . "</A></FONT>&nbsp&nbsp";
49 echo " <FONT FACE=\"Arial,Helvetica\">". _("Addresses") ."</FONT>&nbsp&nbsp";
50 echo " <FONT FACE=\"Arial,Helvetica\"><A HREF=\"folders.php\">" . _("Folders") . "</A></FONT>&nbsp&nbsp";
51 echo " <FONT FACE=\"Arial,Helvetica\"><A HREF=\"options.php\">" . _("Options") . "</A></FONT>&nbsp&nbsp";
52 echo " </TD><TD ALIGN=right WIDTH=30%>";
53 echo " <FONT FACE=\"Arial,Helvetica\"><A HREF=\"http://squirrelmail.sourceforge.net\" TARGET=_top>SquirrelMail</A></FONT>";
54 echo " </TD>";
55 echo "</TABLE>";
56 }
57 ?>