Added type hidden

This commit is contained in:
Jeroen De Meerleer 2018-09-14 10:29:27 +02:00
parent 2106a11c36
commit 56038e48ac
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
1 changed files with 13 additions and 10 deletions

View File

@ -48,7 +48,8 @@ function load_config_categorized() {
$configCategorized[$value['category']][$count]['label'] = $value['label'];
$configCategorized[$value['category']][$count]['description'] = $value['description'];
$configCategorized[$value['category']][$count]['type'] = parse_config_type($value['type']);
$count++;
if ($configCategorized[$value['category']][$count]['type']['type'] != 'hidden') $count++;
}
// into a easy twig array
@ -74,18 +75,20 @@ function get_configvalue($conf) {
}
function parse_config_type($type) {
$splittype = explode('(', substr($type, 0, -1));
$splittype = explode('(', explode(')', $type)[0]);
$r_var['type'] = $splittype[0];
$splitargs = explode(',', $splittype[1]);
if (isset($splittype[1])) {
$splitargs = explode(',', $splittype[1]);
switch($r_var['type'])
{
case 'number':
$r_var['args'][] = $splitargs[0] != '-1' ? 'min="' . $splitargs[0] . '"' : '';
$r_var['args'][] = $splitargs[1] != '-1' ? 'max="' . $splitargs[1] . '"' : '';
break;
}
switch($r_var['type'])
{
case 'number':
$r_var['args'][] = isset($splitargs[0]) ? 'min="' . $splitargs[0] . '"' : '';
$r_var['args'][] = isset($splitargs[1]) ? 'max="' . $splitargs[1] . '"' : '';
break;
}
}
return $r_var;
}