setup_webapp.html 4.3 KB

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