Added settings validations. (#8037)

This commit is contained in:
Zmegolaz
2018-01-17 05:21:21 +01:00
committed by Tony Murray
parent d4bd566d36
commit 3740467858
4 changed files with 70 additions and 56 deletions

View File

@@ -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>