X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;ds=sidebyside;f=plugins%2Fnewmail%2Ftestsound.php;h=0640407e12586e5f6b9892aaa928eac2ec087ce4;hb=aa1340ebb1e775a36b74dbfc22391ee095d45394;hp=0bcb4a7264e913d1c25c736dad85f3f96bf7729e;hpb=4cf438432a1f2bfdba752e075ec6458ec3e290ba;p=squirrelmail.git diff --git a/plugins/newmail/testsound.php b/plugins/newmail/testsound.php index 0bcb4a72..0640407e 100644 --- a/plugins/newmail/testsound.php +++ b/plugins/newmail/testsound.php @@ -3,42 +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-2017 The SquirrelMail Project Team + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ + * @package plugins + * @subpackage newmail */ - chdir ("../"); - require_once('../src/validate.php'); - require_once('../functions/html.php'); - require_once("../src/load_prefs.php"); - if (!isset($sound)) { - $sound = "Click.wav"; - } - $sound = str_replace('../plugins/newmail/', '', $sound); - $sound = str_replace('../', '', $sound); - $sound = str_replace("..\\", '', $sound); +/** + * Path for SquirrelMail required files. + * @ignore + */ +require('../../include/init.php'); - displayHtmlHeader( _("Test Sound"), '', FALSE ); +displayHtmlHeader( _("Test Sound"), '', FALSE ); - echo "\n". - html_tag( 'table', - html_tag( 'tr', - html_tag( 'td', - "". - '
'. - '' . _("Loading the sound...") . '

'. +echo ''."\n"; + +if ( ! sqgetGlobalVar('sound', $sound, SQ_GET) ) { + $sound = 'Click.wav'; +} elseif ( $sound == '(none)' ) { + echo '


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

'. + ''. + '
'. + ''; + return; +} + +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