OK, so it wants a trailing slash...
[squirrelmail.git] / functions / display_messages.php
... / ...
CommitLineData
1<?php
2
3/**
4 * display_messages.php
5 *
6 * Copyright (c) 1999-2002 The SquirrelMail Project 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
15function error_username_password_incorrect() {
16 global $frame_top, $color;
17 /* XXX: Should really not start the HTML before this, or close off more
18 cleanly. */
19
20 if (!isset($frame_top)) {
21 $frame_top = '_top';
22 }
23
24 echo '<BR>'.
25 '<TABLE COLS=1 WIDTH="75%" BORDER="0" BGCOLOR="' . $color[4] . '" ALIGN=CENTER>'.
26 '<TR BGCOLOR="' . $color[0] . '">'.
27 '<TH>' . _("ERROR") . '</TH>'.
28 '</TR>' .
29 '<TR><TD>'.
30 '<CENTER><BR>' . _("Unknown user or password incorrect.") .
31 '<BR><A HREF="login.php" TARGET='.$frame_top.'>' .
32 _("Click here to try again") .
33 '</A>.</CENTER>'.
34 '</TD></TR>'.
35 '</TABLE>'.
36 '</BODY></HTML>';
37}
38
39function general_info($motd, $org_logo, $version, $org_name, $color) {
40
41 echo '<BR>'.
42 "<TABLE COLS=1 WIDTH=\"80%\" CELLSPACING=0 CELLPADDING=2 BORDER=\"0\" ALIGN=CENTER><TR><TD BGCOLOR=\"$color[9]\">".
43 '<TABLE COLS=1 WIDTH="100%" CELLSPACING=0 CELLPADDING=3 BORDER="0" BGCOLOR="' . $color[4] . '" ALIGN=CENTER>'.
44 '<TR>' .
45 "<TD BGCOLOR=\"$color[0]\">" .
46 '<B><CENTER>';
47 printf (_("Welcome to %s's WebMail system"), $org_name);
48 echo '</CENTER></B>'.
49 '<TR><TD BGCOLOR="' . $color[4] . '">'.
50 '<TABLE COLS=2 WIDTH="90%" CELLSPACING=0 CELLPADDING=3 BORDER="0" align="center">'.
51 '<TR>'.
52 '<TD BGCOLOR="' . $color[4] . '"><CENTER>';
53 if ( strlen($org_logo) > 3 ) {
54 echo "<IMG SRC=\"$org_logo\">";
55 } else {
56 echo "<B>$org_name</B>";
57 }
58 echo '<BR><CENTER>';
59 printf (_("Running SquirrelMail version %s (c) 1999-2001."), $version);
60 echo '</CENTER><BR>'.
61 '</CENTER></TD></TR><TR>' .
62 '<TD BGCOLOR="' . $color[4] . '">' .
63 $motd.
64 '</TD>'.
65 '</TR>'.
66 '</TABLE>'.
67 '</TD></TR>'.
68 '</TABLE>'.
69 '</TD></TR></TABLE>';
70}
71
72function error_message($message, $mailbox, $sort, $startMessage, $color) {
73 $urlMailbox = urlencode($mailbox);
74
75 echo '<BR>'.
76 "<TABLE COLS=1 WIDTH=\"70%\" BORDER=\"0\" BGCOLOR=\"$color[4]\" ALIGN=CENTER>".
77 '<TR>'.
78 "<TD BGCOLOR=\"$color[0]\">".
79 "<FONT COLOR=\"$color[2]\"><B><CENTER>" . _("ERROR") . '</CENTER></B></FONT>'.
80 '</TD></TR><TR><TD>'.
81 "<CENTER><BR>$message<BR>\n".
82 '<BR>'.
83 "<A HREF=\"right_main.php?sort=$sort&amp;startMessage=$startMessage&amp;mailbox=$urlMailbox\">";
84 printf (_("Click here to return to %s"), $mailbox);
85 echo '</A>.'.
86 '</TD></TR>'.
87 '</TABLE>';
88}
89
90function plain_error_message($message, $color) {
91 echo "<br><TABLE COLS=1 WIDTH=\"70%\" BORDER=\"0\" BGCOLOR=\"$color[4]\" ALIGN=CENTER>".
92 '<TR>'.
93 "<TD BGCOLOR=\"$color[0]\">".
94 "<FONT COLOR=\"$color[2]\"><B><CENTER>" . _("ERROR") . '</CENTER></B></FONT>'.
95 '</TD></TR><TR><TD>'.
96 "<CENTER><BR>$message".
97 '</CENTER>'.
98 '</TD></TR>'.
99 '</TABLE>';
100}
101
102function logout_error( $errString, $errTitle = '' ) {
103
104 GLOBAL $frame_top, $org_logo, $org_name, $org_logo_width, $org_logo_height,
105 $hide_sm_attributions, $version;
106
107 include_once( '../functions/page_header.php' );
108 if ( !isset( $org_logo ) ) {
109 // Don't know yet why, but in some accesses $org_logo is not set.
110 include( '../config/config.php' );
111 }
112 /* Display width and height like good little people */
113 $width_and_height = '';
114 if (isset($org_logo_width) && is_int($org_logo_width) && $org_logo_width>0) {
115 $width_and_height = " WIDTH=\"$org_logo_width\"";
116 }
117 if (isset($org_logo_height) && is_int($org_logo_height) && $org_logo_height>0) {
118 $width_and_height .= " HEIGHT=\"$org_logo_height\"";
119 }
120
121 if (!isset($frame_top) || $frame_top == '' ) {
122 $frame_top = '_top';
123 }
124
125 if ( !isset( $color ) ) {
126 $color = array();
127 $color[0] = '#DCDCDC'; /* light gray TitleBar */
128 $color[1] = '#800000'; /* red */
129 $color[2] = '#CC0000'; /* light red Warning/Error Messages */
130 $color[3] = '#A0B8C8'; /* green-blue Left Bar Background */
131 $color[4] = '#FFFFFF'; /* white Normal Background */
132 $color[5] = '#FFFFCC'; /* light yellow Table Headers */
133 $color[6] = '#000000'; /* black Text on left bar */
134 $color[7] = '#0000CC'; /* blue Links */
135 $color[8] = '#000000'; /* black Normal text */
136 $color[9] = '#ABABAB'; /* mid-gray Darker version of #0 */
137 $color[10] = '#666666'; /* dark gray Darker version of #9 */
138 $color[11] = '#770000'; /* dark red Special Folders color */
139 $color[12] = '#EDEDED';
140 $color[15] = '#002266'; /* (dark blue) Unselectable folders */
141 }
142
143 if ( $errTitle == '' ) {
144 $errTitle = $errString;
145 }
146 set_up_language($squirrelmail_language, true);
147 displayHtmlHeader( $errTitle );
148
149 echo "<BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n\n" .
150 '<CENTER>'.
151 "<IMG SRC=\"$org_logo\" ALT=\"" . sprintf(_("%s Logo"), $org_name) .
152 "\"$width_and_height><BR>\n".
153 ( $hide_sm_attributions ? '' :
154 '<SMALL>' . sprintf (_("SquirrelMail version %s"), $version) . "<BR>\n".
155 ' ' . _("By the SquirrelMail Development Team") . "<BR></SMALL>\n" ) .
156 "<table cellspacing=1 cellpadding=0 bgcolor=\"$color[1]\" width=\"70%\"><tr><td>".
157 "<TABLE COLS=1 WIDTH=\"100%\" BORDER=\"0\" BGCOLOR=\"$color[4]\" ALIGN=CENTER>".
158 "<TR><TD BGCOLOR=\"$color[0]\">".
159 "<FONT COLOR=\"$color[2]\"><B><CENTER>" . _("ERROR") .
160 '</CENTER></B></FONT></TD></TR>'.
161 '<TR><TD><CENTER>' . $errString . '</CENTER></TD></TR>'.
162 "<TR><TD BGCOLOR=\"$color[0]\">".
163 "<FONT COLOR=\"$color[2]\"><B><CENTER>".
164 '<a href="' . $base_uri . '" target="' . $frame_top . '">' .
165 _("Go to the login page") . "</a></CENTER></B></FONT>".
166 '</TD></TR>'.
167 '</TABLE></td></tr></table></body></html>';
168}
169
170?>