Skip to content

Commit ecaa18f

Browse files
committed
Webapp: Added 'boolean' type support on app setup page
1 parent 3aca3f9 commit ecaa18f

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

web/css/styles.min.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1126,6 +1126,7 @@ form#vstobjects .alert {
11261126
.card {
11271127
float:left;
11281128
overflow: hidden;
1129+
background-color: #f5f5f5;
11291130
border:1px solid #e6e6e6;
11301131
box-sizing: border-box;
11311132
width:200px;
@@ -1146,7 +1147,6 @@ form#vstobjects .alert {
11461147

11471148
.card .card-details {
11481149
font-size: 0.8rem;
1149-
background-color: #f5f5f5;
11501150
padding: 0.5em 0.8em;
11511151
border-top: 1px solid #e6e6e6;
11521152
text-align: center;

web/templates/admin/setup_webapp.html

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
$f_name = $WebappInstaller->formNs() . '_' . $form_name;
4343
$f_type = $form_control;
4444
$f_value = '';
45-
$f_label = ucwords(str_replace('.', ' ', $form_name));
45+
$f_label = ucwords(str_replace(['.','_'], ' ', $form_name));
4646
if (is_array($form_control)) {
4747
$f_type = (!empty($form_control['type']))?$form_control['type']:'text';
4848
$f_value = (!empty($form_control['value']))?$form_control['value']:'';
@@ -51,25 +51,32 @@
5151
$f_value = htmlentities($f_value);
5252
$f_label = htmlentities($f_label);
5353
?>
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?>
5656
<?php if ($f_type === 'password'):?>
5757
/ <a href="javascript:randomString('<?=$f_name?>');" class="generate" ><?php print __('generate')?></a>
5858
<?php endif?>
5959
</label>
60-
<p>
60+
6161
<?php if (in_array($f_type, ['select']) && count($form_control['options']) ):?>
62+
<p style="margin-top:0;"></p>
6263
<select class="vst-list" name="<?=$f_name?>">
6364
<?foreach ($form_control['options'] as $option):?>
6465
<?php $selected = (!empty($form_control['value']) && $option === $form_control['value'])?'selected':''?>
6566
<option value="<?=$option?>" <?=$selected?> ><?=htmlentities($option)?></option>
6667
<?endforeach?>
6768
</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>
6875
<?php else:?>
76+
<p style="margin-top:0;"></p>
6977
<input type="text" size="20" class="vst-input" name="<?=$f_name?>" id="<?=$f_name?>" value="<?=$f_value?>">
78+
</p>
7079
<?php endif?>
71-
72-
</p>
7380
</div>
7481
<?php endforeach; ?>
7582

0 commit comments

Comments
 (0)