X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fdisplay_messages.php;h=0854caba1ff8630232d577cd2ffbfd6d97b1ada6;hb=2d92fc32c25e81284f0c40ec8d3c1ee537bb2a6b;hp=29e1c16ecb40a8c44a3ba89a3ffe9e1f57cc8419;hpb=399846eafde629feb72e20d8a2b1d24d247da183;p=squirrelmail.git
diff --git a/functions/display_messages.php b/functions/display_messages.php
index 29e1c16e..0854caba 100644
--- a/functions/display_messages.php
+++ b/functions/display_messages.php
@@ -3,181 +3,194 @@
/**
* display_messages.php
*
- * Copyright (c) 1999-2002 The SquirrelMail Project Team
- * Licensed under the GNU GPL. For full terms see the file COPYING.
- *
* This contains all messages, including information, error, and just
* about any other message you can think of.
*
- * $Id$
+ * @copyright 1999-2012 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
+ * @package squirrelmail
*/
-function sqm_baseuri(){
- global $base_uri, $PHP_SELF;
- if (isset($base_uri)){
- return $base_uri;
- }
- $dirs = array("|src/.*|", "|plugins/.*|", "|functions/.*|");
- $repl = array("", "", "");
- $base_uri = preg_replace($dirs, $repl, $PHP_SELF);
- return $base_uri;
-}
-
-function error_username_password_incorrect() {
- global $frame_top, $color;
- /* XXX: Should really not start the HTML before this, or close off more
- cleanly. */
- if (!isset($frame_top)) {
- $frame_top = '_top';
- }
+/**
+ * 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);
+}
- echo '
'.
- '
' . _("ERROR") . ' | '. - '
---|
'.
- ' ' . _("Unknown user or password incorrect.") . - ' ' . _("Click here to try again") . - '. |