mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-03-06 08:38:42 +00:00
Mutlilinguified Default Settings and Domain Settings.
This commit is contained in:
116
core/default_settings/app_languages.php
Normal file
116
core/default_settings/app_languages.php
Normal file
@@ -0,0 +1,116 @@
|
||||
<?php
|
||||
|
||||
//Default Settings
|
||||
|
||||
$text['title-default_settings']['en-us'] = 'Default Settings';
|
||||
$text['title-default_settings']['pt-pt'] = '';
|
||||
|
||||
$text['header-default_settings']['en-us'] = 'Default Settings';
|
||||
$text['header-default_settings']['pt-pt'] = '';
|
||||
|
||||
$text['description-default_settings']['en-us'] = 'Settings used for all domains.';
|
||||
$text['description-default_settings']['pt-pt'] = '';
|
||||
|
||||
//------
|
||||
|
||||
$text['title-default_setting-edit']['en-us'] = 'Default Setting Edit';
|
||||
$text['title-default_setting-edit']['pt-pt'] = '';
|
||||
|
||||
$text['header-default_setting-edit']['en-us'] = 'Default Setting Edit';
|
||||
$text['header-default_setting-edit']['pt-pt'] = '';
|
||||
|
||||
$text['description-default_setting-edit']['en-us'] = 'Settings used for all domains.';
|
||||
$text['description-default_setting-edit']['pt-pt'] = '';
|
||||
|
||||
//------
|
||||
|
||||
$text['title-default_setting-add']['en-us'] = 'Default Setting Add';
|
||||
$text['title-default_setting-add']['pt-pt'] = '';
|
||||
|
||||
$text['header-default_setting-add']['en-us'] = 'Default Setting Add';
|
||||
$text['header-default_setting-add']['pt-pt'] = '';
|
||||
|
||||
$text['description-default_setting-add']['en-us'] = 'Settings used for all domains.';
|
||||
$text['description-default_setting-add']['pt-pt'] = '';
|
||||
|
||||
//------
|
||||
|
||||
$text['label-category']['en-us'] = 'Category';
|
||||
$text['label-category']['pt-pt'] = '';
|
||||
|
||||
$text['description-category']['en-us'] = 'Enter the category.';
|
||||
$text['description-category']['pt-pt'] = '';
|
||||
|
||||
$text['label-subcategory']['en-us'] = 'Subcategory';
|
||||
$text['label-subcategory']['pt-pt'] = '';
|
||||
|
||||
$text['description-subcategory']['en-us'] = 'Enter the subcategory.';
|
||||
$text['description-subcategory']['pt-pt'] = '';
|
||||
|
||||
$text['label-type']['en-us'] = 'Type';
|
||||
$text['label-type']['pt-pt'] = '';
|
||||
|
||||
$text['description-type']['en-us'] = 'Enter the setting type (ie. uuid, name, var, dir, etc).';
|
||||
$text['description-type']['pt-pt'] = '';
|
||||
|
||||
$text['label-value']['en-us'] = 'Value';
|
||||
$text['label-value']['pt-pt'] = '';
|
||||
|
||||
$text['description-value']['en-us'] = 'Enter the value of this setting.';
|
||||
$text['description-value']['pt-pt'] = '';
|
||||
|
||||
$text['label-enabled']['en-us'] = 'Enabled';
|
||||
$text['label-enabled']['pt-pt'] = '';
|
||||
|
||||
$text['description-enabled']['en-us'] = 'Set the status of this default setting.';
|
||||
$text['description-enabled']['pt-pt'] = '';
|
||||
|
||||
$text['label-description']['en-us'] = 'Description';
|
||||
$text['label-description']['pt-pt'] = '';
|
||||
|
||||
$text['description-description']['en-us'] = 'Enter a description, if desired.';
|
||||
$text['description-description']['pt-pt'] = '';
|
||||
|
||||
$text['label-true']['en-us'] = 'True';
|
||||
$text['label-true']['pt-pt'] = '';
|
||||
|
||||
$text['label-false']['en-us'] = 'False';
|
||||
$text['label-false']['pt-pt'] = 'falso';
|
||||
|
||||
$text['label-none']['en-us'] = 'None';
|
||||
$text['label-none']['pt-pt'] = '';
|
||||
|
||||
$text['button-add']['en-us'] = 'Add';
|
||||
$text['button-add']['pt-pt'] = '';
|
||||
|
||||
$text['button-edit']['en-us'] = 'Edit';
|
||||
$text['button-edit']['pt-pt'] = '';
|
||||
|
||||
$text['button-delete']['en-us'] = 'Delete';
|
||||
$text['button-delete']['pt-pt'] = '';
|
||||
|
||||
$text['confirm-delete']['en-us'] = 'Do you really want to delete this?';
|
||||
$text['confirm-delete']['pt-pt'] = '';
|
||||
|
||||
$text['button-save']['en-us'] = 'Save';
|
||||
$text['button-save']['pt-pt'] = 'Guardar';
|
||||
|
||||
$text['button-back']['en-us'] = 'Back';
|
||||
$text['button-back']['pt-pt'] = 'Voltar';
|
||||
|
||||
$text['message-message']['en-us'] = 'Message';
|
||||
$text['message-message']['pt-pt'] = '';
|
||||
|
||||
$text['message-add']['en-us'] = 'Add Completed';
|
||||
$text['message-add']['pt-pt'] = '';
|
||||
|
||||
$text['message-update']['en-us'] = 'Update Completed';
|
||||
$text['message-update']['pt-pt'] = '';
|
||||
|
||||
$text['message-delete']['en-us'] = 'Delete Completed';
|
||||
$text['message-delete']['pt-pt'] = '';
|
||||
|
||||
$text['message-required']['en-us'] = 'Please provide: ';
|
||||
$text['message-required']['pt-pt'] = '';
|
||||
|
||||
?>
|
||||
@@ -34,6 +34,12 @@ else {
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
require_once "app_languages.php";
|
||||
foreach($text as $key => $value) {
|
||||
$text[$key] = $value[$_SESSION['domain']['language']['code']];
|
||||
}
|
||||
|
||||
if (count($_GET)>0) {
|
||||
$id = check_str($_GET["id"]);
|
||||
}
|
||||
@@ -51,7 +57,7 @@ if (strlen($id)>0) {
|
||||
require_once "includes/header.php";
|
||||
echo "<meta http-equiv=\"refresh\" content=\"2;url=default_settings.php\">\n";
|
||||
echo "<div align='center'>\n";
|
||||
echo "Delete Complete\n";
|
||||
echo $text['message-delete']."\n";
|
||||
echo "</div>\n";
|
||||
require_once "includes/footer.php";
|
||||
return;
|
||||
|
||||
@@ -34,6 +34,12 @@ else {
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
require_once "app_languages.php";
|
||||
foreach($text as $key => $value) {
|
||||
$text[$key] = $value[$_SESSION['domain']['language']['code']];
|
||||
}
|
||||
|
||||
//action add or update
|
||||
if (isset($_REQUEST["id"])) {
|
||||
$action = "update";
|
||||
@@ -61,12 +67,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
}
|
||||
|
||||
//check for all required data
|
||||
//if (strlen($default_setting_category) == 0) { $msg .= "Please provide: Category<br>\n"; }
|
||||
//if (strlen($default_setting_subcategory) == 0) { $msg .= "Please provide: Subcategory<br>\n"; }
|
||||
//if (strlen($default_setting_name) == 0) { $msg .= "Please provide: Type<br>\n"; }
|
||||
//if (strlen($default_setting_value) == 0) { $msg .= "Please provide: Value<br>\n"; }
|
||||
//if (strlen($default_setting_enabled) == 0) { $msg .= "Please provide: Enabled<br>\n"; }
|
||||
//if (strlen($default_setting_description) == 0) { $msg .= "Please provide: Description<br>\n"; }
|
||||
//if (strlen($default_setting_category) == 0) { $msg .= $text['message-required'].$text['label-category']."<br>\n"; }
|
||||
//if (strlen($default_setting_subcategory) == 0) { $msg .= $text['message-required'].$text['label-subcategory']."<br>\n"; }
|
||||
//if (strlen($default_setting_name) == 0) { $msg .= $text['message-required'].$text['label-type']."<br>\n"; }
|
||||
//if (strlen($default_setting_value) == 0) { $msg .= $text['message-required'].$text['label-value']."<br>\n"; }
|
||||
//if (strlen($default_setting_enabled) == 0) { $msg .= $text['message-required'].$text['label-enabled']."<br>\n"; }
|
||||
//if (strlen($default_setting_description) == 0) { $msg .= $text['message-required'].$text['label-description']."<br>\n"; }
|
||||
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
require_once "includes/header.php";
|
||||
require_once "includes/persistformvar.php";
|
||||
@@ -109,7 +115,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
require_once "includes/header.php";
|
||||
echo "<meta http-equiv=\"refresh\" content=\"2;url=default_settings.php\">\n";
|
||||
echo "<div align='center'>\n";
|
||||
echo "Add Complete\n";
|
||||
echo $text['message-add']."\n";
|
||||
echo "</div>\n";
|
||||
require_once "includes/footer.php";
|
||||
return;
|
||||
@@ -130,12 +136,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
require_once "includes/header.php";
|
||||
echo "<meta http-equiv=\"refresh\" content=\"2;url=default_settings.php\">\n";
|
||||
echo "<div align='center'>\n";
|
||||
echo "Update Complete\n";
|
||||
echo $text['message-update']."\n";
|
||||
echo "</div>\n";
|
||||
require_once "includes/footer.php";
|
||||
return;
|
||||
} //if ($action == "update")
|
||||
} //if ($_POST["persistformvar"] != "true")
|
||||
} //if ($_POST["persistformvar"] != "true")
|
||||
} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
|
||||
|
||||
//pre-populate the form
|
||||
@@ -160,6 +166,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
//show the header
|
||||
require_once "includes/header.php";
|
||||
if ($action == "update") {
|
||||
$page["title"] = $text['title-default_setting-edit'];
|
||||
}
|
||||
else if ($action == "add") {
|
||||
$page["title"] = $text['title-default_setting-add'];
|
||||
}
|
||||
|
||||
//show the content
|
||||
echo "<div align='center'>";
|
||||
@@ -173,55 +185,60 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
|
||||
echo "<tr>\n";
|
||||
if ($action == "add") {
|
||||
echo "<td align='left' width='30%' nowrap='nowrap'><b>Default Setting Add</b></td>\n";
|
||||
echo "<td align='left' width='30%' nowrap='nowrap'><b>".$text['header-default_setting-add']."</b></td>\n";
|
||||
}
|
||||
if ($action == "update") {
|
||||
echo "<td align='left' width='30%' nowrap='nowrap'><b>Default Setting Edit</b></td>\n";
|
||||
echo "<td align='left' width='30%' nowrap='nowrap'><b>".$text['header-default_setting-edit']."</b></td>\n";
|
||||
}
|
||||
echo "<td width='70%' align='right'><input type='button' class='btn' name='' alt='back' onclick=\"window.location='default_settings.php'\" value='Back'></td>\n";
|
||||
echo "<td width='70%' align='right'><input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='default_settings.php'\" value='".$text['button-back']."'></td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<td align='left' colspan='2'>\n";
|
||||
echo "Settings used for all domains.<br /><br />\n";
|
||||
if ($action == "add") {
|
||||
echo $text['description-default_setting-add']."<br /><br />\n";
|
||||
}
|
||||
if ($action == "update") {
|
||||
echo $text['description-default_setting-edit']."<br /><br />\n";
|
||||
}
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " Category:\n";
|
||||
echo " ".$text['label-category'].":\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='default_setting_category' maxlength='255' value=\"$default_setting_category\">\n";
|
||||
echo "<br />\n";
|
||||
echo "Enter the category.\n";
|
||||
echo $text['description-category']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " Subcategory:\n";
|
||||
echo " ".$text['label-subcategory'].":\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='default_setting_subcategory' maxlength='255' value=\"$default_setting_subcategory\">\n";
|
||||
echo "<br />\n";
|
||||
echo "Enter the subcategory.\n";
|
||||
echo $text['description-subcategory']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " Name:\n";
|
||||
echo " ".$text['label-type'].":\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='default_setting_name' maxlength='255' value=\"$default_setting_name\">\n";
|
||||
echo "<br />\n";
|
||||
echo "Enter the name.\n";
|
||||
echo $text['description-type']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " Value:\n";
|
||||
echo " ".$text['label-value'].":\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
$category = $row['default_setting_category'];
|
||||
@@ -270,39 +287,39 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
} elseif ($category == "email" && $subcategory == "smtp_auth" && $name == "var" ) {
|
||||
echo " <select class='formfld' name='default_setting_value'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
if ($row['default_setting_value'] == "true") {
|
||||
echo " <option value='true' selected='selected'>true</option>\n";
|
||||
if ($row['default_setting_value'] == "true") {
|
||||
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='true'>true</option>\n";
|
||||
echo " <option value='true'>".$text['label-true']."</option>\n";
|
||||
}
|
||||
if ($row['default_setting_value'] == "false") {
|
||||
echo " <option value='false' selected='selected'>false</option>\n";
|
||||
if ($row['default_setting_value'] == "false") {
|
||||
echo " <option value='false' selected='selected'>".$text['label-false']."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='false'>false</option>\n";
|
||||
echo " <option value='false'>".$text['label-false']."</option>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
} elseif ($category == "email" && $subcategory == "smtp_secure" && $name == "var" ) {
|
||||
echo " <select class='formfld' name='default_setting_value'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
if ($row['default_setting_value'] == "none") {
|
||||
echo " <option value='none' selected='selected'>none</option>\n";
|
||||
if ($row['default_setting_value'] == "none") {
|
||||
echo " <option value='none' selected='selected'>".$text['label-none']."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='none'>none</option>\n";
|
||||
echo " <option value='none'>".$text['label-none']."</option>\n";
|
||||
}
|
||||
if ($row['default_setting_value'] == "tls") {
|
||||
echo " <option value='tls' selected='selected'>tls</option>\n";
|
||||
if ($row['default_setting_value'] == "tls") {
|
||||
echo " <option value='tls' selected='selected'>TLS</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='tls'>tls</option>\n";
|
||||
echo " <option value='tls'>TLS</option>\n";
|
||||
}
|
||||
if ($row['default_setting_value'] == "ssl") {
|
||||
echo " <option value='ssl' selected='selected'>ssl</option>\n";
|
||||
if ($row['default_setting_value'] == "ssl") {
|
||||
echo " <option value='ssl' selected='selected'>SSL</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='ssl'>ssl</option>\n";
|
||||
echo " <option value='ssl'>SSL</option>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
} elseif ($category == "domain" && $subcategory == "time_zone" && $name == "name" ) {
|
||||
@@ -355,43 +372,43 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
echo " <input class='formfld' type='text' name='default_setting_value' maxlength='255' value=\"".$row['default_setting_value']."\">\n";
|
||||
}
|
||||
echo "<br />\n";
|
||||
echo "Enter the value.\n";
|
||||
echo $text['description-value']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " Enabled:\n";
|
||||
echo " ".$text['label-enabled'].":\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <select class='formfld' name='default_setting_enabled'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
if ($default_setting_enabled == "true") {
|
||||
echo " <option value='true' selected='selected'>true</option>\n";
|
||||
if ($default_setting_enabled == "true") {
|
||||
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='true'>true</option>\n";
|
||||
echo " <option value='true'>".$text['label-true']."</option>\n";
|
||||
}
|
||||
if ($default_setting_enabled == "false") {
|
||||
echo " <option value='false' selected='selected'>false</option>\n";
|
||||
if ($default_setting_enabled == "false") {
|
||||
echo " <option value='false' selected='selected'>".$text['label-false']."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='false'>false</option>\n";
|
||||
echo " <option value='false'>".$text['label-false']."</option>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
echo "<br />\n";
|
||||
echo "Choose to enable or disable the value.\n";
|
||||
echo $text['description-enabled']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " Description:\n";
|
||||
echo " ".$text['label-description'].":\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='default_setting_description' maxlength='255' value=\"$default_setting_description\">\n";
|
||||
echo "<br />\n";
|
||||
echo "Enter the description.\n";
|
||||
echo $text['description-description']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
@@ -400,7 +417,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
if ($action == "update") {
|
||||
echo " <input type='hidden' name='default_setting_uuid' value='$default_setting_uuid'>\n";
|
||||
}
|
||||
echo " <input type='submit' name='submit' class='btn' value='Save'>\n";
|
||||
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>";
|
||||
echo "</table>";
|
||||
|
||||
@@ -33,7 +33,16 @@ else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
require_once "app_languages.php";
|
||||
foreach($text as $key => $value) {
|
||||
$text[$key] = $value[$_SESSION['domain']['language']['code']];
|
||||
}
|
||||
|
||||
require_once "includes/header.php";
|
||||
$page["title"] = $text['title-default_settings'];
|
||||
|
||||
require_once "includes/paging.php";
|
||||
|
||||
//get variables used to control the order
|
||||
@@ -49,12 +58,12 @@ require_once "includes/paging.php";
|
||||
|
||||
echo "<table width='100%' border='0'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td width='50%' align='left' nowrap='nowrap'><b>Default Settings</b></td>\n";
|
||||
echo " <td width='50%' align='left' nowrap='nowrap'><b>".$text['header-default_settings']."</b></td>\n";
|
||||
echo " <td width='50%' align='right'> </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td align='left' colspan='2'>\n";
|
||||
echo " Settings used for all domains.<br /><br />\n";
|
||||
echo " ".$text['description-default_settings']."<br /><br />\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo "</table>\n";
|
||||
@@ -78,9 +87,9 @@ require_once "includes/paging.php";
|
||||
$rows_per_page = 100;
|
||||
$param = "";
|
||||
$page = $_GET['page'];
|
||||
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
|
||||
list($paging_controls, $rows_per_page, $var3) = paging($num_rows, $param, $rows_per_page);
|
||||
$offset = $rows_per_page * $page;
|
||||
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
|
||||
list($paging_controls, $rows_per_page, $var3) = paging($num_rows, $param, $rows_per_page);
|
||||
$offset = $rows_per_page * $page;
|
||||
|
||||
//get the list
|
||||
$sql = "select * from v_default_settings ";
|
||||
@@ -112,14 +121,14 @@ require_once "includes/paging.php";
|
||||
echo " <br />\n";
|
||||
echo " <b>".ucfirst($row['default_setting_category'])."</b> </td></tr>\n";
|
||||
echo "<tr>\n";
|
||||
echo th_order_by('default_setting_subcategory', 'Category', $order_by, $order);
|
||||
echo th_order_by('default_setting_name', 'Type', $order_by, $order);
|
||||
echo th_order_by('default_setting_value', 'Value', $order_by, $order);
|
||||
echo th_order_by('default_setting_enabled', 'Enabled', $order_by, $order);
|
||||
echo th_order_by('default_setting_description', 'Description', $order_by, $order);
|
||||
echo th_order_by('default_setting_subcategory', $text['label-subcategory'], $order_by, $order);
|
||||
echo th_order_by('default_setting_name', $text['label-type'], $order_by, $order);
|
||||
echo th_order_by('default_setting_value', $text['label-value'], $order_by, $order);
|
||||
echo th_order_by('default_setting_enabled', $text['label-enabled'], $order_by, $order);
|
||||
echo th_order_by('default_setting_description', $text['label-description'], $order_by, $order);
|
||||
echo "<td align='right' width='42'>\n";
|
||||
if (permission_exists('default_setting_add')) {
|
||||
echo " <a href='default_setting_edit.php' alt='add'>$v_link_label_add</a>\n";
|
||||
echo " <a href='default_setting_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
|
||||
}
|
||||
else {
|
||||
echo " \n";
|
||||
@@ -159,10 +168,10 @@ require_once "includes/paging.php";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row['default_setting_description']." </td>\n";
|
||||
echo " <td valign='top' align='right'>\n";
|
||||
if (permission_exists('default_setting_edit')) {
|
||||
echo " <a href='default_setting_edit.php?id=".$row['default_setting_uuid']."' alt='edit'>$v_link_label_edit</a>\n";
|
||||
echo " <a href='default_setting_edit.php?id=".$row['default_setting_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>\n";
|
||||
}
|
||||
if (permission_exists('default_setting_delete')) {
|
||||
echo " <a href='default_setting_delete.php?id=".$row['default_setting_uuid']."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
|
||||
echo " <a href='default_setting_delete.php?id=".$row['default_setting_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>\n";
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
@@ -180,7 +189,7 @@ require_once "includes/paging.php";
|
||||
echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
|
||||
echo " <td width='33.3%' align='right'>\n";
|
||||
if (permission_exists('default_setting_add')) {
|
||||
echo " <a href='default_setting_edit.php' alt='add'>$v_link_label_add</a>\n";
|
||||
echo " <a href='default_setting_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
|
||||
}
|
||||
else {
|
||||
echo " \n";
|
||||
|
||||
162
core/domain_settings/app_languages.php
Normal file
162
core/domain_settings/app_languages.php
Normal file
@@ -0,0 +1,162 @@
|
||||
<?php
|
||||
|
||||
//Domains
|
||||
|
||||
$text['title-domains']['en-us'] = '# Domains';
|
||||
$text['title-domains']['pt-pt'] = '# ';
|
||||
|
||||
$text['header-domains']['en-us'] = '# Domains';
|
||||
$text['header-domains']['pt-pt'] = '# ';
|
||||
|
||||
$text['description-domains']['en-us'] = '# Control the list of domains to manage.';
|
||||
$text['description-domains']['pt-pt'] = '# ';
|
||||
|
||||
//------
|
||||
|
||||
$text['title-domain-edit']['en-us'] = '# Domain Edit';
|
||||
$text['title-domain-edit']['pt-pt'] = '# ';
|
||||
|
||||
$text['header-domain-edit']['en-us'] = '# Domain Edit';
|
||||
$text['header-domain-edit']['pt-pt'] = '# ';
|
||||
|
||||
$text['description-domain-edit']['en-us'] = '# Edit the details of this domain.';
|
||||
$text['description-domain-edit']['pt-pt'] = '# ';
|
||||
|
||||
$text['header-settings']['en-us'] = '# Settings';
|
||||
$text['header-settings']['pt-pt'] = '# ';
|
||||
|
||||
//------
|
||||
|
||||
$text['title-domain-add']['en-us'] = '# Domain Add';
|
||||
$text['title-domain-add']['pt-pt'] = '# ';
|
||||
|
||||
$text['header-domain-add']['en-us'] = '# Domain Add';
|
||||
$text['header-domain-add']['pt-pt'] = '# ';
|
||||
|
||||
$text['description-domain-add']['en-us'] = '# Enter the domain details below.';
|
||||
$text['description-domain-add']['pt-pt'] = '# ';
|
||||
|
||||
//------
|
||||
|
||||
$text['label-domain']['en-us'] = '# Domain';
|
||||
$text['label-domain']['pt-pt'] = '# ';
|
||||
|
||||
$text['label-name']['en-us'] = '# Name';
|
||||
$text['label-name']['pt-pt'] = '# ';
|
||||
|
||||
$text['description-name']['en-us'] = '# Enter the name of the domain.';
|
||||
$text['description-name']['pt-pt'] = '# ';
|
||||
|
||||
$text['label-description']['en-us'] = '# Description';
|
||||
$text['label-description']['pt-pt'] = '# ';
|
||||
|
||||
$text['description-description']['en-us'] = '# Enter a description for this domain, if desired.';
|
||||
$text['description-description']['pt-pt'] = '# ';
|
||||
|
||||
//------ settings
|
||||
|
||||
$text['title-domain_setting-edit']['en-us'] = '# Domain Setting Edit';
|
||||
$text['title-domain_setting-edit']['pt-pt'] = '# ';
|
||||
|
||||
$text['header-domain_setting-edit']['en-us'] = '# Domain Setting Edit';
|
||||
$text['header-domain_setting-edit']['pt-pt'] = '# ';
|
||||
|
||||
$text['description-domain_setting-edit']['en-us'] = '# Edit a setting for this domain.';
|
||||
$text['description-domain_setting-edit']['pt-pt'] = '# ';
|
||||
|
||||
|
||||
//------
|
||||
|
||||
$text['title-domain_setting-add']['en-us'] = '# Domain Setting Add';
|
||||
$text['title-domain_setting-add']['pt-pt'] = '# ';
|
||||
|
||||
$text['header-domain_setting-add']['en-us'] = '# Domain Setting Add';
|
||||
$text['header-domain_setting-add']['pt-pt'] = '# ';
|
||||
|
||||
$text['description-domain_setting-add']['en-us'] = '# Add a setting for this domain.';
|
||||
$text['description-domain_setting-add']['pt-pt'] = '# ';
|
||||
|
||||
//------
|
||||
|
||||
$text['label-category']['en-us'] = '# Category';
|
||||
$text['label-category']['pt-pt'] = '# ';
|
||||
|
||||
$text['description-category']['en-us'] = '# Enter the category.';
|
||||
$text['description-category']['pt-pt'] = '# ';
|
||||
|
||||
$text['label-subcategory']['en-us'] = '# Subcategory';
|
||||
$text['label-subcategory']['pt-pt'] = '# ';
|
||||
|
||||
$text['description-subcategory']['en-us'] = '# Enter the subcategory.';
|
||||
$text['description-subcategory']['pt-pt'] = '# ';
|
||||
|
||||
$text['label-type']['en-us'] = '# Type';
|
||||
$text['label-type']['pt-pt'] = '# ';
|
||||
|
||||
$text['description-type']['en-us'] = '# Enter the setting type (ie. uuid, name, var, dir, etc).';
|
||||
$text['description-type']['pt-pt'] = '# ';
|
||||
|
||||
$text['label-value']['en-us'] = '# Value';
|
||||
$text['label-value']['pt-pt'] = '# ';
|
||||
|
||||
$text['description-value']['en-us'] = '# Enter the value of this setting.';
|
||||
$text['description-value']['pt-pt'] = '# ';
|
||||
|
||||
$text['label-enabled']['en-us'] = '# Enabled';
|
||||
$text['label-enabled']['pt-pt'] = '# ';
|
||||
|
||||
$text['description-enabled']['en-us'] = '# Set the status of this default setting.';
|
||||
$text['description-enabled']['pt-pt'] = '# ';
|
||||
|
||||
$text['label-description']['en-us'] = '# Description';
|
||||
$text['label-description']['pt-pt'] = '# ';
|
||||
|
||||
$text['description-description']['en-us'] = '# Enter a description, if desired.';
|
||||
$text['description-description']['pt-pt'] = '# ';
|
||||
|
||||
$text['label-true']['en-us'] = '# True';
|
||||
$text['label-true']['pt-pt'] = '# ';
|
||||
|
||||
$text['label-false']['en-us'] = '# False';
|
||||
$text['label-false']['pt-pt'] = '# falso';
|
||||
|
||||
$text['label-none']['en-us'] = '# None';
|
||||
$text['label-none']['pt-pt'] = '# ';
|
||||
|
||||
$text['button-add']['en-us'] = '# Add';
|
||||
$text['button-add']['pt-pt'] = '# ';
|
||||
|
||||
$text['button-edit']['en-us'] = '# Edit';
|
||||
$text['button-edit']['pt-pt'] = '# ';
|
||||
|
||||
$text['button-delete']['en-us'] = '# Delete';
|
||||
$text['button-delete']['pt-pt'] = '# ';
|
||||
|
||||
$text['confirm-delete']['en-us'] = '# Do you really want to delete this?';
|
||||
$text['confirm-delete']['pt-pt'] = '# ';
|
||||
|
||||
$text['button-save']['en-us'] = '# Save';
|
||||
$text['button-save']['pt-pt'] = '# Guardar';
|
||||
|
||||
$text['button-back']['en-us'] = '# Back';
|
||||
$text['button-back']['pt-pt'] = '# Voltar';
|
||||
|
||||
$text['button-export']['en-us'] = '# Export';
|
||||
$text['button-export']['pt-pt'] = '# ';
|
||||
|
||||
$text['message-message']['en-us'] = '# Message';
|
||||
$text['message-message']['pt-pt'] = '# ';
|
||||
|
||||
$text['message-add']['en-us'] = '# Add Completed';
|
||||
$text['message-add']['pt-pt'] = '# ';
|
||||
|
||||
$text['message-update']['en-us'] = '# Update Completed';
|
||||
$text['message-update']['pt-pt'] = '# ';
|
||||
|
||||
$text['message-delete']['en-us'] = '# Delete Completed';
|
||||
$text['message-delete']['pt-pt'] = '# ';
|
||||
|
||||
$text['message-required']['en-us'] = '# Please provide: ';
|
||||
$text['message-required']['pt-pt'] = '# ';
|
||||
|
||||
?>
|
||||
@@ -33,6 +33,7 @@ else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once "includes/header.php";
|
||||
require_once "includes/paging.php";
|
||||
|
||||
@@ -80,9 +81,9 @@ require_once "includes/paging.php";
|
||||
$rows_per_page = 100;
|
||||
$param = "";
|
||||
$page = $_GET['page'];
|
||||
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
|
||||
list($paging_controls, $rows_per_page, $var3) = paging($num_rows, $param, $rows_per_page);
|
||||
$offset = $rows_per_page * $page;
|
||||
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
|
||||
list($paging_controls, $rows_per_page, $var3) = paging($num_rows, $param, $rows_per_page);
|
||||
$offset = $rows_per_page * $page;
|
||||
|
||||
//get the list
|
||||
$sql = "select * from v_domain_settings ";
|
||||
@@ -111,14 +112,14 @@ require_once "includes/paging.php";
|
||||
echo " <br />\n";
|
||||
echo " <b>".ucfirst($row['domain_setting_category'])."</b> </td></tr>\n";
|
||||
echo "<tr>\n";
|
||||
echo th_order_by('domain_setting_subcategory', 'Category', $order_by, $order);
|
||||
echo th_order_by('domain_setting_name', 'Type', $order_by, $order);
|
||||
echo th_order_by('domain_setting_value', 'Value', $order_by, $order);
|
||||
echo th_order_by('domain_setting_enabled', 'Enabled', $order_by, $order);
|
||||
echo th_order_by('domain_setting_description', 'Description', $order_by, $order);
|
||||
echo th_order_by('domain_setting_subcategory', $text['label-category'], $order_by, $order);
|
||||
echo th_order_by('domain_setting_name', $text['label-type'], $order_by, $order);
|
||||
echo th_order_by('domain_setting_value', $text['label-value'], $order_by, $order);
|
||||
echo th_order_by('domain_setting_enabled', $text['label-enabled'], $order_by, $order);
|
||||
echo th_order_by('domain_setting_description', $text['label-description'], $order_by, $order);
|
||||
echo "<td align='right' width='42'>\n";
|
||||
if (permission_exists('domain_setting_add')) {
|
||||
echo " <a href='domain_settings_edit.php?domain_uuid=".$_GET['id']."' alt='add'>$v_link_label_add</a>\n";
|
||||
echo " <a href='domain_settings_edit.php?domain_uuid=".$_GET['id']."' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
|
||||
}
|
||||
else {
|
||||
echo " \n";
|
||||
@@ -160,10 +161,10 @@ require_once "includes/paging.php";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row['domain_setting_description']." </td>\n";
|
||||
echo " <td valign='top' align='right'>\n";
|
||||
if (permission_exists('domain_setting_edit')) {
|
||||
echo " <a href='domain_settings_edit.php?domain_uuid=".$row['domain_uuid']."&id=".$row['domain_setting_uuid']."' alt='edit'>$v_link_label_edit</a>\n";
|
||||
echo " <a href='domain_settings_edit.php?domain_uuid=".$row['domain_uuid']."&id=".$row['domain_setting_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>\n";
|
||||
}
|
||||
if (permission_exists('domain_setting_delete')) {
|
||||
echo " <a href='domain_settings_delete.php?domain_uuid=".$row['domain_uuid']."&id=".$row['domain_setting_uuid']."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
|
||||
echo " <a href='domain_settings_delete.php?domain_uuid=".$row['domain_uuid']."&id=".$row['domain_setting_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>\n";
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
@@ -181,7 +182,7 @@ require_once "includes/paging.php";
|
||||
echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
|
||||
echo " <td width='33.3%' align='right'>\n";
|
||||
if (permission_exists('domain_setting_add')) {
|
||||
echo " <a href='domain_settings_edit.php?domain_uuid=".$_GET['id']."' alt='add'>$v_link_label_add</a>\n";
|
||||
echo " <a href='domain_settings_edit.php?domain_uuid=".$_GET['id']."' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
|
||||
}
|
||||
else {
|
||||
echo " \n";
|
||||
|
||||
@@ -34,6 +34,12 @@ else {
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
require_once "app_languages.php";
|
||||
foreach($text as $key => $value) {
|
||||
$text[$key] = $value[$_SESSION['domain']['language']['code']];
|
||||
}
|
||||
|
||||
if (count($_GET)>0) {
|
||||
$id = check_str($_GET["id"]);
|
||||
$domain_uuid = check_str($_GET["domain_uuid"]);
|
||||
@@ -53,7 +59,7 @@ if (strlen($id)>0) {
|
||||
require_once "includes/header.php";
|
||||
echo "<meta http-equiv=\"refresh\" content=\"2;url=domains_edit.php?id=$domain_uuid\">\n";
|
||||
echo "<div align='center'>\n";
|
||||
echo "Delete Complete\n";
|
||||
echo $text['message-delete']."\n";
|
||||
echo "</div>\n";
|
||||
require_once "includes/footer.php";
|
||||
return;
|
||||
|
||||
@@ -34,6 +34,12 @@ else {
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
require_once "app_languages.php";
|
||||
foreach($text as $key => $value) {
|
||||
$text[$key] = $value[$_SESSION['domain']['language']['code']];
|
||||
}
|
||||
|
||||
//action add or update
|
||||
if (isset($_REQUEST["id"])) {
|
||||
$action = "update";
|
||||
@@ -54,7 +60,7 @@ if (strlen($_GET["domain_uuid"]) > 0) {
|
||||
$domain_setting_name = check_str($_POST["domain_setting_name"]);
|
||||
$domain_setting_value = check_str($_POST["domain_setting_value"]);
|
||||
$domain_setting_enabled = check_str($_POST["domain_setting_enabled"]);
|
||||
$domain_setting_description = check_str($_POST["domain_setting_description"]);
|
||||
$domain_setting_description = check_str($_POST["domain_setting_description"]);
|
||||
}
|
||||
|
||||
if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
@@ -65,13 +71,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
}
|
||||
|
||||
//check for all required data
|
||||
//if (strlen($domain_uuid) == 0) { $msg .= "Please provide: domain_uuid<br>\n"; }
|
||||
//if (strlen($domain_setting_category) == 0) { $msg .= "Please provide: Category<br>\n"; }
|
||||
//if (strlen($domain_setting_subcategory) == 0) { $msg .= "Please provide: Subcategory<br>\n"; }
|
||||
//if (strlen($domain_setting_name) == 0) { $msg .= "Please provide: Type<br>\n"; }
|
||||
//if (strlen($domain_setting_value) == 0) { $msg .= "Please provide: Value<br>\n"; }
|
||||
//if (strlen($domain_setting_enabled) == 0) { $msg .= "Please provide: Enabled<br>\n"; }
|
||||
//if (strlen($domain_setting_description) == 0) { $msg .= "Please provide: Description<br>\n"; }
|
||||
//if (strlen($domain_setting_category) == 0) { $msg .= $text['message-required'].$text['label-category']."<br>\n"; }
|
||||
//if (strlen($domain_setting_subcategory) == 0) { $msg .= $text['message-required'].$text['label-subcategory']."<br>\n"; }
|
||||
//if (strlen($domain_setting_name) == 0) { $msg .= $text['message-required'].$text['label-type']."<br>\n"; }
|
||||
//if (strlen($domain_setting_value) == 0) { $msg .= $text['message-required'].$text['label-value']."<br>\n"; }
|
||||
//if (strlen($domain_setting_enabled) == 0) { $msg .= $text['message-required'].$text['label-enabled']."<br>\n"; }
|
||||
//if (strlen($domain_setting_description) == 0) { $msg .= $text['message-required'].$text['label-description']."<br>\n"; }
|
||||
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
require_once "includes/header.php";
|
||||
require_once "includes/persistformvar.php";
|
||||
@@ -97,7 +102,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
$sql .= "domain_setting_name, ";
|
||||
$sql .= "domain_setting_value, ";
|
||||
$sql .= "domain_setting_enabled, ";
|
||||
$sql .= "domain_setting_description ";
|
||||
$sql .= "domain_setting_description ";
|
||||
$sql .= ")";
|
||||
$sql .= "values ";
|
||||
$sql .= "(";
|
||||
@@ -116,7 +121,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
require_once "includes/header.php";
|
||||
echo "<meta http-equiv=\"refresh\" content=\"2;url=domains_edit.php?id=$domain_uuid\">\n";
|
||||
echo "<div align='center'>\n";
|
||||
echo "Add Complete\n";
|
||||
echo $text['message-add']."\n";
|
||||
echo "</div>\n";
|
||||
require_once "includes/footer.php";
|
||||
return;
|
||||
@@ -129,7 +134,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
$sql .= "domain_setting_name = '$domain_setting_name', ";
|
||||
$sql .= "domain_setting_value = '$domain_setting_value', ";
|
||||
$sql .= "domain_setting_enabled = '$domain_setting_enabled', ";
|
||||
$sql .= "domain_setting_description = '$domain_setting_description' ";
|
||||
$sql .= "domain_setting_description = '$domain_setting_description' ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and domain_setting_uuid = '$domain_setting_uuid'";
|
||||
$db->exec(check_sql($sql));
|
||||
@@ -138,12 +143,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
require_once "includes/header.php";
|
||||
echo "<meta http-equiv=\"refresh\" content=\"2;url=domains_edit.php?id=$domain_uuid\">\n";
|
||||
echo "<div align='center'>\n";
|
||||
echo "Update Complete\n";
|
||||
echo $text['message-update']."\n";
|
||||
echo "</div>\n";
|
||||
require_once "includes/footer.php";
|
||||
return;
|
||||
} //if ($action == "update")
|
||||
} //if ($_POST["persistformvar"] != "true")
|
||||
} //if ($_POST["persistformvar"] != "true")
|
||||
} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
|
||||
|
||||
//pre-populate the form
|
||||
@@ -169,6 +174,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
//show the header
|
||||
require_once "includes/header.php";
|
||||
if ($action == "update") {
|
||||
$page["title"] = $text['title-domain_setting-edit'];
|
||||
}
|
||||
if ($action == "add") {
|
||||
$page["title"] = $text['title-domain_setting-add'];
|
||||
}
|
||||
|
||||
//show the content
|
||||
echo "<div align='center'>";
|
||||
@@ -181,51 +192,64 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
echo "<div align='center'>\n";
|
||||
echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<td align='left' width='30%' nowrap='nowrap'><b>Domain Setting</b></td>\n";
|
||||
echo "<td width='70%' align='right'><input type='button' class='btn' name='' alt='back' onclick=\"window.location='domains_edit.php?id=$domain_uuid'\" value='Back'></td>\n";
|
||||
echo "<td align='left' width='30%' nowrap='nowrap'><b>";
|
||||
if ($action == "update") {
|
||||
echo $text['header-domain_setting-edit'];
|
||||
}
|
||||
if ($action == "add") {
|
||||
echo $text['header-domain_setting-add'];
|
||||
}
|
||||
echo "</b></td>\n";
|
||||
echo "<td width='70%' align='right'><input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='domains_edit.php?id=$domain_uuid'\" value='".$text['button-back']."'></td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<td align='left' colspan='2'>\n";
|
||||
echo "Settings used for each domain.<br /><br />\n";
|
||||
if ($action == "update") {
|
||||
echo $text['description-domain_setting-edit'];
|
||||
}
|
||||
if ($action == "add") {
|
||||
echo $text['header-domain_setting-add'];
|
||||
}
|
||||
echo "<br /><br />\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " Category:\n";
|
||||
echo " ".$text['label-category'].":\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='domain_setting_category' maxlength='255' value=\"$domain_setting_category\">\n";
|
||||
echo "<br />\n";
|
||||
echo "Enter the category.\n";
|
||||
echo $text['description-category']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " Subcategory:\n";
|
||||
echo " ".$text['label-subcategory'].":\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='domain_setting_subcategory' maxlength='255' value=\"$domain_setting_subcategory\">\n";
|
||||
echo "<br />\n";
|
||||
echo "Enter the subcategory.\n";
|
||||
echo $text['description-subcategory']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " Type:\n";
|
||||
echo " ".$text['label-type'].":\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='domain_setting_name' maxlength='255' value=\"$domain_setting_name\">\n";
|
||||
echo "<br />\n";
|
||||
echo "Enter the type.\n";
|
||||
echo $text['description-type']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " Value:\n";
|
||||
echo " ".$text['label-value'].":\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
$category = $row['domain_setting_category'];
|
||||
@@ -308,43 +332,43 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
echo " <input class='formfld' type='text' name='domain_setting_value' maxlength='255' value=\"$domain_setting_value\">\n";
|
||||
}
|
||||
echo "<br />\n";
|
||||
echo "Enter the value.\n";
|
||||
echo $text['description-value']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " Enabled:\n";
|
||||
echo " ".$text['label-enabled'].":\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <select class='formfld' name='domain_setting_enabled'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
if ($domain_setting_enabled == "true") {
|
||||
echo " <option value='true' selected='selected'>true</option>\n";
|
||||
if ($domain_setting_enabled == "true") {
|
||||
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='true'>true</option>\n";
|
||||
echo " <option value='true'>".$text['label-true']."</option>\n";
|
||||
}
|
||||
if ($domain_setting_enabled == "false") {
|
||||
echo " <option value='false' selected='selected'>false</option>\n";
|
||||
if ($domain_setting_enabled == "false") {
|
||||
echo " <option value='false' selected='selected'>".$text['label-false']."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='false'>false</option>\n";
|
||||
echo " <option value='false'>".$text['label-false']."</option>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
echo "<br />\n";
|
||||
echo "Choose to enable or disable the value.\n";
|
||||
echo $text['description-enabled']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " Description:\n";
|
||||
echo " ".$text['label-description'].":\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='domain_setting_description' maxlength='255' value=\"$domain_setting_description\">\n";
|
||||
echo "<br />\n";
|
||||
echo "Enter the description.\n";
|
||||
echo $text['description-description']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
@@ -354,7 +378,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
if ($action == "update") {
|
||||
echo " <input type='hidden' name='domain_setting_uuid' value='$domain_setting_uuid'>\n";
|
||||
}
|
||||
echo " <input type='submit' name='submit' class='btn' value='Save'>\n";
|
||||
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>";
|
||||
echo "</table>";
|
||||
|
||||
@@ -34,6 +34,12 @@ else {
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
require_once "app_languages.php";
|
||||
foreach($text as $key => $value) {
|
||||
$text[$key] = $value[$_SESSION['domain']['language']['code']];
|
||||
}
|
||||
|
||||
//change the domain
|
||||
if (strlen(check_str($_GET["domain_uuid"])) > 0 && check_str($_GET["domain_change"]) == "true") {
|
||||
if (permission_exists('domain_select')) {
|
||||
@@ -79,6 +85,8 @@ else {
|
||||
|
||||
//includes
|
||||
require_once "includes/header.php";
|
||||
$page["title"] = $text['title-domains'];
|
||||
|
||||
require_once "includes/paging.php";
|
||||
|
||||
//get variables used to control the order
|
||||
@@ -94,12 +102,12 @@ else {
|
||||
|
||||
echo "<table width='100%' border='0'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td width='50%' align='left' nowrap='nowrap'><b>Domains</b></td>\n";
|
||||
echo " <td width='50%' align='left' nowrap='nowrap'><b>".$text['header-domains']."</b></td>\n";
|
||||
echo " <td width='50%' align='right'> </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td align='left' colspan='2'>\n";
|
||||
echo " Control the list of domains to manage.<br /><br />\n";
|
||||
echo " ".$text['description-domains']."<br /><br />\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo "</table>\n";
|
||||
@@ -123,9 +131,9 @@ else {
|
||||
$rows_per_page = 100;
|
||||
$param = "";
|
||||
$page = $_GET['page'];
|
||||
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
|
||||
list($paging_controls, $rows_per_page, $var3) = paging($num_rows, $param, $rows_per_page);
|
||||
$offset = $rows_per_page * $page;
|
||||
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
|
||||
list($paging_controls, $rows_per_page, $var3) = paging($num_rows, $param, $rows_per_page);
|
||||
$offset = $rows_per_page * $page;
|
||||
|
||||
//get the list
|
||||
$sql = "select * from v_domains ";
|
||||
@@ -133,7 +141,7 @@ else {
|
||||
$sql .= "order by domain_name asc ";
|
||||
}
|
||||
else {
|
||||
$sql .= "order by $order_by $order ";
|
||||
$sql .= "order by $order_by $order ";
|
||||
}
|
||||
$sql .= " limit $rows_per_page offset $offset ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
@@ -149,11 +157,11 @@ else {
|
||||
echo "<div align='center'>\n";
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
echo "<tr>\n";
|
||||
echo th_order_by('domain_name', 'Domain', $order_by, $order);
|
||||
echo th_order_by('domain_description', 'Description', $order_by, $order);
|
||||
echo th_order_by('domain_name', $text['label-domain'], $order_by, $order);
|
||||
echo th_order_by('domain_description', $text['label-description'], $order_by, $order);
|
||||
echo "<td align='right' width='42'>\n";
|
||||
if (permission_exists('domain_add')) {
|
||||
echo " <a href='domains_edit.php' alt='add'>$v_link_label_add</a>\n";
|
||||
echo " <a href='domains_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
|
||||
}
|
||||
else {
|
||||
echo " \n";
|
||||
@@ -168,10 +176,10 @@ else {
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row['domain_description']." </td>\n";
|
||||
echo " <td valign='top' align='right'>\n";
|
||||
if (permission_exists('domain_edit')) {
|
||||
echo " <a href='domains_edit.php?id=".$row['domain_uuid']."' alt='edit'>$v_link_label_edit</a>\n";
|
||||
echo " <a href='domains_edit.php?id=".$row['domain_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>\n";
|
||||
}
|
||||
if (permission_exists('domain_delete')) {
|
||||
echo " <a href='domains_delete.php?id=".$row['domain_uuid']."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
|
||||
echo " <a href='domains_delete.php?id=".$row['domain_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>\n";
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
@@ -188,7 +196,7 @@ else {
|
||||
echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
|
||||
echo " <td width='33.3%' align='right'>\n";
|
||||
if (permission_exists('domain_add')) {
|
||||
echo " <a href='domains_edit.php' alt='add'>$v_link_label_add</a>\n";
|
||||
echo " <a href='domains_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
|
||||
}
|
||||
else {
|
||||
echo " \n";
|
||||
|
||||
@@ -34,6 +34,12 @@ else {
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
require_once "app_languages.php";
|
||||
foreach($text as $key => $value) {
|
||||
$text[$key] = $value[$_SESSION['domain']['language']['code']];
|
||||
}
|
||||
|
||||
if (count($_GET)>0) {
|
||||
$id = check_str($_GET["id"]);
|
||||
}
|
||||
@@ -60,7 +66,7 @@ if (strlen($id) > 0) {
|
||||
foreach($result as $row) {
|
||||
$name = $row['domain_setting_name'];
|
||||
$category = $row['domain_setting_category'];
|
||||
$subcategory = $row['domain_setting_subcategory'];
|
||||
$subcategory = $row['domain_setting_subcategory'];
|
||||
if (strlen($subcategory) == 0) {
|
||||
//$$category[$name] = $row['domain_setting_value'];
|
||||
$_SESSION[$category][$name] = $row['domain_setting_value'];
|
||||
@@ -112,7 +118,7 @@ if (strlen($id) > 0) {
|
||||
//delete the dialplan public
|
||||
unlink($_SESSION['switch']['dialplan']['dir'].'/public/'.$domain_name.'.xml');
|
||||
if (strlen($_SESSION['switch']['dialplan']['dir']) > 0) {
|
||||
system('rm -rf '.$_SESSION['switch']['dialplan']['dir'].'/public/'.$domain_name);
|
||||
system('rm -rf '.$_SESSION['switch']['dialplan']['dir'].'/public/'.$domain_name);
|
||||
}
|
||||
|
||||
//delete the extension
|
||||
@@ -187,7 +193,7 @@ if (strlen($id) > 0) {
|
||||
require_once "includes/header.php";
|
||||
echo "<meta http-equiv=\"refresh\" content=\"2;url=domains.php\">\n";
|
||||
echo "<div align='center'>\n";
|
||||
echo "Delete Complete\n";
|
||||
echo $text['message-delete']."\n";
|
||||
echo "</div>\n";
|
||||
require_once "includes/footer.php";
|
||||
return;
|
||||
|
||||
@@ -34,6 +34,12 @@ else {
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
require_once "app_languages.php";
|
||||
foreach($text as $key => $value) {
|
||||
$text[$key] = $value[$_SESSION['domain']['language']['code']];
|
||||
}
|
||||
|
||||
//action add or update
|
||||
if (isset($_REQUEST["id"])) {
|
||||
$action = "update";
|
||||
@@ -57,8 +63,8 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
}
|
||||
|
||||
//check for all required data
|
||||
//if (strlen($domain_name) == 0) { $msg .= "Please provide: Domain<br>\n"; }
|
||||
//if (strlen($domain_description) == 0) { $msg .= "Please provide: Description<br>\n"; }
|
||||
//if (strlen($domain_name) == 0) { $msg .= $text['message-required'].$text['label-name']."<br>\n"; }
|
||||
//if (strlen($domain_description) == 0) { $msg .= $text['message-required'].$text['label-description']."<br>\n"; }
|
||||
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
require_once "includes/header.php";
|
||||
require_once "includes/persistformvar.php";
|
||||
@@ -124,10 +130,10 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
echo "<meta http-equiv=\"refresh\" content=\"2;url=domains.php\">\n";
|
||||
echo "<div align='center'>\n";
|
||||
if ($action == "update") {
|
||||
echo "Update Complete\n";
|
||||
echo $text['message-update']."\n";
|
||||
}
|
||||
if ($action == "add") {
|
||||
echo "Add Complete\n";
|
||||
echo $text['message-add']."\n";
|
||||
}
|
||||
echo "</div>\n";
|
||||
require_once "includes/footer.php";
|
||||
@@ -151,6 +157,12 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
//show the header
|
||||
require_once "includes/header.php";
|
||||
if ($action == "update") {
|
||||
$page["title"] = $text['title-domain-edit'];
|
||||
}
|
||||
if ($action == "add") {
|
||||
$page["title"] = $text['title-domain-add'];
|
||||
}
|
||||
|
||||
//show the content
|
||||
echo "<div align='center'>";
|
||||
@@ -163,39 +175,52 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
echo "<div align='center'>\n";
|
||||
echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<td align='left' width='30%' nowrap='nowrap'><b>Domain</b></td>\n";
|
||||
echo "<td align='left' width='30%' nowrap='nowrap'><b>";
|
||||
if ($action == "update") {
|
||||
echo $text['header-domain-edit'];
|
||||
}
|
||||
if ($action == "add") {
|
||||
echo $text['header-domain-add'];
|
||||
}
|
||||
echo "</b></td>\n";
|
||||
echo "<td width='70%' align='right'>\n";
|
||||
if (permission_exists('domain_export')) {
|
||||
echo " <input type='button' class='btn' name='' alt='export' onclick=\"window.location='".PROJECT_PATH."/app/domain_export/index.php?id=".$domain_uuid."'\" value='Export'>\n";
|
||||
echo " <input type='button' class='btn' name='' alt='".$text['button-export']."' onclick=\"window.location='".PROJECT_PATH."/app/domain_export/index.php?id=".$domain_uuid."'\" value='".$text['button-export']."'>\n";
|
||||
}
|
||||
echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='domains.php'\" value='Back'>\n";
|
||||
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='domains.php'\" value='".$text['button-back']."'>\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<td align='left' colspan='2'>\n";
|
||||
echo "Control the list of domains to manage.<br /><br />\n";
|
||||
if ($action == "update") {
|
||||
echo $text['description-domain-edit'];
|
||||
}
|
||||
if ($action == "add") {
|
||||
echo $text['description-domain-add'];
|
||||
}
|
||||
echo "<br /><br />\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " Domain:\n";
|
||||
echo " ".$text['label-name'].":\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='domain_name' maxlength='255' value=\"$domain_name\">\n";
|
||||
echo "<br />\n";
|
||||
echo "Enter the domain name.\n";
|
||||
echo $text['description-name']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " Description:\n";
|
||||
echo " ".$text['label-description'].":\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='domain_description' maxlength='255' value=\"$domain_description\">\n";
|
||||
echo "<br />\n";
|
||||
echo "Enter the description.\n";
|
||||
echo $text['description-description']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
echo " <tr>\n";
|
||||
@@ -203,7 +228,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
if ($action == "update") {
|
||||
echo " <input type='hidden' name='domain_uuid' value='$domain_uuid'>\n";
|
||||
}
|
||||
echo " <input type='submit' name='submit' class='btn' value='Save'>\n";
|
||||
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>";
|
||||
echo "</table>";
|
||||
|
||||
Reference in New Issue
Block a user