setup_webapp.html 5.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <div class="l-center edit">
  2. <div class="l-sort clearfix">
  3. <div class="l-unit-toolbar__buttonstrip">
  4. <a class="ui-button cancel" id="btn-back" href="/add/webapp/?domain=<?=$v_domain?>"><i class="fas fa-arrow-left status-icon blue"></i> <?=_('Back')?></a>
  5. </div>
  6. <div class="l-unit-toolbar__buttonstrip float-right">
  7. <?php
  8. if (!empty($_SESSION['error_msg'])) {
  9. echo "<span class=\"vst-error\"> → ".htmlentities($_SESSION['error_msg'])."</span>";
  10. } else {
  11. if (!empty($_SESSION['ok_msg'])) {
  12. echo "<span class=\"vst-ok\"> → ".$_SESSION['ok_msg']."</span>";
  13. }
  14. }
  15. ?>
  16. <a href="#" class="ui-button" data-action="submit" data-id="vstobjects"><i class="fas fa-save status-icon purple"></i> <?=_('Install')?></a>
  17. </div>
  18. </div>
  19. </div>
  20. <div class="l-separator"></div>
  21. <div class="l-center animated fadeIn" style="padding-top:240px;">
  22. <?php
  23. $back = $_SESSION['back'];
  24. if (empty($back)) {
  25. $back = "location.href='/list/web/'";
  26. } else {
  27. $back = "location.href='".$back."'";
  28. }
  29. ?>
  30. <?php if( !empty($WebappInstaller->getOptions())): ?>
  31. <form id="vstobjects" method="POST" name="v_setup_webapp" style="padding-top:0px;" >
  32. <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
  33. <input type="hidden" name="ok" value="true" />
  34. <div class="app-form" >
  35. <?php if( !$WebappInstaller->isDomainRootClean()): ?>
  36. <span class="alert alert-info alert-with-icon">
  37. <i class="fas fa-info"></i>
  38. <?=_('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')?>
  39. </span>
  40. <br/>
  41. <?php endif ?>
  42. <?php foreach ($WebappInstaller->getOptions() as $form_name => $form_control):?>
  43. <?php
  44. $f_name = $WebappInstaller->formNs() . '_' . $form_name;
  45. $f_type = $form_control;
  46. $f_value = '';
  47. $f_label = ucwords(str_replace(['.','_'], ' ', $form_name));
  48. $f_placeholder = '';
  49. if (is_array($form_control)) {
  50. $f_type = (!empty($form_control['type']))?$form_control['type']:'text';
  51. $f_value = (!empty($form_control['value']))?$form_control['value']:'';
  52. $f_placeholder = (!empty($form_control['placeholder']))?$form_control['placeholder']:'';
  53. }
  54. $f_value = htmlentities($f_value);
  55. $f_label = htmlentities($f_label);
  56. $f_placeholder = htmlentities($f_placeholder);
  57. ?>
  58. <div class="form-group">
  59. <label style="padding-bottom: 2px;" for="<?=$f_name?>"><?=$f_label?>
  60. <?php if ($f_type === 'password'):?>
  61. / <a href="javascript:randomString('<?=$f_name?>');" class="generate" ><?php print _('generate')?></a>
  62. <?php endif?>
  63. </label>
  64. <?php if (in_array($f_type, ['select']) && count($form_control['options']) ):?>
  65. <p style="margin-top:0;"></p>
  66. <select class="vst-list" name="<?=$f_name?>">
  67. <?foreach ($form_control['options'] as $option):?>
  68. <?php $selected = (!empty($form_control['value']) && $option === $form_control['value'])?'selected':''?>
  69. <option value="<?=$option?>" <?=$selected?> ><?=htmlentities($option)?></option>
  70. <?endforeach?>
  71. </select>
  72. </p>
  73. <?php elseif (in_array($f_type, ['boolean'])):?>
  74. <p>
  75. <?php $checked = (!empty($f_value))?'checked':''?>
  76. <input style="width:auto;" type="checkbox" class="vst-input" name="<?=$f_name?>" id="<?=$f_name?>" <?=$checked?> value="true">
  77. </p>
  78. <?php else:?>
  79. <p style="margin-top:0;"></p>
  80. <input type="text" size="20" class="vst-input" name="<?=$f_name?>" id="<?=$f_name?>" placeholder="<?=$f_placeholder?>" value="<?=$f_value?>">
  81. </p>
  82. <?php endif?>
  83. </div>
  84. <?php endforeach; ?>
  85. </div>
  86. </form>
  87. <?php endif ?>
  88. </div>