fusionpbx/app/conference_centers/conference_center_edit.php

499 lines
22 KiB
PHP
Raw Normal View History

2012-10-05 01:11:05 +02:00
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2024
2012-10-05 01:11:05 +02:00
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
2022-10-11 00:35:14 +02:00
//includes files
Use magic constant dir (#6711) * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ * use magic constant __DIR__ to load only functions.php * replace spaces with tab character * update dirname command to use levels instead of nesting * use magic constant __DIR__ * update dirname command to use levels instead of nesting * Update access_control_edit.php * Update access_control_import.php * Update access_controls.php * Update dnd.php * Update access_controls_reload.php * Update call_center_agents.php * Update call_center_agents.php * Update fax_queue.php * Update login.php * Update pdo.php * Update pdo_vm.php * Update switch.php * Update index.php * Update css.php * Update v_mailto.php * Update fax_to_email.php --------- Co-authored-by: FusionPBX <markjcrane@gmail.com>
2023-06-15 19:28:23 +02:00
require_once dirname(__DIR__, 2) . "/resources/require.php";
//check permissions
2016-10-04 04:15:28 +02:00
require_once "resources/check_auth.php";
if (permission_exists('conference_center_add') || permission_exists('conference_center_edit')) {
//access granted
}
else {
echo "access denied";
exit;
}
2012-10-05 01:11:05 +02:00
//connect to the database
$database = new database;
//add multi-lingual support
$language = new text;
$text = $language->get();
2012-10-05 01:11:05 +02:00
//action add or update
if (!empty($_REQUEST["id"]) && is_uuid($_REQUEST["id"])) {
2012-10-05 01:11:05 +02:00
$action = "update";
2019-06-08 17:43:57 +02:00
$conference_center_uuid = $_REQUEST["id"];
2012-10-05 01:11:05 +02:00
}
else {
$action = "add";
}
//set the defaults
$conference_center_name = '';
$conference_center_extension = '';
$conference_center_description = '';
$conference_center_greeting = '';
2016-10-04 04:15:28 +02:00
//process the user data and save it to the database
if (!empty($_POST) && empty($_POST["persistformvar"])) {
2012-10-05 01:11:05 +02:00
//delete the conference center
if (!empty($_POST['action']) && $_POST['action'] == 'delete' && permission_exists('conference_center_delete') && is_uuid($conference_center_uuid)) {
//prepare
$array[0]['checked'] = 'true';
$array[0]['uuid'] = $conference_center_uuid;
//delete
$obj = new conference_centers;
$obj->delete_conference_centers($array);
//redirect
header('Location: conference_centers.php');
exit;
}
2019-07-04 23:57:04 +02:00
//get http post variables and set them to php variables
$conference_center_uuid = $_POST["conference_center_uuid"] ?? null;
$dialplan_uuid = $_POST["dialplan_uuid"] ?? null;
2019-07-04 23:57:04 +02:00
$conference_center_name = $_POST["conference_center_name"];
$conference_center_extension = $_POST["conference_center_extension"];
$conference_center_greeting = $_POST["conference_center_greeting"];
$conference_center_pin_length = $_POST["conference_center_pin_length"];
$conference_center_enabled = $_POST["conference_center_enabled"] ?? 'false';
2019-07-04 23:57:04 +02:00
$conference_center_description = $_POST["conference_center_description"];
2012-10-05 01:11:05 +02:00
2019-09-18 06:12:28 +02:00
//validate the token
$token = new token;
if (!$token->validate($_SERVER['PHP_SELF'])) {
message::add($text['message-invalid_token'],'negative');
header('Location: conference_centers.php');
exit;
}
//check for all required data
2016-10-04 04:15:28 +02:00
$msg = '';
//if (empty($dialplan_uuid)) { $msg .= "Please provide: Dialplan UUID<br>\n"; }
if (empty($conference_center_name)) { $msg .= "Please provide: Name<br>\n"; }
if (empty($conference_center_extension)) { $msg .= "Please provide: Extension<br>\n"; }
if (empty($conference_center_pin_length)) { $msg .= "Please provide: PIN Length<br>\n"; }
//if (empty($conference_center_order)) { $msg .= "Please provide: Order<br>\n"; }
//if (empty($conference_center_description)) { $msg .= "Please provide: Description<br>\n"; }
if (empty($conference_center_enabled)) { $msg .= "Please provide: Enabled<br>\n"; }
if (!empty($msg) && empty($_POST["persistformvar"])) {
require_once "resources/header.php";
require_once "resources/persist_form_var.php";
echo "<div align='center'>\n";
echo "<table><tr><td>\n";
echo $msg."<br />";
echo "</td></tr></table>\n";
persistformvar($_POST);
echo "</div>\n";
require_once "resources/footer.php";
return;
}
2016-10-04 04:15:28 +02:00
//add the conference_center_uuid
if (empty($_POST["conference_center_uuid"]) || !is_uuid($_POST["conference_center_uuid"])) {
2016-10-04 04:15:28 +02:00
$conference_center_uuid = uuid();
}
//add the dialplan_uuid
if (empty($_POST["dialplan_uuid"]) || !is_uuid($_POST["dialplan_uuid"])) {
2016-10-04 04:15:28 +02:00
$dialplan_uuid = uuid();
}
2019-09-20 02:15:54 +02:00
//prepare the array
$array['conference_centers'][0]['domain_uuid'] = $_SESSION['domain_uuid'];;
$array['conference_centers'][0]['conference_center_uuid'] = $conference_center_uuid;
$array['conference_centers'][0]['dialplan_uuid'] = $dialplan_uuid;
$array['conference_centers'][0]['conference_center_name'] = $conference_center_name;
$array['conference_centers'][0]['conference_center_extension'] = $conference_center_extension;
$array['conference_centers'][0]['conference_center_greeting'] = $conference_center_greeting;
$array['conference_centers'][0]['conference_center_pin_length'] = $conference_center_pin_length;
$array['conference_centers'][0]['conference_center_enabled'] = $conference_center_enabled;
$array['conference_centers'][0]['conference_center_description'] = $conference_center_description;
2016-10-04 04:15:28 +02:00
//build the xml dialplan
$dialplan_xml = "<extension name=\"".xml::sanitize($conference_center_name)."\" continue=\"\" uuid=\"".xml::sanitize($dialplan_uuid)."\">\n";
2016-10-18 01:51:17 +02:00
if ($conference_center_pin_length > 1 && $conference_center_pin_length < 4) {
$dialplan_xml .= " <condition field=\"destination_number\" expression=\"^(".xml::sanitize($conference_center_extension).")(\d{".xml::sanitize($conference_center_pin_length)."})$\" break=\"on-true\">\n";
2016-10-18 01:51:17 +02:00
$dialplan_xml .= " <action application=\"set\" data=\"destination_number=$1\"/>\n";
$dialplan_xml .= " <action application=\"set\" data=\"pin_number=$2\"/>\n";
$dialplan_xml .= " <action application=\"lua\" data=\"app.lua conference_center\"/>\n";
$dialplan_xml .= " </condition>\n";
}
$dialplan_xml .= " <condition field=\"destination_number\" expression=\"^".xml::sanitize($conference_center_extension)."$\">\n";
2016-10-04 04:15:28 +02:00
$dialplan_xml .= " <action application=\"lua\" data=\"app.lua conference_center\"/>\n";
$dialplan_xml .= " </condition>\n";
$dialplan_xml .= "</extension>\n";
//build the dialplan array
2019-09-20 02:15:54 +02:00
$array['dialplans'][0]["domain_uuid"] = $_SESSION['domain_uuid'];
$array['dialplans'][0]["dialplan_uuid"] = $dialplan_uuid;
$array['dialplans'][0]["dialplan_name"] = $conference_center_name;
$array['dialplans'][0]["dialplan_number"] = $conference_center_extension;
$array['dialplans'][0]["dialplan_context"] = $_SESSION['domain_name'];
2019-09-20 02:15:54 +02:00
$array['dialplans'][0]["dialplan_continue"] = "false";
$array['dialplans'][0]["dialplan_xml"] = $dialplan_xml;
$array['dialplans'][0]["dialplan_order"] = "333";
$array['dialplans'][0]["dialplan_enabled"] = $conference_center_enabled;
$array['dialplans'][0]["dialplan_description"] = $conference_center_description;
$array['dialplans'][0]["app_uuid"] = "b81412e8-7253-91f4-e48e-42fc2c9a38d9";
2016-10-04 04:15:28 +02:00
2016-10-06 02:44:38 +02:00
//add the dialplan permission
2024-11-29 21:57:01 +01:00
$p = permissions::new();
2016-10-06 02:44:38 +02:00
$p->add("dialplan_add", "temp");
$p->add("dialplan_edit", "temp");
2016-10-04 04:15:28 +02:00
//save to the data
2016-10-18 17:36:18 +02:00
$database->app_name = "conference_centers";
$database->app_uuid = "b81412e8-7253-91f4-e48e-42fc2c9a38d9";
$database->save($array);
$message = $database->message;
2019-07-04 23:57:04 +02:00
unset($array);
2016-10-06 02:44:38 +02:00
//remove the temporary permission
$p->delete("dialplan_add", "temp");
$p->delete("dialplan_edit", "temp");
2016-10-04 04:15:28 +02:00
//debug information
//echo "<pre>\n";
//print_r($message);
//echo "</pre>\n";
//exit;
//apply settings reminder
$_SESSION["reload_xml"] = true;
//clear the cache
$cache = new cache;
$cache->delete("dialplan:".$_SESSION["domain_name"]);
2016-10-04 04:15:28 +02:00
//clear the destinations session array
if (isset($_SESSION['destinations']['array'])) {
unset($_SESSION['destinations']['array']);
}
2016-10-04 04:15:28 +02:00
//redirect the user
if (isset($action)) {
if ($action == "add") {
2018-08-31 05:09:01 +02:00
message::add($text['message-add']);
2016-10-04 04:15:28 +02:00
}
if ($action == "update") {
2018-08-31 05:09:01 +02:00
message::add($text['message-update']);
2016-10-04 04:15:28 +02:00
}
header("Location: conference_centers.php");
return;
}
} //(is_array($_POST) && empty($_POST["persistformvar"]))
2012-10-05 01:11:05 +02:00
//pre-populate the form
if (!empty($_GET) && empty($_POST["persistformvar"])) {
2019-06-08 17:43:57 +02:00
$conference_center_uuid = $_GET["id"];
2012-10-05 01:11:05 +02:00
$sql = "select * from v_conference_centers ";
2019-06-08 17:43:57 +02:00
$sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and conference_center_uuid = :conference_center_uuid ";
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
$parameters['conference_center_uuid'] = $conference_center_uuid;
$row = $database->select($sql, $parameters ?? null, 'row');
if (!empty($row)) {
2016-10-04 04:15:28 +02:00
$conference_center_uuid = $row["conference_center_uuid"];
2012-10-05 01:11:05 +02:00
$dialplan_uuid = $row["dialplan_uuid"];
$conference_center_name = $row["conference_center_name"];
$conference_center_extension = $row["conference_center_extension"];
2016-10-04 04:15:28 +02:00
$conference_center_greeting = $row["conference_center_greeting"];
$conference_center_pin_length = $row["conference_center_pin_length"];
2012-10-05 01:11:05 +02:00
$conference_center_enabled = $row["conference_center_enabled"];
2016-10-04 04:15:28 +02:00
$conference_center_description = $row["conference_center_description"];
2012-10-05 01:11:05 +02:00
}
2019-07-04 23:57:04 +02:00
unset($sql, $parameters, $row);
2012-10-05 01:11:05 +02:00
}
//set defaults
if (empty($conference_center_enabled)) { $conference_center_enabled = "true"; }
if (empty($conference_center_pin_length)) { $conference_center_pin_length = 9; }
2012-10-05 01:11:05 +02:00
//get the sounds
$sounds = new sounds;
$sounds->sound_types = ['recordings','phrases','sounds'];
$sounds->full_path = ['recordings'];
$audio_files = $sounds->get();
2018-03-02 05:40:34 +01:00
2019-09-18 06:12:28 +02:00
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);
2012-10-05 01:11:05 +02:00
//show the header
2020-01-06 19:14:01 +01:00
$document['title'] = $text['title-conference_center'];
require_once "resources/header.php";
2012-10-05 01:11:05 +02:00
//show the content
if (permission_exists('recording_play') || permission_exists('recording_download')) {
echo "<script type='text/javascript' language='JavaScript'>\n";
echo " function set_playable(id, audio_selected, audio_type) {\n";
echo " file_ext = audio_selected.split('.').pop();\n";
echo " var mime_type = '';\n";
echo " switch (file_ext) {\n";
echo " case 'wav': mime_type = 'audio/wav'; break;\n";
echo " case 'mp3': mime_type = 'audio/mpeg'; break;\n";
echo " case 'ogg': mime_type = 'audio/ogg'; break;\n";
echo " }\n";
echo " if (mime_type != '' && (audio_type == 'recordings' || audio_type == 'sounds')) {\n";
echo " if (audio_type == 'recordings') {\n";
echo " if (audio_selected.includes('/')) {\n";
echo " audio_selected = audio_selected.split('/').pop()\n";
echo " }\n";
echo " $('#recording_audio_' + id).attr('src', '../recordings/recordings.php?action=download&type=rec&filename=' + audio_selected);\n";
echo " }\n";
echo " else if (audio_type == 'sounds') {\n";
echo " $('#recording_audio_' + id).attr('src', '../switch/sounds.php?action=download&filename=' + audio_selected);\n";
echo " }\n";
echo " $('#recording_audio_' + id).attr('type', mime_type);\n";
echo " $('#recording_button_' + id).show();\n";
echo " }\n";
echo " else {\n";
echo " $('#recording_button_' + id).hide();\n";
echo " $('#recording_audio_' + id).attr('src','').attr('type','');\n";
echo " }\n";
echo " }\n";
echo "</script>\n";
}
if (if_group("superadmin")) {
echo "<script type='text/javascript' language='JavaScript'>\n";
echo " var objs;\n";
echo " function toggle_select_input(obj, instance_id){\n";
echo " tb=document.createElement('INPUT');\n";
echo " tb.type='text';\n";
echo " tb.name=obj.name;\n";
echo " tb.className='formfld';\n";
echo " tb.setAttribute('id', instance_id);\n";
echo " tb.setAttribute('style', 'width: ' + obj.offsetWidth + 'px;');\n";
if (!empty($on_change)) {
echo " tb.setAttribute('onchange', \"".$on_change."\");\n";
echo " tb.setAttribute('onkeyup', \"".$on_change."\");\n";
}
echo " tb.value=obj.options[obj.selectedIndex].value;\n";
echo " document.getElementById('btn_select_to_input_' + instance_id).style.display = 'none';\n";
echo " tbb=document.createElement('INPUT');\n";
echo " tbb.setAttribute('class', 'btn');\n";
echo " tbb.setAttribute('style', 'margin-left: 4px;');\n";
echo " tbb.type='button';\n";
echo " tbb.value=$('<div />').html('&#9665;').text();\n";
echo " tbb.objs=[obj,tb,tbb];\n";
echo " tbb.onclick=function(){ replace_element(this.objs, instance_id); }\n";
echo " obj.parentNode.insertBefore(tb,obj);\n";
echo " obj.parentNode.insertBefore(tbb,obj);\n";
echo " obj.parentNode.removeChild(obj);\n";
echo " replace_element(this.objs, instance_id);\n";
echo " }\n";
echo " function replace_element(obj, instance_id){\n";
echo " obj[2].parentNode.insertBefore(obj[0],obj[2]);\n";
echo " obj[0].parentNode.removeChild(obj[1]);\n";
echo " obj[0].parentNode.removeChild(obj[2]);\n";
echo " document.getElementById('btn_select_to_input_' + instance_id).style.display = 'inline';\n";
if (!empty($on_change)) {
echo " ".$on_change.";\n";
}
echo " }\n";
echo "</script>\n";
}
echo "<form name='frm' id='frm' method='post'>\n";
echo "<div class='action_bar' id='action_bar'>\n";
echo " <div class='heading'><b>".$text['title-conference_center']."</b></div>\n";
echo " <div class='actions'>\n";
echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'id'=>'btn_back','style'=>'margin-right: 15px;','link'=>'conference_centers.php']);
if ($action == 'update' && permission_exists('conference_center_delete')) {
2020-03-26 03:44:53 +01:00
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'name'=>'btn_delete','style'=>'margin-right: 15px;','onclick'=>"modal_open('modal-delete','btn_delete');"]);
2019-11-02 20:51:32 +01:00
}
echo button::create(['type'=>'submit','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'id'=>'btn_save']);
echo " </div>\n";
echo " <div style='clear: both;'></div>\n";
echo "</div>\n";
2020-03-26 03:44:53 +01:00
if ($action == 'update' && permission_exists('conference_center_delete')) {
echo modal::create(['id'=>'modal-delete','type'=>'delete','actions'=>button::create(['type'=>'submit','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_delete','style'=>'float: right; margin-left: 15px;','collapse'=>'never','name'=>'action','value'=>'delete','onclick'=>"modal_close();"])]);
}
echo "<div class='card'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
2012-10-05 01:11:05 +02:00
echo "<tr>\n";
echo "<td width='30%' class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
2016-10-04 04:15:28 +02:00
echo " ".$text['label-conference_center_name']."\n";
2012-10-05 01:11:05 +02:00
echo "</td>\n";
echo "<td width='70%' class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='conference_center_name' maxlength='255' value=\"".escape($conference_center_name)."\">\n";
2016-10-04 04:15:28 +02:00
echo "<br />\n";
echo $text['description-conference_center_name']."\n";
2012-10-05 01:11:05 +02:00
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
2016-10-04 04:15:28 +02:00
echo " ".$text['label-conference_center_extension']."\n";
2012-10-05 01:11:05 +02:00
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
2024-05-31 02:45:45 +02:00
echo " <input class='formfld' type='text' name='conference_center_extension' maxlength='255' value=\"".escape($conference_center_extension)."\" required='required' placeholder=\"".($_SESSION['conference_center']['extension_range']['text'] ?? '')."\">\n";
2016-10-04 04:15:28 +02:00
echo "<br />\n";
echo $text['description-conference_center_extension']."\n";
2012-10-05 01:11:05 +02:00
echo "</td>\n";
echo "</tr>\n";
$instance_id = 'conference_center_greeting';
$instance_label = 'conference_center_greeting';
$instance_value = $conference_center_greeting;
echo "<tr>\n";
echo "<td class='vncell' rowspan='2' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-'.$instance_label]."\n";
echo "</td>\n";
echo "<td class='vtable playback_progress_bar_background' id='recording_progress_bar_".$instance_id."' onclick=\"recording_play('".$instance_id."', document.getElementById('".$instance_id."').value, document.getElementById('".$instance_id."').options[document.getElementById('".$instance_id."').selectedIndex].parentNode.getAttribute('data-type'));\" style='display: none; border-bottom: none; padding-top: 0 !important; padding-bottom: 0 !important;' align='left'><span class='playback_progress_bar' id='recording_progress_".$instance_id."'></span></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vtable' align='left'>\n";
echo "<select name='".$instance_id."' id='".$instance_id."' class='formfld' ".(permission_exists('recording_play') || permission_exists('recording_download') ? "onchange=\"recording_reset('".$instance_id."'); set_playable('".$instance_id."', this.value, this.options[this.selectedIndex].parentNode.getAttribute('data-type'));\"" : null).">\n";
echo " <option value=''></option>\n";
$found = $playable = false;
if (!empty($audio_files) && is_array($audio_files) && @sizeof($audio_files) != 0) {
foreach ($audio_files as $key => $value) {
echo "<optgroup label=".$text['label-'.$key]." data-type='".$key."'>\n";
foreach ($value as $row) {
if ($key == 'recordings') {
if (
!empty($instance_value) &&
($instance_value == $row["value"] || $instance_value == $_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name'].'/'.$row["value"]) &&
file_exists($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name'].'/'.pathinfo($row["value"], PATHINFO_BASENAME))
) {
$selected = "selected='selected'";
$playable = '../recordings/recordings.php?action=download&type=rec&filename='.pathinfo($row["value"], PATHINFO_BASENAME);
$found = true;
}
else {
unset($selected);
}
}
else if ($key == 'sounds') {
if (!empty($instance_value) && $instance_value == $row["value"]) {
$selected = "selected='selected'";
$playable = '../switch/sounds.php?action=download&filename='.$row["value"];
$found = true;
}
else {
unset($selected);
}
}
else {
unset($selected);
}
echo " <option value='".escape($row["value"])."' ".($selected ?? '').">".escape($row["name"])."</option>\n";
}
echo "</optgroup>\n";
}
}
if (if_group("superadmin") && !empty($instance_value) && !$found) {
echo " <option value='".escape($instance_value)."' selected='selected'>".escape($instance_value)."</option>\n";
}
unset($selected);
echo " </select>\n";
if (if_group("superadmin")) {
echo "<input type='button' id='btn_select_to_input_".$instance_id."' class='btn' name='' alt='back' onclick='toggle_select_input(document.getElementById(\"".$instance_id."\"), \"".$instance_id."\"); this.style.visibility=\"hidden\";' value='&#9665;'>";
}
if ((permission_exists('recording_play') || permission_exists('recording_download')) && (!empty($playable) || empty($instance_value))) {
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 "<audio id='recording_audio_".$instance_id."' style='display: none;' preload='none' ontimeupdate=\"update_progress('".$instance_id."')\" onended=\"recording_reset('".$instance_id."');\" src='".($playable ?? '')."' type='".($mime_type ?? '')."'></audio>";
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."', document.getElementById('".$instance_id."').value, document.getElementById('".$instance_id."').options[document.getElementById('".$instance_id."').selectedIndex].parentNode.getAttribute('data-type'))"]);
unset($playable, $mime_type);
}
echo "<br />\n";
echo $text['description-'.$instance_label]."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
2016-10-04 04:15:28 +02:00
echo " ".$text['label-conference_center_pin_length']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='conference_center_pin_length' maxlength='255' value='".escape($conference_center_pin_length)."'>\n";
2016-10-04 04:15:28 +02:00
echo "<br />\n";
echo $text['description-conference_center_pin_length']."\n";
echo "</td>\n";
echo "</tr>\n";
2012-10-05 01:11:05 +02:00
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
2016-10-04 04:15:28 +02:00
echo " ".$text['label-conference_center_enabled']."\n";
2012-10-05 01:11:05 +02:00
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') {
echo " <label class='switch'>\n";
echo " <input type='checkbox' id='conference_center_enabled' name='conference_center_enabled' value='true' ".($conference_center_enabled == 'true' ? "checked='checked'" : null).">\n";
echo " <span class='slider'></span>\n";
echo " </label>\n";
}
else {
echo " <select class='formfld' id='conference_center_enabled' name='conference_center_enabled'>\n";
echo " <option value='true' ".($conference_center_enabled == 'true' ? "selected='selected'" : null).">".$text['option-true']."</option>\n";
echo " <option value='false' ".($conference_center_enabled == 'false' ? "selected='selected'" : null).">".$text['option-false']."</option>\n";
echo " </select>\n";
}
2016-10-04 04:15:28 +02:00
echo "<br />\n";
echo $text['description-conference_center_enabled']."\n";
2012-10-05 01:11:05 +02:00
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
2016-10-04 04:15:28 +02:00
echo " ".$text['label-conference_center_description']."\n";
2012-10-05 01:11:05 +02:00
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='conference_center_description' maxlength='255' value=\"".escape($conference_center_description)."\">\n";
2016-10-04 04:15:28 +02:00
echo "<br />\n";
//echo $text['description-conference_center_description']."\n";
2012-10-05 01:11:05 +02:00
echo "</td>\n";
echo "</table>";
echo "</div>\n";
echo "<br /><br />";
2012-10-05 01:11:05 +02:00
if ($action == "update") {
echo "<input type='hidden' name='dialplan_uuid' value='".escape($dialplan_uuid)."'>\n";
echo "<input type='hidden' name='conference_center_uuid' value='".escape($conference_center_uuid)."'>\n";
2012-10-05 01:11:05 +02:00
}
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
2012-10-05 01:11:05 +02:00
echo "</form>";
//include the footer
require_once "resources/footer.php";
2016-10-04 04:15:28 +02:00
2024-05-31 01:58:05 +02:00
?>