Call me anal
[squirrelmail.git] / plugins / newmail / newmail.php
1 <?php
2
3 /**
4 * newmail.php - popup page
5 *
6 * Displays all options relating to new mail sounds
7 *
8 * @copyright &copy; 1999-2007 The SquirrelMail Project Team
9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
10 * @version $Id$
11 * @package plugins
12 * @subpackage newmail
13 */
14
15 /**
16 * Path for SquirrelMail required files.
17 * @ignore
18 */
19 require('../../include/init.php');
20
21 /**
22 * Make sure plugin is activated!
23 */
24 global $plugins;
25 if (!in_array('newmail', $plugins))
26 exit;
27
28 /** load default config */
29 if (file_exists(SM_PATH . 'plugins/newmail/config_default.php')) {
30 include_once(SM_PATH . 'plugins/newmail/config_default.php');
31 }
32
33 /** load config */
34 if (file_exists(SM_PATH . 'config/newmail_config.php')) {
35 include_once(SM_PATH . 'config/newmail_config.php');
36 } elseif (file_exists(SM_PATH . 'plugins/newmail/config.php')) {
37 include_once(SM_PATH . 'plugins/newmail/config.php');
38 }
39
40 sqGetGlobalVar('numnew', $numnew, SQ_GET);
41 $numnew = (int)$numnew;
42
43 global $username, $org_title,
44 $newmail_popup_title_bar_singular, $newmail_popup_title_bar_plural;
45
46 // make sure default strings are in pot file
47 $ignore = _("New Mail");
48
49 $singular_title = "New Mail";
50 $plural_title = "New Mail";
51 if (!empty($newmail_popup_title_bar_singular))
52 $singular_title = $newmail_popup_title_bar_singular;
53 if (!empty($newmail_popup_title_bar_plural))
54 $plural_title = $newmail_popup_title_bar_plural;
55 list($singular_title, $plural_title) = str_replace(array('###USERNAME###', '###ORG_TITLE###'), array($username, $org_title), array($singular_title, $plural_title));
56 $title = sprintf(ngettext($singular_title, $plural_title, $numnew), $numnew);
57
58
59 displayHtmlHeader( $title, '', FALSE );
60
61 echo '<body bgcolor="'.$color[4].'" topmargin="0" leftmargin="0" rightmargin="0" marginwidth="0" marginheight="0">'."\n".
62 '<div style="text-align: center;">'. "\n" .
63 html_tag( 'table', "\n" .
64 html_tag( 'tr', "\n" .
65 // i18n: %s inserts the organisation name (typically SquirrelMail)
66 html_tag( 'td', '<b>' . sprintf(_("%s notice:"), $org_name) . '</b>', 'center', $color[0] )
67 ) .
68 html_tag( 'tr', "\n" .
69 html_tag( 'td',
70 '<br /><big><font color="' . $color[2] . '">'.
71 sprintf(ngettext("You have %s new message","You have %s new messages",$numnew), $numnew ) .
72 '</font><br /></big><br />' . "\n" .
73 '<form name="nm">' . "\n".
74 '<input type="button" name="bt" value="' . _("Close Window") .
75 '" onclick="javascript:window.close();" />'."\n".
76 '</form>',
77 'center' )
78 ) ,
79 '', '', 'width="100%" cellpadding="2" cellspacing="2" border="0"' ) .
80 '</div>' .
81 "<script type=\"text/javascript\">\n".
82 "<!--\n".
83 "document.nm.bt.focus();\n".
84 "-->\n".
85 "</script>\n".
86 "</body></html>\n";