diff --git a/app/conference_centers/conference_center_edit.php b/app/conference_centers/conference_center_edit.php index ac436ee256..46fcdaf38a 100644 --- a/app/conference_centers/conference_center_edit.php +++ b/app/conference_centers/conference_center_edit.php @@ -234,32 +234,11 @@ if (empty($conference_center_enabled)) { $conference_center_enabled = "true"; } if (empty($conference_center_pin_length)) { $conference_center_pin_length = 9; } -//get the recordings - $sql = "select recording_name, recording_filename from v_recordings "; - $sql .= "where domain_uuid = :domain_uuid "; - $sql .= "order by recording_name asc "; - $parameters['domain_uuid'] = $_SESSION['domain_uuid']; - $database = new database; - $recordings = $database->select($sql, $parameters ?? null, 'all'); - unset($sql, $parameters); - -//get the phrases - $sql = "select * from v_phrases "; - $sql .= "where (domain_uuid = :domain_uuid or domain_uuid is null) "; - $parameters['domain_uuid'] = $_SESSION['domain_uuid']; - $database = new database; - $phrases = $database->select($sql, $parameters ?? null, 'all'); - unset($sql, $parameters); - -//get the streams - $sql = "select * from v_streams "; - $sql .= "where (domain_uuid = :domain_uuid or domain_uuid is null) "; - $sql .= "and stream_enabled = 'true' "; - $sql .= "order by stream_name asc "; - $parameters['domain_uuid'] = $_SESSION['domain_uuid']; - $database = new database; - $streams = $database->select($sql, $parameters ?? null, 'all'); - unset($sql, $parameters); +//get the sounds + $sounds = new sounds; + $sounds->sound_types = ['recordings','phrases','sounds']; + $sounds->full_path = ['recordings']; + $audio_files = $sounds->get(); //create token $object = new token; @@ -272,25 +251,25 @@ //show the content if (permission_exists('recording_play') || permission_exists('recording_download')) { echo "\n"; } + if (if_group("superadmin")) { + echo "\n"; + } echo "
\n"; @@ -343,147 +361,66 @@ echo "\n"; echo "\n"; + $instance_id = 'conference_center_greeting'; + $instance_label = 'conference_center_greeting'; + $instance_value = $conference_center_greeting; echo "\n"; echo "\n"; - echo " ".$text['label-conference_center_greeting']."\n"; + echo " ".$text['label-'.$instance_label]."\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; - if (if_group("superadmin")) { - $destination_id = "conference_center_greeting"; - $script = "\n"; - $script .= "\n"; - echo $script; } - echo " \n"; if (if_group("superadmin")) { - echo ""; - unset($destination_id); + echo ""; } - if ((permission_exists('recording_play') || permission_exists('recording_download')) && !empty($playable_greeting)) { - switch (pathinfo($playable_greeting, PATHINFO_EXTENSION)) { - case 'wav' : $audio_file_type = 'audio/wav'; break; - case 'mp3' : $audio_file_type = 'audio/mpeg'; break; - case 'ogg' : $audio_file_type = 'audio/ogg'; break; + if ((permission_exists('recording_play') || permission_exists('recording_download')) && !empty($playable)) { + switch (pathinfo($playable, PATHINFO_EXTENSION)) { + case 'wav' : $mime_type = 'audio/wav'; break; + case 'mp3' : $mime_type = 'audio/mpeg'; break; + case 'ogg' : $mime_type = 'audio/ogg'; break; } } - echo ""; - echo button::create(['type'=>'button','title'=>$text['label-play'].' / '.$text['label-pause'],'icon'=>$_SESSION['theme']['button_icon_play'],'id'=>'recording_button_greeting','style'=>'display: '.(!empty($audio_file_type) ? 'inline' : 'none'),'onclick'=>"recording_play('greeting')"]); - unset($playable_greeting, $audio_file_type); - echo "
\n"; - echo " ".$text['description-conference_center_greeting']."\n"; + echo ""; + echo button::create(['type'=>'button','title'=>$text['label-play'].' / '.$text['label-pause'],'icon'=>$_SESSION['theme']['button_icon_play'],'id'=>'recording_button_'.$instance_id,'style'=>'display: '.(!empty($mime_type) ? 'inline' : 'none'),'onclick'=>"recording_play('".$instance_id."')"]); + unset($playable, $mime_type); + echo "
\n"; + echo $text['description-'.$instance_label]."\n"; echo "\n"; echo "\n"; @@ -544,4 +481,4 @@ //include the footer require_once "resources/footer.php"; -?> +?> \ No newline at end of file diff --git a/app/conference_centers/conference_centers.php b/app/conference_centers/conference_centers.php index fdc7ef7828..971fcd1b4f 100644 --- a/app/conference_centers/conference_centers.php +++ b/app/conference_centers/conference_centers.php @@ -236,7 +236,7 @@ } echo " ".escape($row['conference_center_name'])." \n"; echo " ".escape($row['conference_center_extension'])." \n"; - echo " ".escape($row['conference_center_greeting'])." \n"; + echo " ".escape(str_replace($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/','',$row['conference_center_greeting']))." \n"; echo " ".escape($row['conference_center_pin_length'])." \n"; if (permission_exists('conference_center_edit')) { echo " \n";