mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Added settings validations. (#8037)
This commit is contained in:
@@ -1263,7 +1263,8 @@ function generate_dynamic_config_panel($title, $config_groups, $items = array(),
|
||||
if ($item['type'] == 'checkbox') {
|
||||
$output .= '<input id="' . $item['name'] . '" type="checkbox" name="global-config-check" ' . $config_groups[$item['name']]['config_checked'] . ' data-on-text="Yes" data-off-text="No" data-size="small" data-config_id="' . $config_groups[$item['name']]['config_id'] . '">';
|
||||
} elseif ($item['type'] == 'text') {
|
||||
$pattern = isset($item['pattern']) ? ' required pattern="' . $item['pattern'] . '"' : "";
|
||||
$pattern = isset($item['pattern']) ? ' pattern="' . $item['pattern'] . '"' : "";
|
||||
$pattern .= isset($item['required']) && $item['required'] ? " required" : "";
|
||||
$output .= '
|
||||
<input id="' . $item['name'] . '" class="form-control validation" type="text" name="global-config-input" value="' . $config_groups[$item['name']]['config_value'] . '" data-config_id="' . $config_groups[$item['name']]['config_id'] . '"' . $pattern . '>
|
||||
<span class="form-control-feedback"><i class="fa" aria-hidden="true"></i></span>
|
||||
|
Reference in New Issue
Block a user