Domain Settings: List view updates, move actions to class.
This commit is contained in:
@@ -37,6 +37,47 @@
|
||||
exit;
|
||||
}
|
||||
|
||||
//get the http post data
|
||||
if ($_POST['action'] != '') {
|
||||
$action = $_POST['action'];
|
||||
$domain_uuid = $_POST['domain_uuid'];
|
||||
$domain_settings = $_POST['domain_settings'];
|
||||
$domain_uuid_target = $_POST['domain_uuid_target'];
|
||||
|
||||
//process the http post data by action
|
||||
if (is_array($domain_settings) && @sizeof($domain_settings) != 0) {
|
||||
switch ($action) {
|
||||
case 'copy':
|
||||
if (permission_exists('domain_setting_add') && permission_exists('domain_select') && count($_SESSION['domains']) > 1) {
|
||||
$obj = new domain_settings;
|
||||
$obj->domain_uuid = $domain_uuid;
|
||||
$obj->domain_uuid_target = $domain_uuid_target;
|
||||
$obj->copy($domain_settings);
|
||||
}
|
||||
break;
|
||||
case 'toggle':
|
||||
if (permission_exists('domain_setting_edit')) {
|
||||
$obj = new domain_settings;
|
||||
$obj->domain_uuid = $domain_uuid;
|
||||
$obj->toggle($domain_settings);
|
||||
}
|
||||
break;
|
||||
case 'delete':
|
||||
if (permission_exists('domain_setting_delete')) {
|
||||
$obj = new domain_settings;
|
||||
$obj->domain_uuid = $domain_uuid;
|
||||
$obj->delete($domain_settings);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//redirect
|
||||
header('Location: '.PROJECT_PATH.'/core/domains/domain_edit.php?id='.urlencode($_REQUEST['domain_uuid']));
|
||||
exit;
|
||||
}
|
||||
|
||||
/*
|
||||
//get posted values, if any
|
||||
if (is_array($_REQUEST) && @sizeof($_REQUEST) > 1) {
|
||||
//get the variables
|
||||
@@ -45,6 +86,7 @@
|
||||
$domain_setting_uuids = $_REQUEST["id"];
|
||||
$enabled = $_REQUEST['enabled'];
|
||||
|
||||
|
||||
//validate the token
|
||||
$token = new token;
|
||||
if (!$token->validate(PROJECT_PATH."/core/domains/domain_edit.php")) {
|
||||
@@ -310,48 +352,34 @@
|
||||
}
|
||||
}
|
||||
|
||||
//include the paging
|
||||
require_once "resources/paging.php";
|
||||
*/
|
||||
|
||||
//get the variables
|
||||
$order_by = $_GET["order_by"];
|
||||
$order = $_GET["order"];
|
||||
|
||||
//prepare to page the results
|
||||
$sql = "select count(*) from v_domain_settings ";
|
||||
$sql = "select count(domain_setting_uuid) from v_domain_settings ";
|
||||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
$database = new database;
|
||||
$num_rows = $database->select($sql, $parameters, 'column');
|
||||
unset($sql);
|
||||
|
||||
//prepare to page the results
|
||||
$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 1000;
|
||||
$param = "";
|
||||
if (isset($_GET['page'])) {
|
||||
$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;
|
||||
}
|
||||
|
||||
//get the list
|
||||
$sql = "select * from v_domain_settings ";
|
||||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
$sql = str_replace('count(domain_setting_uuid)', '*', $sql);
|
||||
if ($order_by == '') {
|
||||
$sql .= "order by domain_setting_category, domain_setting_subcategory, domain_setting_order asc, domain_setting_name, domain_setting_value ";
|
||||
$sql .= " order by domain_setting_category, domain_setting_subcategory, domain_setting_order asc, domain_setting_name, domain_setting_value ";
|
||||
}
|
||||
else {
|
||||
$sql .= order_by($order_by, $order);
|
||||
}
|
||||
$sql .= limit_offset($rows_per_page, $offset);
|
||||
$database = new database;
|
||||
$result = $database->select($sql, $parameters, 'all');
|
||||
$domain_settings = $database->select($sql, $parameters, 'all');
|
||||
unset($sql, $parameters);
|
||||
|
||||
$c = 0;
|
||||
$row_style["0"] = "row_style0";
|
||||
$row_style["1"] = "row_style1";
|
||||
//create token
|
||||
$object = new token;
|
||||
$token = $object->create('/core/domain_settings/domain_settings.php');
|
||||
|
||||
//copy settings javascript
|
||||
if (
|
||||
@@ -364,123 +392,134 @@
|
||||
echo " var fade_speed = 400;\n";
|
||||
echo " function show_domains() {\n";
|
||||
echo " $('#button_copy').fadeOut(fade_speed, function() {\n";
|
||||
echo " $('#button_back').fadeIn(fade_speed);\n";
|
||||
echo " $('#target_domain_uuid').fadeIn(fade_speed);\n";
|
||||
echo " $('#button_reset').fadeIn(fade_speed);\n";
|
||||
echo " $('#target_domain').fadeIn(fade_speed);\n";
|
||||
echo " $('#button_paste').fadeIn(fade_speed);\n";
|
||||
echo " document.getElementById('domain_uuid_target').value = '';\n";
|
||||
echo " });";
|
||||
echo " }";
|
||||
echo " function hide_domains() {\n";
|
||||
echo " $('#button_back').fadeOut(fade_speed);\n";
|
||||
echo " $('#target_domain_uuid').fadeOut(fade_speed);\n";
|
||||
echo " $('#button_reset').fadeOut(fade_speed);\n";
|
||||
echo " $('#target_domain').fadeOut(fade_speed);\n";
|
||||
echo " $('#button_paste').fadeOut(fade_speed, function() {\n";
|
||||
echo " $('#button_copy').fadeIn(fade_speed);\n";
|
||||
echo " document.getElementById('target_domain_uuid').selectedIndex = 0;\n";
|
||||
echo " document.getElementById('target_domain').selectedIndex = 0;\n";
|
||||
echo " document.getElementById('domain_uuid_target').value = '';\n";
|
||||
echo " });\n";
|
||||
echo " }\n";
|
||||
echo "</script>";
|
||||
}
|
||||
|
||||
//show the content
|
||||
echo "<form name='domain_frm' id='domain_frm' method='post' action='".PROJECT_PATH."/core/domain_settings/domain_settings.php'>\n";
|
||||
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
||||
echo "<input type='hidden' name='domain_uuid' value='".escape($domain_uuid)."'>\n";
|
||||
|
||||
echo "<div style='float: right;'>\n";
|
||||
echo "<div class='action_bar sub'>\n";
|
||||
echo " <div class='heading'><b>".$text['header-domain_settings']." (".$num_rows.")</b></div>\n";
|
||||
echo " <div class='actions'>\n";
|
||||
if (permission_exists('domain_setting_add')) {
|
||||
echo "<a href='".PROJECT_PATH."/core/domain_settings/domain_setting_edit.php?domain_uuid=".urlencode($domain_uuid)."' alt=\"".$text['button-add']."\"><button type='button' class='btn btn-default'><span class='fas fa-plus'></span> ".$text['button-add']."</button></a>";
|
||||
echo button::create(['type'=>'button','label'=>$text['button-add'],'icon'=>$_SESSION['theme']['button_icon_add'],'link'=>PROJECT_PATH."/core/domain_settings/domain_setting_edit.php?domain_uuid=".urlencode($domain_uuid)]);
|
||||
}
|
||||
if (is_array($result) && @sizeof($result) != 0) {
|
||||
if (permission_exists("domain_select") && permission_exists("domain_setting_add") && count($_SESSION['domains']) > 1) {
|
||||
echo " <button type='button' id='button_copy' class='btn btn-default' alt='".$text['button-copy']."' onclick='show_domains();'><span class='fas fa-copy'></span> ".$text['button-copy']."</button>";
|
||||
echo " <button type='button' id='button_back' class='btn btn-default' style='display: none;' alt='".$text['button-back']."' onclick='hide_domains();'><span class='fas fa-undo-alt'></span> ".$text['button-back']."</button>";
|
||||
echo " <select class='formfld' style='display: none; width: auto;' name='target_domain_uuid' id='target_domain_uuid'>\n";
|
||||
echo " <option value=''>".$text['label-domain']."...</option>\n";
|
||||
foreach ($_SESSION['domains'] as $domain) {
|
||||
if ($domain['domain_uuid'] == $domain_uuid) { continue; }
|
||||
echo " <option value='".escape($domain["domain_uuid"])."'>".escape($domain["domain_name"])."</option>\n";
|
||||
}
|
||||
if (permission_exists('default_setting_add') && permission_exists('default_setting_edit')) {
|
||||
echo " <option value='' disabled='disabled'></option>\n";
|
||||
echo " <option value='default'>".$text['label-default_settings']."</option>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
echo " <button type='submit' id='button_paste' name='action' class='btn btn-default' style='display: none;' alt='".$text['button-paste']."' value='copy'><span class='fas fa-paste'></span> ".$text['button-paste']."</button>";
|
||||
if (permission_exists("domain_select") && permission_exists("domain_setting_add") && $num_rows) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-copy'],'id'=>'button_copy','icon'=>$_SESSION['theme']['button_icon_copy'],'onclick'=>'show_domains();']);
|
||||
echo button::create(['type'=>'button','label'=>$text['button-reset'],'id'=>'button_reset','icon'=>$_SESSION['theme']['button_icon_reset'],'style'=>'display: none;','onclick'=>'hide_domains();']);
|
||||
echo "<select class='formfld' style='display: none; width: auto;' id='target_domain' onchange=\"document.getElementById('domain_uuid_target').value = this.options[this.selectedIndex].value;\">\n";
|
||||
echo " <option value='' selected='selected' disabled='disabled'>".$text['label-domain']."...</option>\n";
|
||||
foreach ($_SESSION['domains'] as $domain) {
|
||||
if ($domain['domain_uuid'] == $domain_uuid) { continue; }
|
||||
echo " <option value='".escape($domain["domain_uuid"])."'>".escape($domain["domain_name"])."</option>\n";
|
||||
}
|
||||
if (permission_exists('default_setting_edit')) {
|
||||
echo " <button type='submit' name='action' class='btn btn-default' alt=\"".$text['button-toggle']."\" value='toggle' onclick=\"if (!confirm('".$text['confirm-toggle']."')) { this.blur(); return false; }\"><span class='fas fa-toggle-on'></span> ".$text['button-toggle']."</button>";
|
||||
}
|
||||
if (permission_exists('default_setting_delete')) {
|
||||
echo " <button type='submit' name='action' class='btn btn-default' alt=\"".$text['button-delete']."\" value='delete' onclick=\"if (!confirm('".$text['confirm-delete']."')) { this.blur(); return false; }\"><span class='fas fa-trash'></span> ".$text['button-delete']."</button>";
|
||||
if (permission_exists('default_setting_add') && permission_exists('default_setting_edit')) {
|
||||
echo " <option value='' disabled='disabled'></option>\n";
|
||||
echo " <option value='default'>".$text['label-default_settings']."</option>\n";
|
||||
}
|
||||
echo " </select>";
|
||||
echo button::create(['type'=>'button','label'=>$text['button-paste'],'id'=>'button_paste','icon'=>$_SESSION['theme']['button_icon_paste'],'style'=>'display: none;','onclick'=>"if (confirm('".$text['confirm-copy']."')) { list_action_set('copy'); list_form_submit('form_list'); } else { this.blur(); return false; }"]);
|
||||
}
|
||||
if (permission_exists('default_setting_view') && is_array($result) && @sizeof($result) != 0) {
|
||||
if (permission_exists('domain_setting_edit') && $num_rows) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-toggle'],'icon'=>$_SESSION['theme']['button_icon_toggle'],'onclick'=>"if (confirm('".$text['confirm-toggle']."')) { list_action_set('toggle'); list_form_submit('form_list'); } else { this.blur(); return false; }"]);
|
||||
}
|
||||
if (permission_exists('domain_setting_delete') && $num_rows) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'onclick'=>"if (confirm('".$text['confirm-delete']."')) { list_action_set('delete'); list_form_submit('form_list'); } else { this.blur(); return false; }"]);
|
||||
}
|
||||
if (permission_exists('default_setting_view') && $num_rows) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-reload'],'icon'=>$_SESSION['theme']['button_icon_reload'],'style'=>'margin-left: 15px;','link'=>PROJECT_PATH.'/core/default_settings/default_settings_reload.php?id='.$domain_uuid]);
|
||||
}
|
||||
echo " </div>\n";
|
||||
echo " <div style='clear: both;'></div>\n";
|
||||
echo "</div>\n";
|
||||
echo "<b>".$text['header-domain_settings']."</b>";
|
||||
echo "<br><br>\n";
|
||||
|
||||
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
echo $text['header_description-domain_settings']."\n";
|
||||
echo "<br /><br />\n";
|
||||
|
||||
if (is_array($result) && @sizeof($result) != 0) {
|
||||
$previous_category = '';
|
||||
foreach($result as $row) {
|
||||
if ($previous_category != $row['domain_setting_category']) {
|
||||
$c = 0;
|
||||
echo "<tr>\n";
|
||||
echo " <td colspan='7' align='left' class='tr_link_void'>\n";
|
||||
if ($previous_category != '') {
|
||||
echo " <br /><br />\n";
|
||||
echo "<form id='form_list' method='post' action='".PROJECT_PATH."/core/domain_settings/domain_settings.php'>\n";
|
||||
echo "<input type='hidden' id='action' name='action' value=''>\n";
|
||||
echo "<input type='hidden' name='domain_uuid' value='".escape($domain_uuid)."'>\n";
|
||||
echo "<input type='hidden' name='domain_uuid_target' id='domain_uuid_target' value=''>\n";
|
||||
|
||||
echo "<table class='list'>\n";
|
||||
if (is_array($domain_settings) && @sizeof($domain_settings) != 0) {
|
||||
$x = 0;
|
||||
foreach ($domain_settings as $row) {
|
||||
$domain_setting_category = strtolower($row['domain_setting_category']);
|
||||
|
||||
$label_domain_setting_category = $row['domain_setting_category'];
|
||||
switch (strtolower($label_domain_setting_category)) {
|
||||
case "api" : $label_domain_setting_category = "API"; break;
|
||||
case "cdr" : $label_domain_setting_category = "CDR"; break;
|
||||
case "ldap" : $label_domain_setting_category = "LDAP"; break;
|
||||
case "ivr_menu" : $label_domain_setting_category = "IVR Menu"; break;
|
||||
default:
|
||||
$label_domain_setting_category = str_replace("_", " ", $label_domain_setting_category);
|
||||
$label_domain_setting_category = str_replace("-", " ", $label_domain_setting_category);
|
||||
$label_domain_setting_category = ucwords($label_domain_setting_category);
|
||||
}
|
||||
|
||||
if ($previous_domain_setting_category != $row['domain_setting_category']) {
|
||||
if ($previous_domain_setting_category != '') {
|
||||
echo "</table>\n";
|
||||
|
||||
echo "<br>\n";
|
||||
}
|
||||
echo "<b>";
|
||||
switch (strtolower($row['domain_setting_category'])) {
|
||||
case "api" : echo "API"; break;
|
||||
case "cdr" : echo "CDR"; break;
|
||||
case "ldap" : echo "LDAP"; break;
|
||||
case "ivr_menu" : echo "IVR Menu"; break;
|
||||
default: echo escape(ucwords(str_replace("_", " ", $row['domain_setting_category'])));
|
||||
echo "<b>".escape($label_domain_setting_category)."</b><br>\n";
|
||||
|
||||
echo "<table class='list'>\n";
|
||||
echo "<tr class='list-header'>\n";
|
||||
if (permission_exists('domain_setting_add') || permission_exists('domain_setting_edit') || permission_exists('domain_setting_delete')) {
|
||||
echo " <th class='checkbox'>\n";
|
||||
echo " <input type='checkbox' id='checkbox_all_".$domain_setting_category."' name='checkbox_all' onclick=\"list_all_toggle('".$domain_setting_category."');\">\n";
|
||||
echo " </th>\n";
|
||||
}
|
||||
echo "</b>\n";
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "<tr>\n";
|
||||
if ((permission_exists("domain_select")
|
||||
&& permission_exists("domain_setting_add")
|
||||
&& count($_SESSION['domains']) > 1) ||
|
||||
permission_exists('domain_setting_delete')) {
|
||||
echo "<th style='width: 30px; vertical-align: bottom; text-align: center; padding: 0px 3px 2px 8px;'><input type='checkbox' id='chk_all_".escape($row['domain_setting_category'])."' class='chk_all' onchange=\"(this.checked) ? check('all','".strtolower(escape($row['domain_setting_category']))."') : check('none','".strtolower(escape($row['domain_setting_category']))."');\"></th>";
|
||||
if ($_GET['show'] == 'all' && permission_exists('domain_setting_all')) {
|
||||
echo th_order_by('domain_name', $text['label-domain'], $order_by, $order);
|
||||
}
|
||||
echo "<th>".$text['label-subcategory']."</th>";
|
||||
echo "<th>".$text['label-type']."</th>";
|
||||
echo "<th>".$text['label-value']."</th>";
|
||||
echo "<th style='text-align: center;'>".$text['label-enabled']."</th>";
|
||||
echo "<th>".$text['label-description']."</th>";
|
||||
echo " <td class='tr_link_void' style='width: 1px;'>\n";
|
||||
if (permission_exists('domain_setting_add')) {
|
||||
echo "<a href='".PROJECT_PATH."/core/domain_settings/domain_setting_edit.php?domain_setting_category=".escape($row['domain_setting_category'])."&domain_uuid=".escape($_GET['id'])."' alt='".$text['button-add']."'>".$v_button_icon_add."</a>";
|
||||
echo th_order_by('domain_setting_subcategory', $text['label-subcategory'], $order_by, $order, null, "class='pct-35'");
|
||||
echo th_order_by('domain_setting_name', $text['label-name'], $order_by, $order, null, "class='pct-10 hide-sm-dn'");
|
||||
echo th_order_by('domain_setting_value', $text['label-value'], $order_by, $order, null, "class='pct-30'");
|
||||
echo th_order_by('domain_setting_enabled', $text['label-enabled'], $order_by, $order, null, "class='center'");
|
||||
echo " <th class='pct-25 hide-sm-dn'>".$text['label-description']."</th>\n";
|
||||
if (permission_exists('domain_setting_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
||||
echo " <td class='action-button'> </td>\n";
|
||||
}
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
$tr_link = (permission_exists('domain_setting_edit')) ? " href='".PROJECT_PATH."/core/domain_settings/domain_setting_edit.php?domain_uuid=".escape($row['domain_uuid'])."&id=".escape($row['domain_setting_uuid'])."'" : null;
|
||||
echo "<tr ".$tr_link.">\n";
|
||||
if ((permission_exists("domain_select") && permission_exists("domain_setting_add")
|
||||
&& count($_SESSION['domains']) > 1) ||
|
||||
permission_exists("domain_setting_delete")) {
|
||||
echo " <td valign='top' class='".$row_style[$c]." tr_link_void' style='text-align: center; padding: 3px 3px 0px 8px;'><input type='checkbox' name='id[]' id='checkbox_".escape($row['domain_setting_uuid'])."' value='".escape($row['domain_setting_uuid'])."' onclick=\"if (!this.checked) { document.getElementById('chk_all_".escape($row['domain_setting_category'])."').checked = false; }\"></td>\n";
|
||||
$subcat_ids[strtolower($row['domain_setting_category'])][] = 'checkbox_'.escape($row['domain_setting_uuid']);
|
||||
}
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>";
|
||||
if (permission_exists('domain_setting_edit')) {
|
||||
echo "<a href='".PROJECT_PATH."/core/domain_settings/domain_setting_edit.php?domain_uuid=".escape($row['domain_uuid'])."&id=".escape($row['domain_setting_uuid'])."'>".escape($row['domain_setting_subcategory'])."</a>";
|
||||
$list_row_url = PROJECT_PATH."/core/domain_settings/domain_setting_edit.php?domain_uuid=".escape($row['domain_uuid'])."&id=".escape($row['domain_setting_uuid']);
|
||||
}
|
||||
echo "<tr class='list-row' href='".$list_row_url."'>\n";
|
||||
if (permission_exists('domain_setting_add') || permission_exists('domain_setting_edit') || permission_exists('domain_setting_delete')) {
|
||||
echo " <td class='checkbox'>\n";
|
||||
echo " <input type='checkbox' name='domain_settings[$x][checked]' id='checkbox_".$x."' class='checkbox_".$domain_setting_category."' value='true' onclick=\"if (!this.checked) { document.getElementById('checkbox_all_".$domain_setting_category."').checked = false; }\">\n";
|
||||
echo " <input type='hidden' name='domain_settings[$x][uuid]' value='".escape($row['domain_setting_uuid'])."' />\n";
|
||||
echo " </td>\n";
|
||||
}
|
||||
echo " <td class='overflow no-wrap'>";
|
||||
if (permission_exists('domain_setting_edit')) {
|
||||
echo " <a href='".$list_row_url."'>".escape($row['domain_setting_subcategory'])."</a>";
|
||||
}
|
||||
else {
|
||||
echo $row['domain_setting_subcategory'];
|
||||
echo escape($row['domain_setting_subcategory']);
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['domain_setting_name'])." </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."' style='width: 30%; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;'>\n";
|
||||
|
||||
echo " <td class='hide-sm-dn'>".escape($row['domain_setting_name'])."</td>\n";
|
||||
echo " <td class='overflow no-wrap'>\n";
|
||||
$category = $row['domain_setting_category'];
|
||||
$subcategory = $row['domain_setting_subcategory'];
|
||||
$name = $row['domain_setting_name'];
|
||||
@@ -533,55 +572,33 @@
|
||||
echo " ".escape($row['domain_setting_value'])."\n";
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]." tr_link_void' style='text-align: center;'>\n";
|
||||
echo " <button type='submit' class='btn btn-link' name='action' value='toggle' onclick=\"document.getElementById('checkbox_".escape($row['domain_setting_uuid'])."').checked=true;\">".$text['label-'.escape($row['domain_setting_enabled'])]."</button>\n";
|
||||
echo " </td>\n";
|
||||
echo " <td valign='top' class='row_stylebg'>".escape($row['domain_setting_description'])." </td>\n";
|
||||
echo " <td class='tr_link_void'>";
|
||||
if (permission_exists('domain_setting_edit')) {
|
||||
echo "<a href='".PROJECT_PATH."/core/domain_settings/domain_setting_edit.php?domain_uuid=".escape($row['domain_uuid'])."&id=".escape($row['domain_setting_uuid'])."' alt='".$text['button-edit']."'>".$v_button_icon_edit."</a>";
|
||||
echo " <td class='no-link center'>\n";
|
||||
echo button::create(['type'=>'submit','class'=>'link','label'=>$text['label-'.$row['domain_setting_enabled']],'title'=>$text['button-toggle'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('toggle'); list_form_submit('form_list')"]);
|
||||
}
|
||||
else {
|
||||
echo " <td class='center'>\n";
|
||||
echo $text['label-'.$row['domain_setting_enabled']];
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " <td class='description overflow hide-sm-dn' title=\"".escape($row['domain_setting_description'])."\">".escape($row['domain_setting_description'])." </td>\n";
|
||||
if (permission_exists('domain_setting_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
||||
echo " <td class='action-button'>\n";
|
||||
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
|
||||
echo " </td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
$previous_category = $row['domain_setting_category'];
|
||||
$c = $c ? 0 : 1;
|
||||
|
||||
//set the previous category
|
||||
$previous_domain_setting_category = $row['domain_setting_category'];
|
||||
$x++;
|
||||
}
|
||||
unset($sql, $result, $row_count);
|
||||
unset($domain_settings);
|
||||
}
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "</table>";
|
||||
echo "</table>\n";
|
||||
echo "<br />\n";
|
||||
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
||||
echo "</form>\n";
|
||||
|
||||
echo "<div style='text-align: center; white-space: nowrap'>".$paging_controls."</div>";
|
||||
|
||||
echo "</form>";
|
||||
|
||||
echo "<br /><br />";
|
||||
|
||||
// check or uncheck all category checkboxes
|
||||
if (isset($subcat_ids) && sizeof($subcat_ids) > 0) {
|
||||
echo "<script>\n";
|
||||
echo " function check(what, category) {\n";
|
||||
foreach ($subcat_ids as $domain_setting_category => $checkbox_ids) {
|
||||
echo "if (category == '".$domain_setting_category."') {\n";
|
||||
foreach ($checkbox_ids as $index => $checkbox_id) {
|
||||
echo "document.getElementById('".$checkbox_id."').checked = (what == 'all') ? true : false;\n";
|
||||
}
|
||||
echo "}\n";
|
||||
}
|
||||
echo " }\n";
|
||||
echo "</script>\n";
|
||||
}
|
||||
|
||||
//handle form actions
|
||||
echo "<script type='text/javascript'>\n";
|
||||
echo " function set_action(action) {\n";
|
||||
echo " document.getElementById('action').value = action;\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " function submit_form(form_id) {\n";
|
||||
echo " document.getElementById(form_id).submit();\n";
|
||||
echo " }\n";
|
||||
echo "</script>\n";
|
||||
|
||||
?>
|
||||
?>
|
||||
Reference in New Issue
Block a user