- function general_info($motd, $org_logo, $version, $org_name, $color) {
- echo "<BR>";
- echo "<TABLE COLS=1 WIDTH=80% CELLSPACING=0 CELLPADDING=2 NOBORDER ALIGN=CENTER><TR><TD BGCOLOR=\"$color[9]\">";
- echo "<TABLE COLS=1 WIDTH=100% CELLSPACING=0 CELLPADDING=3 NOBORDER BGCOLOR=\"#FFFFFF\" ALIGN=CENTER>";
- echo " <TR>";
- echo " <TD BGCOLOR=\"$color[0]\">";
- echo " <B><CENTER>";
- printf (_("Welcome to %s's WebMail system"), $org_name);
- echo "</CENTER></B>";
- echo " <TR><TD BGCOLOR=\"#FFFFFF\">";
- echo " <TABLE COLS=2 WIDTH=90% CELLSPACING=0 CELLPADDING=3 NOBORDER align=\"center\">";
- echo " <TR>";
- echo " <TD BGCOLOR=\"#FFFFFF\"><CENTER>";
- if (strlen($org_logo) > 3)
- echo " <IMG SRC=\"$org_logo\">";
- else
- echo " <B>$org_name</B>";
- echo " <BR><CENTER>";
- printf (_("Running SquirrelMail version %s (c) 1999-2000."), $version);
- echo "</CENTER><BR>";
- echo " </CENTER></TD></TR><TR>";
- echo " <TD BGCOLOR=\"#FFFFFF\">";
- echo " $motd";
- echo " </TD>";
- echo " </TR>";
- echo " </TABLE>";
- echo " </TD></TR>";
- echo "</TABLE>";
- echo "</TD></TR></TABLE>";
- }
-
- function messages_deleted_message($mailbox, $sort, $startMessage, $color) {
- $urlMailbox = urlencode($mailbox);
-
- echo "<BR>";
- echo "<TABLE COLS=1 WIDTH=70% NOBORDER BGCOLOR=\"$color[4]\" ALIGN=CENTER>";
- echo " <TR>";
- echo " <TD BGCOLOR=\"$color[0]\">";
- echo " <B><CENTER>". _("Messages Deleted") ."</CENTER></B>";
- echo " </TD></TR><TR><TD>";
- echo " <CENTER><BR>". _("The selected messages were deleted successfully.") ."<BR>\n";
- echo " <BR>";
- echo " <A HREF=\"webmail.php?right_frame=right_main.php&sort=$sort&startMessage=$startMessage&mailbox=$urlMailbox\" TARGET=_top>";
- printf (_("Click here to return to %s"), $mailbox);
- echo "</A>.";
- echo " </CENTER>";
- echo " </TD></TR>";
- echo "</TABLE>";
+/**
+ * display_messages.php
+ *
+ * This contains all messages, including information, error, and just
+ * about any other message you can think of.
+ *
+ * @copyright © 1999-2007 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
+ * @package squirrelmail
+ */
+
+
+/**
+ * Displays error message and URL to message listing
+ *
+ * Fifth argument ($color array) is removed in 1.5.2.
+ * @param string $message error message
+ * @param string $mailbox mailbox name
+ * @param integer $sort sort order
+ * @param integer $startMessage first message
+ * @since 1.0
+ */
+function error_message($message, $mailbox, $sort, $startMessage) {
+ $urlMailbox = urlencode($mailbox);
+ $link = array (
+ 'URL' => sqm_baseuri()."src/right_main.php?sort=$sort&startMessage=$startMessage&mailbox=$urlMailbox",
+ 'TEXT' => sprintf (_("Click here to return to %s"),
+ strtoupper($mailbox) == 'INBOX' ? _("INBOX") : htmlspecialchars(imap_utf7_decode_local($mailbox)))
+ );
+ error_box($message, $link);
+}
+
+/**
+ * Displays error message
+ *
+ * Second argument ($color array) is changed to boolean $return_output as of 1.5.2.
+ * @param string $message error message
+ * @param boolean $return_output When TRUE, output is returned to caller
+ * instead of being sent to browser (OPTIONAL;
+ * default = FALSE)
+ * @since 1.0
+ */
+function plain_error_message($message, $return_output=FALSE) {
+ return error_box($message, NULL, $return_output);
+}
+
+/**
+ * Displays error when user is logged out
+ *
+ * Error strings can be overriden by logout_error hook
+ * @param string $errString error message
+ * @param string $errTitle title of page with error message
+ * @since 1.2.6
+ */
+function logout_error( $errString, $errTitle = '' ) {
+ global $frame_top, $org_logo, $org_logo_width, $org_logo_height, $org_name,
+ $hide_sm_attributions, $squirrelmail_language, $oTemplate;
+
+ $base_uri = sqm_baseuri();
+
+ $login_link = array (
+ 'URI' => $base_uri . 'src/login.php',
+ 'FRAME' => $frame_top
+ );
+
+ /* As of 1.5.2, plugin parameters are combined into one array;
+ plugins on this hook must be updated */
+ $temp = array(&$errString, &$errTitle, &$login_link);
+ do_hook('logout_error', $temp);
+
+ if ( $errTitle == '' ) {
+ $errTitle = $errString;