';
$html = $html.getString ($set['Code_Name'].'_description', $set['Description']);
$html = $html.
'
';
// render different input types based on the settings type
$input = "";
// text - textbox
if($set['Type'] == 'text' )
{
$input = '
';
}
// password - hidden text
elseif ($set['Type'] == 'password')
{
$input = '
';
}
// readonly
elseif ($set['Type'] == 'readonly')
{
$input = '
';
}
// boolean - checkbox
elseif ($set['Type'] == 'boolean')
{
$checked = "";
if ($set['Value'] == "True") { $checked = "checked";};
$input = '
';
}
// integer - number input
elseif ($set['Type'] == 'integer')
{
$input = '
';
}
// selecttext - dropdown
elseif ($set['Type'] == 'selecttext')
{
$input = '
';
$values = createArray($set['Value']);
$options = createArray($set['Options']);
foreach ($options as $option) {
$selected = "";
if( in_array( $option , $values) == true) {
$selected = "selected";
}
$input = $input.''.$option.' ';
}
$input = $input.' ';
}
// selectinteger - dropdown
elseif ($set['Type'] == 'selectinteger')
{
$input = '
';
$values = createArray($set['Value']);
$options = createArray($set['Options']);
foreach ($options as $option) {
$selected = "";
if( in_array( $option , $values) == true) {
$selected = "selected";
}
$input = $input.''.$option.' ';
}
$input = $input.' ';
}
// multiselect
elseif ($set['Type'] == 'multiselect')
{
$input = '
';
$values = createArray($set['Value']);
$options = createArray($set['Options']);
foreach ($options as $option) {
$selected = "";
if( in_array( $option , $values) == true) {
$selected = "selected";
}
$input = $input.''.$option.' ';
}
$input = $input.' ';
}
// subnets
elseif ($set['Type'] == 'subnets')
{
$input = $input.
'
';
// list all interfaces as options
$input = $input.'
';
$options = createArray($set['Value']);
foreach ($options as $option) {
$input = $input.''.$option.' ';
}
$input = $input.'
';
// Remove all interfaces button
$input = $input.'
Remove all
';
}
// list
elseif ($set['Type'] == 'list')
{
$settingKeyOfLists[] = $set['Code_Name'];
$input = $input.
'
';
// list all interfaces as options
$input = $input.'
';
$options = createArray($set['Value']);
foreach ($options as $option) {
$input = $input.''.$option.' ';
}
$input = $input.'
';
// Remove all interfaces button
$input = $input.'
Remove last
';
}
$html = $html.$input;
// render any buttons or additional actions if specified
$eventsHtml = "";
// if available get all the events associated with this setting
$eventsList = createArray($set['Events']);
// icon map for the events
// $iconMap = [
// "test" => [lang("settings_event_tooltip"),""]
// ];
if(count($eventsList) > 0)
{
foreach ($eventsList as $event) {
$eventsHtml = $eventsHtml.'
';
}
}
$html = $html.$eventsHtml.'