From 19ffcf256b060c63dbc38cb6d1276e883e7542cc Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 13 Aug 2016 14:28:26 -0600 Subject: [PATCH] Update ivr_menu_edit.php --- app/ivr_menus/ivr_menu_edit.php | 45 +++++++++++++++++---------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/app/ivr_menus/ivr_menu_edit.php b/app/ivr_menus/ivr_menu_edit.php index 661cdd52f4..b08dac1d17 100644 --- a/app/ivr_menus/ivr_menu_edit.php +++ b/app/ivr_menus/ivr_menu_edit.php @@ -336,6 +336,10 @@ $prep_statement->execute(); $phrases = $prep_statement->fetchAll(PDO::FETCH_NAMED); +//get the sound files + $file = new file; + $sound_files = $file->sounds(); + //content require_once "resources/header.php"; $document['title'] = $text['title-ivr_menu']; @@ -496,20 +500,19 @@ } //sounds /* - $files = recur_sounds_dir($_SESSION['switch']['sounds']['dir']); - if (count($files) > 0) { + if (is_array($sound_files)) { echo "\n"; - foreach ($files as $key => $value) { + foreach ($sound_files as $value) { if (strlen($value) > 0) { if (substr($ivr_menu_greet_long, 0, 71) == "\$\${sounds_dir}/\${default_language}/\${default_dialect}/\${default_voice}/") { $ivr_menu_greet_long = substr($ivr_menu_greet_long, 71); } - if ($ivr_menu_greet_long == $key) { + if ($ivr_menu_greet_long == $value) { $tmp_selected = true; - echo " \n"; + echo " \n"; } else { - echo " \n"; + echo " \n"; } } } @@ -639,20 +642,19 @@ unset ($prep_statement); //sounds /* - $files = recur_sounds_dir($_SESSION['switch']['sounds']['dir']); - if (count($files) > 0) { + if (is_array($sound_files)) { echo "\n"; - foreach ($files as $key => $value) { + foreach ($sound_files as $value) { if (strlen($value) > 0) { if (substr($ivr_menu_greet_short, 0, 71) == "\$\${sounds_dir}/\${default_language}/\${default_dialect}/\${default_voice}/") { $ivr_menu_greet_short = substr($ivr_menu_greet_short, 71); } - if ($ivr_menu_greet_short == $key) { + if ($ivr_menu_greet_short == $value) { $tmp_selected = true; - echo " \n"; + echo " \n"; } else { - echo " \n"; + echo " \n"; } } } @@ -945,20 +947,19 @@ echo "\n"; } //sounds - $files = recur_sounds_dir($_SESSION['switch']['sounds']['dir']); - if (count($files) > 0) { + if (is_array($sound_files)) { echo "\n"; - foreach ($files as $key => $value) { + foreach ($sound_files as $value) { if (strlen($value) > 0) { if (substr($ivr_menu_invalid_sound, 0, 71) == "\$\${sounds_dir}/\${default_language}/\${default_dialect}/\${default_voice}/") { $ivr_menu_invalid_sound = substr($ivr_menu_invalid_sound, 71); } - if ($ivr_menu_invalid_sound == $key) { + if ($ivr_menu_invalid_sound == $value) { $tmp_selected = true; - echo " \n"; + echo " \n"; } else { - echo " \n"; + echo " \n"; } } } @@ -1043,17 +1044,17 @@ $files = recur_sounds_dir($_SESSION['switch']['sounds']['dir']); if (count($files) > 0) { echo "\n"; - foreach ($files as $key => $value) { + foreach ($sound_files as $value) { if (strlen($value) > 0) { if (substr($ivr_menu_exit_sound, 0, 71) == "\$\${sounds_dir}/\${default_language}/\${default_dialect}/\${default_voice}/") { $ivr_menu_exit_sound = substr($ivr_menu_exit_sound, 71); } - if ($ivr_menu_exit_sound == $key) { + if ($ivr_menu_exit_sound == $value) { $tmp_selected = true; - echo " \n"; + echo " \n"; } else { - echo " \n"; + echo " \n"; } } }