|
42 | 42 | $f_name = $WebappInstaller->formNs() . '_' . $form_name; |
43 | 43 | $f_type = $form_control; |
44 | 44 | $f_value = ''; |
45 | | - $f_label = ucwords(str_replace('.', ' ', $form_name)); |
| 45 | + $f_label = ucwords(str_replace(['.','_'], ' ', $form_name)); |
46 | 46 | if (is_array($form_control)) { |
47 | 47 | $f_type = (!empty($form_control['type']))?$form_control['type']:'text'; |
48 | 48 | $f_value = (!empty($form_control['value']))?$form_control['value']:''; |
|
51 | 51 | $f_value = htmlentities($f_value); |
52 | 52 | $f_label = htmlentities($f_label); |
53 | 53 | ?> |
54 | | - <div class="form-control"> |
55 | | - <label for="<?=$f_name?>"><?=$f_label?> |
| 54 | + <div class="form-group"> |
| 55 | + <label style="padding-bottom: 2px;" for="<?=$f_name?>"><?=$f_label?> |
56 | 56 | <?php if ($f_type === 'password'):?> |
57 | 57 | / <a href="javascript:randomString('<?=$f_name?>');" class="generate" ><?php print __('generate')?></a> |
58 | 58 | <?php endif?> |
59 | 59 | </label> |
60 | | - <p> |
| 60 | + |
61 | 61 | <?php if (in_array($f_type, ['select']) && count($form_control['options']) ):?> |
| 62 | + <p style="margin-top:0;"></p> |
62 | 63 | <select class="vst-list" name="<?=$f_name?>"> |
63 | 64 | <?foreach ($form_control['options'] as $option):?> |
64 | 65 | <?php $selected = (!empty($form_control['value']) && $option === $form_control['value'])?'selected':''?> |
65 | 66 | <option value="<?=$option?>" <?=$selected?> ><?=htmlentities($option)?></option> |
66 | 67 | <?endforeach?> |
67 | 68 | </select> |
| 69 | + </p> |
| 70 | + <?php elseif (in_array($f_type, ['boolean'])):?> |
| 71 | + <p> |
| 72 | + <?php $checked = (!empty($f_value))?'checked':''?> |
| 73 | + <input style="width:auto;" type="checkbox" class="vst-input" name="<?=$f_name?>" id="<?=$f_name?>" <?=$checked?> value="true"> |
| 74 | + </p> |
68 | 75 | <?php else:?> |
| 76 | + <p style="margin-top:0;"></p> |
69 | 77 | <input type="text" size="20" class="vst-input" name="<?=$f_name?>" id="<?=$f_name?>" value="<?=$f_value?>"> |
| 78 | + </p> |
70 | 79 | <?php endif?> |
71 | | - |
72 | | - </p> |
73 | 80 | </div> |
74 | 81 | <?php endforeach; ?> |
75 | 82 |
|
|
0 commit comments