IMAP server error intercepted before PHP error.
[squirrelmail.git] / functions / display_messages.php
1 <?php
2
3 /**
4 * display_messages.php
5 *
6 * Copyright (c) 1999-2001 The SquirrelMail Development Team
7 * Licensed under the GNU GPL. For full terms see the file COPYING.
8 *
9 * This contains all messages, including information, error, and just
10 * about any other message you can think of.
11 *
12 * $Id$
13 */
14
15 /*****************************************************************/
16 /*** THIS FILE NEEDS TO HAVE ITS FORMATTING FIXED!!! ***/
17 /*** PLEASE DO SO AND REMOVE THIS COMMENT SECTION. ***/
18 /*** + Base level indent should begin at left margin, as ***/
19 /*** the first line of the function definition below. ***/
20 /*** + All identation should consist of four space blocks ***/
21 /*** + Tab characters are evil. ***/
22 /*** + all comments should use "slash-star ... star-slash" ***/
23 /*** style -- no pound characters, no slash-slash style ***/
24 /*** + FLOW CONTROL STATEMENTS (if, while, etc) SHOULD ***/
25 /*** ALWAYS USE { AND } CHARACTERS!!! ***/
26 /*** + Please use ' instead of ", when possible. Note " ***/
27 /*** should always be used in _( ) function calls. ***/
28 /*** Thank you for your help making the SM code more readable. ***/
29 /*****************************************************************/
30
31 function error_username_password_incorrect($color) {
32 echo '<BR>'.
33 "<TABLE COLS=1 WIDTH=75% NOBORDER BGCOLOR=\"$color[4]\" ALIGN=CENTER>".
34 '<TR>'.
35 "<TD BGCOLOR=\"$color[0]\">".
36 '<B><CENTER>ERROR</CENTER></B>'.
37 '</TD></TR><TR><TD>'.
38 '<CENTER><BR>' . _("Unknown user or password incorrect.") .
39 '<BR><A HREF="login.php" TARGET=_top>' .
40 _("Click here to try again") .
41 '</A>.</CENTER>'.
42 '</TD></TR>'.
43 '</TABLE>'.
44 '</BODY></HTML>';
45
46 }
47
48 function general_info($motd, $org_logo, $version, $org_name, $color) {
49 echo '<BR>';
50 echo "<TABLE COLS=1 WIDTH=80% CELLSPACING=0 CELLPADDING=2 NOBORDER ALIGN=CENTER><TR><TD BGCOLOR=\"$color[9]\">";
51 echo '<TABLE COLS=1 WIDTH=100% CELLSPACING=0 CELLPADDING=3 NOBORDER BGCOLOR="#FFFFFF" ALIGN=CENTER>';
52 echo ' <TR>';
53 echo " <TD BGCOLOR=\"$color[0]\">";
54 echo ' <B><CENTER>';
55 printf (_("Welcome to %s's WebMail system"), $org_name);
56 echo ' </CENTER></B>';
57 echo ' <TR><TD BGCOLOR="#FFFFFF">';
58 echo ' <TABLE COLS=2 WIDTH=90% CELLSPACING=0 CELLPADDING=3 NOBORDER align="center">';
59 echo ' <TR>';
60 echo ' <TD BGCOLOR="#FFFFFF"><CENTER>';
61 if (strlen($org_logo) > 3)
62 echo " <IMG SRC=\"$org_logo\">";
63 else
64 echo " <B>$org_name</B>";
65 echo ' <BR><CENTER>';
66 printf (_("Running SquirrelMail version %s (c) 1999-2000."), $version);
67 echo ' </CENTER><BR>';
68 echo ' </CENTER></TD></TR><TR>';
69 echo ' <TD BGCOLOR="#FFFFFF">';
70 echo " $motd";
71 echo ' </TD>';
72 echo ' </TR>';
73 echo ' </TABLE>';
74 echo ' </TD></TR>';
75 echo '</TABLE>';
76 echo '</TD></TR></TABLE>';
77 }
78
79 function error_message($message, $mailbox, $sort, $startMessage, $color) {
80 $urlMailbox = urlencode($mailbox);
81
82 echo '<BR>';
83 echo "<TABLE COLS=1 WIDTH=70% NOBORDER BGCOLOR=\"$color[4]\" ALIGN=CENTER>";
84 echo ' <TR>';
85 echo " <TD BGCOLOR=\"$color[0]\">";
86 echo " <FONT COLOR=\"$color[2]\"><B><CENTER>" . _("ERROR") . '</CENTER></B></FONT>';
87 echo ' </TD></TR><TR><TD>';
88 echo " <CENTER><BR>$message<BR>\n";
89 echo ' <BR>';
90 echo " <A HREF=\"right_main.php?sort=$sort&startMessage=$startMessage&mailbox=$urlMailbox\">";
91 printf (_("Click here to return to %s"), $mailbox);
92 echo '</A>.';
93 echo ' </TD></TR>';
94 echo '</TABLE>';
95 }
96
97 function plain_error_message($message, $color) {
98 echo '<BR>';
99 echo "<TABLE COLS=1 WIDTH=70% NOBORDER BGCOLOR=\"$color[4]\" ALIGN=CENTER>";
100 echo ' <TR>';
101 echo " <TD BGCOLOR=\"$color[0]\">";
102 echo " <FONT COLOR=\"$color[2]\"><B><CENTER>" . _("ERROR") . '</CENTER></B></FONT>';
103 echo ' </TD></TR><TR><TD>';
104 echo " <CENTER><BR>$message";
105 echo ' </CENTER>';
106 echo ' </TD></TR>';
107 echo '</TABLE>';
108 }
109 ?>