forked from hestiacp/hestiacp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_webapp.html
More file actions
97 lines (88 loc) · 4.99 KB
/
setup_webapp.html
File metadata and controls
97 lines (88 loc) · 4.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<div class="l-center edit">
<div class="l-sort clearfix">
<div class="l-unit-toolbar__buttonstrip">
<a class="ui-button cancel" dir="ltr" id="btn-back" href="/add/webapp/?domain=<?=$v_domain?>"><i class="fas fa-arrow-left status-icon blue"></i><?=_('Back')?></a>
</div>
<div class="l-unit-toolbar__buttonstrip float-right">
<?php
if (!empty($_SESSION['error_msg'])) {
echo "<span class=\"vst-error\"> → ".htmlentities($_SESSION['error_msg'])."</span>";
} else {
if (!empty($_SESSION['ok_msg'])) {
echo "<span class=\"vst-ok\"> → ".$_SESSION['ok_msg']."</span>";
}
}
?>
<a href="#" class="ui-button" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i> <?=_('Install')?></a>
</div>
</div>
</div>
<div class="l-separator"></div>
<div class="l-center animated fadeIn" style="padding-top:240px;">
<?php
$back = $_SESSION['back'];
if (empty($back)) {
$back = "location.href='/list/web/'";
} else {
$back = "location.href='".$back."'";
}
?>
<?php if( !empty($WebappInstaller->getOptions())): ?>
<form id="vstobjects" method="POST" name="v_setup_webapp" style="padding-top:0px;" >
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="hidden" name="ok" value="true" />
<div class="app-form" >
<?php if( !$WebappInstaller->isDomainRootClean()): ?>
<span class="alert alert-info alert-with-icon">
<i class="fas fa-info"></i>
<?=_('Data loss warning!<br>Your web domain already has files uploaded, the installer will overwrite your files and/or the installation might fail.<br/><br/> Please use the installer only for empty web domains')?>
</span>
<br/>
<?php endif ?>
<?php foreach ($WebappInstaller->getOptions() as $form_name => $form_control):?>
<?php
$f_name = $WebappInstaller->formNs() . '_' . $form_name;
$f_type = $form_control;
$f_value = '';
$f_label = ucwords(str_replace(['.','_'], ' ', $form_name));
$f_placeholder = '';
if (is_array($form_control)) {
$f_type = (!empty($form_control['type']))?$form_control['type']:'text';
$f_value = (!empty($form_control['value']))?$form_control['value']:'';
$f_placeholder = (!empty($form_control['placeholder']))?$form_control['placeholder']:'';
}
$f_value = htmlentities($f_value);
$f_label = htmlentities($f_label);
$f_placeholder = htmlentities($f_placeholder);
?>
<div class="form-group">
<label style="padding-bottom: 2px;" for="<?=$f_name?>"><?=$f_label?>
<?php if ($f_type === 'password'):?>
/ <a href="javascript:randomString('<?=$f_name?>');" class="generate" ><?php print _('generate')?></a>
<?php endif?>
</label>
<?php if (in_array($f_type, ['select']) && count($form_control['options']) ):?>
<p style="margin-top:0;"></p>
<select class="vst-list" name="<?=$f_name?>">
<?foreach ($form_control['options'] as $option):?>
<?php $selected = (!empty($form_control['value']) && $option === $form_control['value'])?'selected':''?>
<option value="<?=$option?>" <?=$selected?> ><?=htmlentities($option)?></option>
<?endforeach?>
</select>
</p>
<?php elseif (in_array($f_type, ['boolean'])):?>
<p>
<?php $checked = (!empty($f_value))?'checked':''?>
<input style="width:auto;" type="checkbox" class="vst-input" name="<?=$f_name?>" id="<?=$f_name?>" <?=$checked?> value="true">
</p>
<?php else:?>
<p style="margin-top:0;"></p>
<input type="text" size="20" class="vst-input" name="<?=$f_name?>" id="<?=$f_name?>" placeholder="<?=$f_placeholder?>" value="<?=$f_value?>">
</p>
<?php endif?>
</div>
<?php endforeach; ?>
</div>
</form>
<?php endif ?>
</div>