From b7766fcf64879caabb55dcc2360da11582c994f9 Mon Sep 17 00:00:00 2001 From: steve-lad <72376554+steve-lad@users.noreply.github.com> Date: Tue, 29 Jun 2021 16:41:53 +0200 Subject: [PATCH] First test of new interface to manage defaults hierarchy WIP Need to better manage display of system defaults when customising Need to override XML defaults --- Sccp_manager.class.php | 36 +- assets/js/sccp_manager.js | 21 + conf/sccpgeneral.xml.v433 | 3 +- sccpManTraits/helperFunctions.php | 5 +- views/formShowSysDefs.php | 1027 +++++++++++++++++++++++++++++ views/siteDefaults.php | 83 --- 6 files changed, 1075 insertions(+), 100 deletions(-) create mode 100644 views/formShowSysDefs.php delete mode 100644 views/siteDefaults.php diff --git a/Sccp_manager.class.php b/Sccp_manager.class.php index f7156a0..e3682ac 100644 --- a/Sccp_manager.class.php +++ b/Sccp_manager.class.php @@ -158,15 +158,27 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { if ((array) $this->xml_data) { foreach ($this->xml_data->xpath('//page_group[@name="' . $group_name . '"]') as $item) { - $htmlret = load_view(__DIR__ . '/views/formShow.php', array( - 'itm' => $item, - 'h_show' => $show_Header, - 'form_prefix' => $form_prefix, - 'fvalues' => $form_values, - 'tftp_lang' => $this->tftpLang, - 'metainfo' => $this->sccp_metainfo - ) - ); + // TODO: Clean up below after debug + if ($group_name == 'sccp_general') { + $htmlret = load_view(__DIR__ . '/views/formShowSysDefs.php', array( + 'itm' => $item, + 'h_show' => $show_Header, + 'form_prefix' => $form_prefix, + 'fvalues' => $form_values, + 'tftp_lang' => $this->tftpLang, + 'metainfo' => $this->sccp_metainfo + )); + } else { + $htmlret = load_view(__DIR__ . '/views/formShow.php', array( + 'itm' => $item, + 'h_show' => $show_Header, + 'form_prefix' => $form_prefix, + 'fvalues' => $form_values, + 'tftp_lang' => $this->tftpLang, + 'metainfo' => $this->sccp_metainfo + ) + ); + } } } else { $htmlret = load_view(__DIR__ . '/views/formShowError.php'); @@ -198,12 +210,8 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { $action = !empty($request['action']) ? $request['action'] : ''; $this->pagedata = array( - "siteConfig" => array( - 'name' => _('Site Default Values'), - 'page' => 'views/siteDefaults.php' - ), "general" => array( - "name" => _("General SCCP Settings"), + "name" => _("Site Default Settings"), "page" => 'views/server.setting.php' ), "sccpdevice" => array( diff --git a/assets/js/sccp_manager.js b/assets/js/sccp_manager.js index d2d3aa1..30d2b3c 100644 --- a/assets/js/sccp_manager.js +++ b/assets/js/sccp_manager.js @@ -1055,3 +1055,24 @@ function sleep(milliseconds) } } } + +$(".custom").click(function() { + $(this).parents(".element-container").removeClass("has-error"); + var id = $(this).data("for"), input = $("#" + id); + var edit_style = document.getElementById("edit_" + id).style; + console.log(id); + if (input.length === 0) { + return; + } + if ($(this).is(":checked")) { + edit_style.display = 'block'; + input.prop("readonly", false); + input.val(input.data("custom")); + input.focus(); + } else { + edit_style.display = 'none'; + input.data("custom", input.val()); + input.prop("readonly", true); + input.val(input.data("default")); + } +}); diff --git a/conf/sccpgeneral.xml.v433 b/conf/sccpgeneral.xml.v433 index 2c871f5..e9214aa 100644 --- a/conf/sccpgeneral.xml.v433 +++ b/conf/sccpgeneral.xml.v433 @@ -70,12 +70,11 @@ and open the template in the editor. Base Version before all crash :-) - servername - Vt + Asterisk XML Servername: This is the type of server - usually, it will be Asterisk. diff --git a/sccpManTraits/helperFunctions.php b/sccpManTraits/helperFunctions.php index 8e03a60..530c226 100644 --- a/sccpManTraits/helperFunctions.php +++ b/sccpManTraits/helperFunctions.php @@ -72,8 +72,11 @@ trait helperfunctions { private function getTableDefaults($table, $trim_underscore = true) { $def_val = array(); // TODO: This is ugly and overkill - needs to be cleaned up in dbinterface + if ($table == 'sccpsettings') { + // sccpsettings has a different structure and already have values in $sccpvalues + return $this->sccpvalues; + } $sccpTableDesc = $this->dbinterface->getSccpDeviceTableData("get_columns_{$table}"); - foreach ($sccpTableDesc as $data) { $key = (string) $data['Field']; // function has 2 roles: return actual table keys (trim_underscore = false) diff --git a/views/formShowSysDefs.php b/views/formShowSysDefs.php new file mode 100644 index 0000000..044a3de --- /dev/null +++ b/views/formShowSysDefs.php @@ -0,0 +1,1027 @@ + 'GMT -12', '-11' => 'GMT -11', '-10' => 'GMT -10', '-09' => 'GMT -9', + '-08' => 'GMT -8', '-07' => 'GMT -7', '-06' => 'GMT -6', '-05' => 'GMT -5', + '-04' => 'GMT -4', '-03' => 'GMT -3', '-02' => 'GMT -2', '-01' => 'GMT -1', + '00' => 'GMT', '01' => 'GMT +1', '02' => 'GMT +2', '03' => 'GMT +3', + '04' => 'GMT +4', '05' => 'GMT +5', '06' => 'GMT +6', '07' => 'GMT +7', + '08' => 'GMT +8', '09' => 'GMT +9', '10' => 'GMT +10', '11'=> 'GMT +11', '12' => 'GMT +12'); + +$extension_list = array(); +$sofkey_list = array(); +$model_list = array(); +$device_list = array(); +$dialplan_list = array(); + +if (\FreePBX::Modules()->checkStatus("soundlang")) { + $syslangs = \FreePBX::Soundlang()->getLanguages(); + if (!is_array($syslangs)) { + $syslangs = array(); + } +} +if (function_exists('music_list')) { + $moh_list = music_list(); +// $cur = (isset($mohsilence) && $mohsilence != "" ? $mohsilence : 'default'); +} +if (!is_array($moh_list)) { + $moh_list = array('default'); +} + +$items = $itm -> children(); + +if ($h_show==1) { + $sec_class =''; + if (!empty($items ->class)) { + $sec_class = (string)$items ->class; + } + ?> + +
+

label) ?>

+
+
+ + help)) { + $child->help = 'Help is not available.'; + $child->meta_help = '1'; + } +// $child->meta_help = '1'; // Remove comments to see original help ! + + if ($child['type'] == 'IE') { + $res_input = ''; + $res_name = ''; + $usingSysDefaults = true; + $res_oid = (string)$child->input[0]->name; + $res_id = $npref.$res_oid; + if (!empty($metainfo[$res_oid])) { + if ($child->meta_help == '1' || $child->help == 'Help!') { + $child->help = $metainfo[$res_oid]['Description']; + } + } + + // --- Add Hidden option + $res_sec_class =''; + if (!empty($child ->class)) { + $res_sec_class = (string)$child ->class; + } + + if (empty($child->nameseparator)) { + $child->nameseparator = ' / '; + } + $i = 0; + + echo ''; + + foreach ($child->xpath('input') as $value) { + $res_n = (string)$value->name; + $res_name = $npref . $res_n; + if (empty($res_id)) { + $res_id = $res_name; + } + if (!empty($fvalues[$res_n])) { + if (!empty($fvalues[$res_n]['data'])) { + // TODO: Need to store sysvalues in a separate array + if (!empty($fvalues[$res_n]['systemdefault']) && ($fvalues[$res_n]['systemdefault'] != $fvalues[$res_n]['data'])) { + $usingSysDefaults = false; + } + $value->value = $fvalues[$res_n]['data']; + } + } + if (empty($value->value)) { + $value->value = $value->default; + } + if (empty($value->type)) { + $value->type = 'text'; + } + if (empty($value->class)) { + $value->class = 'form-control'; + } + $item = array('id' => $res_id, 'setting' => $child->label, 'feature' => $res_id, 'iscustom' => 'checked'); + $i ++; + } + ?> +
+
+
+
+ + +
+
+ value; ?> +
+
+ + > + + +
+
+
+ +
+
+ help);?> +
+
+
+ + label.' -->'; + } + if ($child['type'] == 'IED') { + $res_input = ''; + $res_name = ''; + $res_value = ''; + $opt_at = array(); + $res_n = (string)$child->name; + + if (!empty($metainfo[$res_n])) { + if ($child->meta_help == '1' || $child->help == 'Help!') { + $child->help = $metainfo[$res_n]['Description']; + } + } +// $res_value + $lnhtm = ''; + $res_id = $napref.$child->name; + $i = 0; + $max_row = 255; + if (!empty($child->max_row)) { + $max_row = $child->max_row; + } + + if (!empty($fvalues[$res_n])) { + if (!empty($fvalues[$res_n]['data'])) { + $res_value = explode(';', $fvalues[$res_n]['data']); + } + } + if (empty($res_value)) { + $res_value = array((string) $child->default); +// $res_value = explode('/', (string) $child->default); + } + + echo ''; + ?> +
+
+
+
+
+
+ + +
+ +
+ cbutton)) { + echo '
'; + foreach ($child->xpath('cbutton') as $value) { + $res_n = $res_id.'[0]['.$value['field'].']'; + $res_vf = ''; + if ($value['value']=='NONE' && empty($res_value)) { + $res_vf = 'active'; + } + $ch_key = array_search($value['value'], $res_value); + if ($ch_key !== false) { + unset($res_value[$ch_key]); + $res_vf = 'active'; + $res_value = explode(';', implode(';', $res_value)); + } + $opt_hide =''; + $opt_class="button-checkbox"; + if (!empty($value->option_hide)) { + $opt_class .= " sccp_button_hide"; + $opt_hide = ' data-vhide="'.$value->option_hide.'" data-btn="checkbox" data-clhide="'.$value->option_hide['class'].'" '; + } + if (!empty($child->option_show)) { + if (empty($opt_hide)) { + $opt_hide =' class="sccp_button_hide" '; + } + $opt_hide .= ' data-vshow="'.$child->option_show.'" data-clshow="'.$child->option_show['class'].'" '; + } + + if (!empty($value->option_disabled)) { + $opt_class .= " sccp_button_disabled"; + $opt_hide = ' data-vhide="'.$value->option_disabled.'" data-btn="checkbox" data-clhide="'.$value->option_disabled['class'].'" '; + } + + if (!empty($value->class)) { + $opt_class .= " ".(string)$value->class; + } + + echo ''; + } + echo '
'; + } + $opt_class = "col-sm-7 ".$res_id."-gr"; + if (!empty($child->class)) { + $opt_class .= " ".(string)$child->class; + } + echo '
'; + + foreach ($res_value as $dat_v) { + ?> +
> + xpath('input') as $value) { + $res_n = $res_id.'['.$i.']['.$value['field'].']'; + $fields_id = (string)$value['field']; + $opt_at[$fields_id]['nameseparator']=(string)$value['nameseparator']; + if (!empty($value->class)) { + $opt_at[$fields_id]['class']='form-control ' .(string)$value->class; + } + $opt_at[$fields_id]['nameseparator']=(string)$value['nameseparator']; + + echo 'options)) { + foreach ($value->options ->attributes() as $optkey => $optval) { + $opt_at[$fields_id]['options'][$optkey]=(string)$optval; + echo ' '.$optkey.'="'.$optval.'"'; + } + } + echo '> '.(string)$value['nameseparator'].' '; + $i2 ++; + } + if (!empty($child->add_pluss)) { + echo ''; + } + echo '
'; + $i++; + } + ?> + +
+ addbutton)) { + echo '
'; + echo ''; + echo '
'; + } + ?> +
+
+
+
+
+
+ help);?> +
+
+ label.' -->'; + } + + if ($child['type'] == 'IS') { + $res_n = (string)$child->name; + $res_id = $npref.$res_n; + $res_ext = str_replace($npref,'',$res_n); + if (!empty($metainfo[$res_n])) { + if ($child->meta_help == '1' || $child->help == 'Help!') { + $child->help = $metainfo[$res_n]['Description']; + } + } + + // --- Add Hiden option + $res_sec_class =''; + if (!empty($child ->class)) { + $res_sec_class = (string)$child ->class; + } + + echo ''; + ?> +
+
+
+ + +
+
+ default)) { + $res_v = (string)$child->default; + } + if (!empty($child->value)) { + $res_v = (string)$child->value; + } + if (!empty($fvalues[$res_n])) { + if (($fvalues[$res_n]['data'] != '') ) { + $res_v = (string)$fvalues[$res_n]['data']; + } + } + if (!empty($child->option_hide)) { + $opt_hide = ' class="sccp_button_hide" data-vhide="'.$child->option_hide.'" data-clhide="'.$child->option_hide['class'].'" '; + } + if (!empty($child->option_show)) { + if (empty($opt_hide)) { + $opt_hide =' class="sccp_button_hide" '; + } + $opt_hide .= ' data-vshow="'.$child->option_show.'" data-clshow="'.$child->option_show['class'].'" '; + } + foreach ($child->xpath('button') as $value) { + $val_check = strtolower((string)$value[@value]); + if ($val_check == strtolower($res_v)) { + $val_check = " checked"; + } else { + if ($val_check == '' || $val_check == 'none' ) { + if (strtolower($res_v) == 'none' || $res_v == '' ) { + $val_check = " checked"; + } else {$val_check = "";} + } else {$val_check = "";} + } + echo ''; + echo ''; + $i++; + } + ?> +
+
+
+ help);?> +
+
+ + label.' -->'; + } + +/* + * Input element Select SLD - Date format + * SLZ - Time Zone + * + * SLM - Music on hold + * SLK - System KeySet + * SLP - Dial Paterns + */ + + if ($child['type'] == 'SLD' || $child['type'] == 'SLM'|| $child['type'] == 'SLK'|| $child['type'] == 'SLP') { +// $value = $child -> select; + $res_n = (string)$child ->name; + $res_id = $npref.$res_n; + if (!empty($metainfo[$res_n])) { + if ($child->meta_help == '1' || $child->help == 'Help!') { + $child->help = $metainfo[$res_n]['Description']; + } + } + + if (empty($child->class)) { + $child->class = 'form-control'; + } + + if ($child['type'] == 'SLD') { + $select_opt= $day_format; + } + + if ($child['type'] == 'SLM') { + $select_opt= $moh_list; + } + if ($child['type'] == 'SLK') { + if (empty($sofkey_list)) { + $sofkey_list = \FreePBX::Sccp_manager()->aminterface->sccp_list_keysets(); + } + $select_opt= $sofkey_list; + } + if ($child['type'] == 'SLP') { + if (empty($dialplan_list)) { + foreach (\FreePBX::Sccp_manager()->getDialPlanList() as $tmpkey) { + $tmp_id = $tmpkey['id']; + $dialplan_list[$tmp_id] = $tmp_id; + } + } + $select_opt= $dialplan_list; + } +// if ($child['type'] == 'SLZ') { +// $select_opt= $timeZoneOffsetList; +// } + + echo ''; + + ?> +
+
+ +
+ + +
+
class . '" id="' . $res_id . '">'; + if (!empty($fvalues[$res_n])) { + if (!empty($fvalues[$res_n]['data'])) { + $child->value = $fvalues[$res_n]['data']; + } + } + foreach ($select_opt as $key) { + echo ''; + } + ?> +
+
+
+ help);?> +
+
+ label.' -->'; + } +/* + * Input element Select SLS - System Language + */ + + if ($child['type'] == 'SLS' || $child['type'] == 'SLT' || $child['type'] == 'SLA' || $child['type'] == 'SLZ') { +// $value = $child -> select; + $res_n = (string)$child ->name; + $res_id = $npref.$res_n; + $child->value =''; + + if (!empty($metainfo[$res_n])) { + if ($child->meta_help == '1' || $child->help == 'Help!') { + $child->help = $metainfo[$res_n]['Description']; + } + } + + if ($child['type'] == 'SLS') { + $select_opt= $syslangs; + } + if ($child['type'] == 'SLT') { + $select_opt= $tftp_lang; + } + if ($child['type'] == 'SLZ') { + $select_opt= $timeZoneOffsetList; +// $child->value = ($system_time_zone[offset]/60); + } + + if ($child['type'] == 'SLA') { + $select_opt =''; + if (!empty($fvalues[$res_n])) { + if (!empty($fvalues[$res_n]['data'])) { + $res_value = explode(';', $fvalues[$res_n]['data']); + } + if (empty($res_value)) { + $res_value = array((string) $child->default); + } + foreach ($res_value as $key) { + $select_opt[$key]= $key; + } + } + } + + if (empty($child->class)) { + $child->class = 'form-control'; + } + + if (!empty($fvalues[$res_n])) { + if (!empty($fvalues[$res_n]['data'])) { + $child->value = $fvalues[$res_n]['data']; + } + } + + if (empty($child->value)) { + if (!empty($child->default)) { + $child->value = $child->default; + } + } + + echo ''; + ?> +
+
+ +
+ + +
+
class . '" id="' . $res_id . '">'; + foreach ($select_opt as $key => $val) { + if (is_array($val)) { + $opt_key = (isset($val['id'])) ? $val['id'] : $key; + $opt_val = (isset($val['val'])) ? $val['val'] : $val; + } else { + $opt_key = $key; + $opt_val = $val; + } + echo ''; + } + ?> +
+
+
+ help);?> +
+
+ + label.' -->'; + } +/* + * Input element Select + */ + + if ($child['type'] == 'SL') { + $res_n = (string)$child->name; + $res_id = $npref.$child->name; + + if (!empty($metainfo[$res_n])) { + if ($child->meta_help == '1' || $child->help == 'Help!') { + $child->help = $metainfo[$res_n]['Description']; + } + } + + if (empty($child ->class)) { + $child->class = 'form-control'; + } + echo ''; + + ?> +
+
+ +
+ + +
+
class . '" id="' . $res_id . '">'; + if (!empty($fvalues[$res_n])) { + if (!empty($fvalues[$res_n]['data'])) { + $child->value = $fvalues[$res_n]['data']; + } + } + foreach ($child->xpath('select') as $value) { + if (!empty($value[@value])) { + $key = $value[@value]; + } else { + $key = (string)$value; + } + echo ''; + } + ?> + +
+
+
+ help);?> +
+
+ label.' -->'; + } + + /* + * Input element Select SDM - Model List + * SDMS - Sip model List + * SDE - Extension List + */ + + if ($child['type'] == 'SDM' || $child['type'] == 'SDMS' || $child['type'] == 'SDE' || $child['type'] == 'SDD') { +// $value = $child -> select; + $res_n = (string)$child ->name; + $res_id = $npref.$res_n; + + if (!empty($metainfo[$res_n])) { + if ($child->meta_help == '1' || $child->help == 'Help!') { + $child->help = $metainfo[$res_n]['Description']; + } + } + + if (empty($child->class)) { + $child->class = 'form-control'; + } + if ($child['type'] == 'SDM') { + if (empty($model_list)) { + $model_list = \FreePBX::Sccp_manager()->dbinterface->getSccpDeviceTableData("HWDevice"); + } + $select_opt= $model_list; + } + if ($child['type'] == 'SDMS') { + if (empty($model_list)) { + $model_list = \FreePBX::Sccp_manager()->dbinterface->getSccpDeviceTableData("HWSipDevice"); + } + $select_opt= $model_list; + } + if ($child['type'] == 'SDE') { + if (empty($extension_list)) { + $extension_list = \FreePBX::Sccp_manager()->dbinterface->getSccpDeviceTableData("HWextension"); + $extension_list[]=array( 'model' => 'NONE', 'vendor' => 'CISCO', 'dns' => '0'); + foreach ($extension_list as &$data) { + $d_name = explode(';', $data['model']); + if (is_array($d_name) && (count($d_name) > 1)) { + $data['description'] = count($d_name).'x '.$d_name[0]; + } else { + $data['description'] = $data['model']; + } + } + unset($data); + } + $select_opt= $extension_list; + } + if ($child['type'] == 'SDD') { + if (empty($device_list)) { + $device_list = \FreePBX::Sccp_manager()->dbinterface->getSccpDeviceTableData("SccpDevice"); + $device_list[]=array('name' => 'NONE', 'description' => 'No Device'); + } + $select_opt = $device_list; + } + + echo ''; + + ?> +
+
+ +
+ + +
+
class . '" id="' . $res_id . '"'; + if (isset($child->options)) { + foreach ($child->options->attributes() as $optkey => $optval) { + echo ' '.$optkey.'="'.$optval.'"'; + } + } + echo '>'; + + $fld = (string)$child->select['name']; + $flv = (string)$child->select; + $flv2 = (string)$child->select['addlabel']; + $flk = (string)$child->select['dataid']; + $flkv = (string)$child->select['dataval']; + $key = (string)$child->default; + if (!empty($fvalues[$res_n])) { + if (!empty($fvalues[$res_n]['data'])) { + $child->value = $fvalues[$res_n]['data']; + $key = $fvalues[$res_n]['data']; + } + } + + foreach ($select_opt as $data) { + echo ''; + } + + ?> +
+
+
+ help);?> +
+
+ label.' -->'; + } + if ($child['type'] == 'ITED') { + $res_input = ''; + $res_name = ''; + $res_na = (string)$child->name; + +// $res_value + $lnhtm = ''; + $res_id = $napref.$child->name; + $i = 0; + + if (!empty($fvalues[$res_na])) { + if (!empty($fvalues[$res_na]['data'])) { + $res_value = explode(';', $fvalues[$res_na]['data']); + } + } + if (empty($res_value)) { + $res_value = array((string) $child->default); +// $res_value = explode('/', (string) $child->default); + } + + echo ''; + ?> + + + '; + if (!empty($child->label)) { + echo ''; + } + + $res_vf = explode('/', $dat_v); + $i2 = 0; + + foreach ($child->xpath('element') as $value) { + $fields_id = (string)strtolower($value['field']); + $res_n = $res_id.'['.$i.']['.$fields_id.']'; + $res_ni = $res_id.'_'.$i.'_'.$fields_id; + + $opt_at[$fields_id]['display_prefix']=(string)$value['display_prefix']; + $opt_at[$fields_id]['display_sufix']=(string)$value['display_sufix']; + + if (empty($value->options->class)) { + $opt_at[$fields_id]['options']['class']='form-control'; + } + $opt_at[$fields_id]['type']=(string)$value['type']; + $res_opt['addon'] =''; + if (isset($value->options)) { + foreach ($value->options ->attributes() as $optkey => $optval) { + $opt_at[$fields_id]['options'][$optkey]=(string)$optval; + $res_opt['addon'] .=' '.$optkey.'="'.$optval.'"'; + } + } + + echo ''; + $i2 ++; + } + echo ''; + $i++; + } + echo '
'.$child->label.'
'; + $res_opt['inp_st'] = '
'.$opt_at[$fields_id]['display_prefix'].''; + $res_opt['inp_end'] = ''.$opt_at[$fields_id]['display_sufix'].'
'; + switch ($value['type']) { + case 'date': + echo $res_opt['inp_st'].''.$res_opt['inp_end']; + break; + case 'number': + echo $res_opt['inp_st'].''.$res_opt['inp_end']; + break; + case 'input': + echo $res_opt['inp_st'].''.$res_opt['inp_end']; + break; + case 'title': + if ($i > 0) { + break; + } + case 'label': + $opt_at[$fields_id]['data'] = (string)$value; + echo ''; + break; + case 'select': + echo $res_opt['inp_st'].''.$res_opt['inp_end']; + break; + } + echo '
'; + if ($i > 0) { + echo ''; + } + + echo '
'; + echo ''; + } + + if ($child['type'] == 'HLP') { + $res_n = (string)$child ->name; + $res_id = $npref.$res_n; + if (empty($child->class)) { + $child->class = 'form-control'; + } + echo ''; + + ?> + +
+
+

label);?> +

