Be a bit more verbose in the error message about PEAR not being included:
[squirrelmail.git] / functions / display_messages.php
index 83848d0b804f82bc48e2c4202e8ab4a9b51e9863..243642b180f3971f6bffe33aad029b011ea6ae5a 100644 (file)
@@ -3,16 +3,21 @@
 /**
  * display_messages.php
  *
- * Copyright (c) 1999-2003 The SquirrelMail Project Team
+ * Copyright (c) 1999-2004 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$
+ * @version $Id$
  * @package squirrelmail
  */
 
+/**
+ * including plugin functions
+ */
+require_once(SM_PATH . 'functions/plugin.php');
+
 /**
  * Find out where squirrelmail lives and try to be smart about it.
  * The only problem would be when squirrelmail lives in directories
@@ -37,14 +42,12 @@ function sqm_baseuri(){
 
 function error_message($message, $mailbox, $sort, $startMessage, $color) {
     $urlMailbox = urlencode($mailbox);
-    if (strtoupper($mailbox) == 'INBOX')
-                   $mailbox = _("INBOX");
     $string = '<tr><td ALIGN="center">' . $message . '</td></tr>'."\n".
                '<tr><td ALIGN="center">'.
                   '<A HREF="' . sqm_baseuri() 
                   . "src/right_main.php?sort=$sort&amp;startMessage=$startMessage"
                   . "&amp;mailbox=$urlMailbox\">" .
-    sprintf (_("Click here to return to %s"), imap_utf7_decode_local($mailbox)) .
+    sprintf (_("Click here to return to %s"), strtoupper($mailbox) == 'INBOX' ? _("INBOX") : imap_utf7_decode_local($mailbox)) .
            '</A></td></tr>';
     error_box($string, $color);
 }
@@ -124,9 +127,22 @@ function logout_error( $errString, $errTitle = '' ) {
 function error_box($string, $color) {
     global $pageheader_sent;
 
+    if ( !isset( $color ) ) {
+        $color = array();
+        $color[0]  = '#DCDCDC';  /* light gray    TitleBar               */
+        $color[1]  = '#800000';  /* red                                  */
+        $color[2]  = '#CC0000';  /* light red     Warning/Error Messages */
+        $color[4]  = '#FFFFFF';  /* white         Normal Background      */
+        $color[7]  = '#0000CC';  /* blue          Links                  */
+        $color[8]  = '#000000';  /* black         Normal text            */
+    }
+
     $err = _("ERROR");
 
-    $string = concat_hook_function('error_box', $string);
+    $ret = concat_hook_function('error_box', $string);
+    if($ret != '') {
+        $string = $ret;
+    }
 
     /* check if the page header has been sent; if not, send it! */
     if(!isset($pageheader_sent) && !$pageheader_sent) {