X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=plugins%2Fnewmail%2Ftestsound.php;h=e7a403e718eb843bf5cbcfffeea3de7b390d881e;hb=395c3216ac2791704149054f0569db0be696a003;hp=f8ddde9d432fe4ef40a9d08b00e93601992a3197;hpb=d0dbdb1441f83386e2284e99ab0f4e14db8d218f;p=squirrelmail.git diff --git a/plugins/newmail/testsound.php b/plugins/newmail/testsound.php index f8ddde9d..e7a403e7 100644 --- a/plugins/newmail/testsound.php +++ b/plugins/newmail/testsound.php @@ -3,47 +3,47 @@ /** * testsound.php * - * Copyright (c) 1999-2002 The SquirrelMail Project Team - * Licensed under the GNU GPL. For full terms see the file COPYING. - * - * Displays all options relating to new mail sounds - * - * $Id$ + * @copyright 1999-2011 The SquirrelMail Project Team + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ + * @package plugins + * @subpackage newmail */ - chdir ("../"); - chdir('..'); - define('SM_PATH','../'); +/** + * Path for SquirrelMail required files. + * @ignore + */ +require('../../include/init.php'); - /* SquirrelMail required files. */ - require_once(SM_PATH . 'include/validate.php'); - require_once(SM_PATH . 'functions/html.php'); - require_once(SM_PATH . 'src/load_prefs.php'); +displayHtmlHeader( _("Test Sound"), '', FALSE ); - if (!isset($sound)) { - $sound = "Click.wav"; - } - $sound = str_replace('../plugins/newmail/', '', $sound); - $sound = str_replace('../', '', $sound); - $sound = str_replace("..\\", '', $sound); +echo ''."\n"; - displayHtmlHeader( _("Test Sound"), '', FALSE ); +if ( ! sqgetGlobalVar('sound', $sound, SQ_GET) ) { + $sound = 'Click.wav'; +} elseif ( $sound == '(none)' ) { + echo '


'. + '' . _("No sound specified") . '

'. + ''. + '
'. + ''; + return; +} - echo "\n". - html_tag( 'table', - html_tag( 'tr', - html_tag( 'td', - "". - '
'. - '' . _("Loading the sound...") . '

'. +echo html_tag( 'table', + html_tag( 'tr', + html_tag( 'td', + newmail_create_media_tags($sound)."\n". + '
'. + '' . _("Loading the sound...") . '
'. '
'. ''. + ' " onclick="window.close()" />'. '
' , 'center' ) ) , 'center' ) . ''; - -?> +?> \ No newline at end of file