+
+
+ xpath('element') as $value) { + switch ($value['type']) { + case 'p': + case 'h1': + case 'h2': + case 'h3': + case 'h4': + echo '<'.$value['type'].'>'._((string)$value).''; + break; + case 'table': + echo '<'.$value['type'].' class="table" >'; + foreach ($value->xpath('row') as $trow) { + echo ''; + foreach ($trow->xpath('col') as $tcol) { + echo ''._((string)$tcol).''; + } + echo ''; + } + echo ''; + break; + } + } + ?> + +
+
+ label.' -->'; + } + if ($child['type'] == 'MINFO') { + $res_n = (string)$child ->name; + $res_id = $npref.$res_n; + if (empty($child->class)) { + $child->class = 'form-control'; + } + echo ''; + ?> + + label.' -->'; + } +/* + * Input element Select SLTZN - System Time Zone + */ + + if ($child['type'] == 'SLTZN') { +// $value = $child -> select; + $res_n = (string)$child ->name; + $res_id = $npref.$res_n; + $child->value =''; + + if (!empty($metainfo[$res_n])) { + if ($child->meta_help == '1' || $child->help == 'Help!') { + $child->help = $metainfo[$res_n]['Description']; + } + } + + if (empty($child->class)) { + $child->class = 'form-control'; + } + + if (!empty($fvalues[$res_n])) { + if (!empty($fvalues[$res_n]['data'])) { + $child->value = $fvalues[$res_n]['data']; + } + } + + $child->value = \date_default_timezone_get(); + + echo ''; + ?> +
+
+
+
+ + +
+
value; + ?> +
+
+
+
+ help);?> +
+
+ + label.' -->'; + } +} +?> +'; +} +?> diff --git a/views/siteDefaults.php b/views/siteDefaults.php deleted file mode 100644 index ba24177..0000000 --- a/views/siteDefaults.php +++ /dev/null @@ -1,83 +0,0 @@ - - array('title' => 'First Block of Defaults', - 'items' => array('item1' => array('code' => 'This is the value to edit', 'title' => 'variable1')))); -?> - -
-
-
-
-
- -
-
-

-
- If they are changed, they will not be updated by future changes in chan-sccp "?> -
- - - $data) { ?> -
-

-
-
- - -
-
-
-
- - - - -
-
- required pattern="[0-9A-D\*#]*"> -
-
- - > - - - - > - - -
-
-
-
-
- -
-
-
- -
-
- - -
-
-
-
-
-
-