newmail.php 3.0 KB

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