';
$isIn = ' '; // open the first panel only by default on page load
// populate settings for each group
foreach ($settings as $set)
{
if($set["Group"] == $group)
{
$html = $html.
'
';
$html = $html.getString ($set['Code_Name'].'_name', $set['Display_Name']).' ';
$html = $html.'
'.$set['Code_Name'].'
';
$html = $html.
'
';
$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
';
}
$html = $html.$input;
// render any buttons or additional actions if specified
$eventsHtml = "";
// displayMessage($set['Events'], FALSE, TRUE, TRUE, TRUE);
$eventsList = createArray($set['Events']);
$iconMap = [
"test" => ["To test this configuration you have to save it at first.","fa-vial-circle-check"]
];
if(count($eventsList) > 0)
{
foreach ($eventsList as $event) {
$eventsHtml = $eventsHtml.'
';
}
}
$html = $html.$eventsHtml.'
';
}
}
$html = $html.'