Display the total of new messages in the newmail popup.
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 27 Sep 2003 14:42:18 +0000 (14:42 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 27 Sep 2003 14:42:18 +0000 (14:42 +0000)
This may go into stable after 1.4.2 because it changes strings.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5781 7612ce4b-ef26-0410-bec9-ea0150e637f0

plugins/newmail/newmail.php
plugins/newmail/setup.php

index 1ebb3de61934b63685aebf860d1809162201ce64..75f732c26c51635ff1bd0ed9310b6f5120977f14 100644 (file)
@@ -18,6 +18,8 @@ require_once(SM_PATH . 'include/validate.php');
 require_once(SM_PATH . 'include/load_prefs.php');
 require_once(SM_PATH . 'functions/page_header.php');
 
+sqGetGlobalVar('numnew', $numnew, SQ_GET);
+
    displayHtmlHeader( _("New Mail"), '', FALSE );
 
    echo "<body bgcolor=\"$color[4]\" topmargin=0 leftmargin=0 rightmargin=0 marginwidth=0 marginheight=0>\n".
@@ -28,10 +30,14 @@ require_once(SM_PATH . 'functions/page_header.php');
             ) .
             html_tag( 'tr', "\n" .
                 html_tag( 'td',
-                    '<br><big><font color="' . $color[2] . '">' .
-                    _("You have new mail!") . '</font><br></big><br>' . "\n" .
+                    '<br><big><font color="' . $color[2] . '">' . _("You have").' '.
+                   sprintf( ( $numnew == 1 ?
+                       _("%s new message") :
+                       _("%s new messages") ), $numnew ) .
+                    '</font><br></big><br>' . "\n" .
                     '<form name="nm">' . "\n".
-                    '<input type=button name=bt value="' . _("Close Window") .'" onClick="javascript:window.close();">'."\n".
+                    '<input type=button name=bt value="' . _("Close Window") .
+                    '" onClick="javascript:window.close();">'."\n".
                     '</form>',
                 'center' )
             ) ,
index d925f57fc191da52b9bf4d11b7a68be321ce75f7..b8a3e65e1e10b6c2e72ec9ab467111d1d5ed919c 100644 (file)
                 echo "<SCRIPT LANGUAGE=\"JavaScript\">\n".
                     "<!--\n".
                     "function PopupScriptLoad() {\n".
-                        'window.open("'.sqm_baseuri().'plugins/newmail/newmail.php", "SMPopup",'.
+                        'window.open("'.sqm_baseuri().'plugins/newmail/newmail.php?numnew='.$totalNew.
+                                    '", "SMPopup",'.
                                      "\"width=200,height=130,scrollbars=no\");\n".
                         "if (BeforePopupScript != null)\n".
                             "BeforePopupScript();\n".