setup_webapp.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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" title="<?=__('Install')?>" 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. <!-- /.l-separator -->
  22. <div class="l-center animated fadeIn" style="padding-top:240px;">
  23. <?php
  24. $back = $_SESSION['back'];
  25. if (empty($back)) {
  26. $back = "location.href='/list/web/'";
  27. } else {
  28. $back = "location.href='".$back."'";
  29. }
  30. ?>
  31. <?php if( !empty($WebappInstaller->getOptions())): ?>
  32. <form id="vstobjects" method="POST" name="v_setup_webapp" style="padding-top:0px;" >
  33. <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
  34. <input type="hidden" name="ok" value="true" />
  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. <div class="app-form" >
  43. <?php foreach ($WebappInstaller->getOptions() as $form_name => $form_control):?>
  44. <?php
  45. $f_name = $WebappInstaller->formNs() . '_' . $form_name;
  46. $f_type = $form_control;
  47. $f_value = '';
  48. $f_label = ucwords(str_replace(['.','_'], ' ', $form_name));
  49. $f_placeholder = '';
  50. if (is_array($form_control)) {
  51. $f_type = (!empty($form_control['type']))?$form_control['type']:'text';
  52. $f_value = (!empty($form_control['value']))?$form_control['value']:'';
  53. $f_placeholder = (!empty($form_control['placeholder']))?$form_control['placeholder']:'';
  54. }
  55. $f_value = htmlentities($f_value);
  56. $f_label = htmlentities($f_label);
  57. $f_placeholder = htmlentities($f_placeholder);
  58. ?>
  59. <div class="form-group">
  60. <label style="padding-bottom: 2px;" for="<?=$f_name?>"><?=$f_label?>
  61. <?php if ($f_type === 'password'):?>
  62. / <a href="javascript:randomString('<?=$f_name?>');" class="generate" ><?php print __('generate')?></a>
  63. <?php endif?>
  64. </label>
  65. <?php if (in_array($f_type, ['select']) && count($form_control['options']) ):?>
  66. <p style="margin-top:0;"></p>
  67. <select class="vst-list" name="<?=$f_name?>">
  68. <?foreach ($form_control['options'] as $option):?>
  69. <?php $selected = (!empty($form_control['value']) && $option === $form_control['value'])?'selected':''?>
  70. <option value="<?=$option?>" <?=$selected?> ><?=htmlentities($option)?></option>
  71. <?endforeach?>
  72. </select>
  73. </p>
  74. <?php elseif (in_array($f_type, ['boolean'])):?>
  75. <p>
  76. <?php $checked = (!empty($f_value))?'checked':''?>
  77. <input style="width:auto;" type="checkbox" class="vst-input" name="<?=$f_name?>" id="<?=$f_name?>" <?=$checked?> value="true">
  78. </p>
  79. <?php else:?>
  80. <p style="margin-top:0;"></p>
  81. <input type="text" size="20" class="vst-input" name="<?=$f_name?>" id="<?=$f_name?>" placeholder="<?=$f_placeholder?>" value="<?=$f_value?>">
  82. </p>
  83. <?php endif?>
  84. </div>
  85. <?php endforeach; ?>
  86. </div>
  87. </form>
  88. <?php endif ?>
  89. </div>