Added MOH Category select box to edit Extension page. Renamed Public/General to just "Default".
This commit is contained in:
parent
a1d58cd290
commit
5f742a032e
|
|
@ -1141,9 +1141,36 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||
echo " Hold Music:\n";
|
||||
echo "</td>\n";
|
||||
echo "<td width=\"70%\" class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='hold_music' maxlength='255' value=\"$hold_music\">\n";
|
||||
echo " <select class='formfld' name='hold_music' id='hold_music' style='width: auto;'>\n";
|
||||
echo " <option value='' style='font-style: italic;'>Default</option>\n";
|
||||
$dir_music_on_hold = $_SESSION['switch']['sounds']['dir'].'/music';
|
||||
if (count($_SESSION['domains']) > 1) {
|
||||
$dir_music_on_hold_category_parent_folder = $dir_music_on_hold."/".$_SESSION['domain_name'];
|
||||
}
|
||||
else {
|
||||
$dir_music_on_hold_category_parent_folder = $dir_music_on_hold;
|
||||
}
|
||||
|
||||
if ($handle = opendir($dir_music_on_hold_category_parent_folder)) {
|
||||
while (false !== ($folder = readdir($handle))) {
|
||||
if (
|
||||
$folder != "." &&
|
||||
$folder != ".." &&
|
||||
$folder != "8000" &&
|
||||
$folder != "16000" &&
|
||||
$folder != "32000" &&
|
||||
$folder != "48000" &&
|
||||
is_dir($dir_music_on_hold_category_parent_folder."/".$folder)
|
||||
) {
|
||||
echo "<option value='".$folder."' ".(($hold_music == $folder)?'selected':null).">".(str_replace('_', ' ', $folder))."</option>\n";
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
|
||||
echo " </select>\n";
|
||||
echo " <br />\n";
|
||||
echo "Enter the hold music here.\n";
|
||||
echo " Select the MOH Category here.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ if (($_POST['submit'] == "Upload") && is_uploaded_file($_FILES['ulfile']['tmp_na
|
|||
$target_folder = $dir_music_on_hold."/".$path_mod.$_POST['ulcategory']."/".$samplingrate_folder;
|
||||
}
|
||||
}
|
||||
// use default ('public') folder
|
||||
// use default folder
|
||||
else if ($_POST['ulcategory'] == '') {
|
||||
if (!is_dir($dir_music_on_hold."/".$samplingrate_folder)) {
|
||||
@mkdir($dir_music_on_hold."/".$samplingrate_folder, 0777, true);
|
||||
|
|
@ -231,13 +231,12 @@ if ($_GET['act'] == "del" && permission_exists('music_on_hold_delete')) {
|
|||
echo " </td>\n";
|
||||
echo " <td nowrap>Category<br>\n";
|
||||
echo " <select id='ulcategory' name='ulcategory' class='formfld' style='width: auto;' onchange=\"if (this.options[this.selectedIndex].value == '_NEW_CAT_') { this.style.display='none'; document.getElementById('ulcategorynew').style.display=''; document.getElementById('ulcategory_return').style.display=''; document.getElementById('ulcategorynew').focus(); }\">\n";
|
||||
echo " <option value='' style='font-style: italic;'>Default</option>\n";
|
||||
|
||||
if (count($_SESSION['domains']) > 1) {
|
||||
echo " <option value='' style='font-style: italic;'>Public</option>\n";
|
||||
$dir_music_on_hold_category_parent_folder = $dir_music_on_hold."/".$_SESSION['domain_name'];
|
||||
}
|
||||
else {
|
||||
echo " <option value='' style='font-style: italic;'>General</option>\n";
|
||||
$dir_music_on_hold_category_parent_folder = $dir_music_on_hold;
|
||||
}
|
||||
|
||||
|
|
@ -275,15 +274,12 @@ if ($_GET['act'] == "del" && permission_exists('music_on_hold_delete')) {
|
|||
echo "<br><br>\n";
|
||||
}
|
||||
|
||||
//begin public/general moh section ********************************************************************************************************************************************
|
||||
//begin default moh section ********************************************************************************************************************************************
|
||||
|
||||
echo "<b><i>Default</i></b>\n";
|
||||
if (count($_SESSION['domains']) > 1) {
|
||||
echo "<b><i>Public</i></b> - Available to All Domains\n";
|
||||
echo " - Available to All Domains\n";
|
||||
}
|
||||
else {
|
||||
echo "<b><i>General</i></b> - Uncategorized\n";
|
||||
}
|
||||
|
||||
echo "<br><br>\n";
|
||||
echo "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"margin-bottom: 3px;\">\n";
|
||||
echo " <tr>\n";
|
||||
|
|
|
|||
Loading…
Reference in New Issue