X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=plugins%2Fnewmail%2Fnewmail.php;h=d2f08e32bae14d4c668e9882087136d208a7ae90;hb=b1fbb25f561e6b151f7cf72744b03253f8d395fb;hp=a6d669918523186bf45263bbc1c2fa1403b85fd3;hpb=f265009a3bf872cf6c9d9aaefe7949e1688555a0;p=squirrelmail.git diff --git a/plugins/newmail/newmail.php b/plugins/newmail/newmail.php index a6d66991..d2f08e32 100644 --- a/plugins/newmail/newmail.php +++ b/plugins/newmail/newmail.php @@ -5,29 +5,65 @@ * * Displays all options relating to new mail sounds * - * @copyright © 1999-2006 The SquirrelMail Project Team + * @copyright 1999-2012 The SquirrelMail Project Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package plugins * @subpackage newmail */ -/** @ignore */ -define('SM_PATH','../../'); +/** + * Path for SquirrelMail required files. + * @ignore + */ +require('../../include/init.php'); + +/** + * Make sure plugin is activated! + */ +global $plugins; +if (!in_array('newmail', $plugins)) + exit; + +/** load default config */ +if (file_exists(SM_PATH . 'plugins/newmail/config_default.php')) { + include_once(SM_PATH . 'plugins/newmail/config_default.php'); +} + +/** load config */ +if (file_exists(SM_PATH . 'config/newmail_config.php')) { + include_once(SM_PATH . 'config/newmail_config.php'); +} elseif (file_exists(SM_PATH . 'plugins/newmail/config.php')) { + include_once(SM_PATH . 'plugins/newmail/config.php'); +} + + sqGetGlobalVar('numnew', $numnew, SQ_GET); + $numnew = (int)$numnew; + + global $username, $org_title, + $newmail_popup_title_bar_singular, $newmail_popup_title_bar_plural; + + // make sure default strings are in pot file + $ignore = _("New Mail"); -/* SquirrelMail required files. */ -require_once(SM_PATH . 'include/validate.php'); + $singular_title = "New Mail"; + $plural_title = "New Mail"; + if (!empty($newmail_popup_title_bar_singular)) + $singular_title = $newmail_popup_title_bar_singular; + if (!empty($newmail_popup_title_bar_plural)) + $plural_title = $newmail_popup_title_bar_plural; + list($singular_title, $plural_title) = str_replace(array('###USERNAME###', '###ORG_TITLE###'), array($username, $org_title), array($singular_title, $plural_title)); + $title = sprintf(ngettext($singular_title, $plural_title, $numnew), $numnew); -sqGetGlobalVar('numnew', $numnew, SQ_GET); -$numnew = (int)$numnew; - displayHtmlHeader( _("New Mail"), '', FALSE ); + displayHtmlHeader( $title, '', FALSE ); echo ''."\n". '
'. "\n" . html_tag( 'table', "\n" . html_tag( 'tr', "\n" . - html_tag( 'td', '' . _("SquirrelMail Notice:") . '', 'center', $color[0] ) + // i18n: %s inserts the organisation name (typically SquirrelMail) + html_tag( 'td', '' . sprintf(_("%s notice:"), $org_name) . '', 'center', $color[0] ) ) . html_tag( 'tr', "\n" . html_tag( 'td', @@ -42,10 +78,9 @@ $numnew = (int)$numnew; ) , '', '', 'width="100%" cellpadding="2" cellspacing="2" border="0"' ) . '
' . - "\n". "\n"; -?> \ No newline at end of file