setup_webapp.html 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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-control">
  50. <label 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. <p>
  56. <?php if (in_array($f_type, ['select']) && count($form_control['options']) ):?>
  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. <?php else:?>
  64. <input type="text" size="20" class="vst-input" name="<?=$f_name?>" id="<?=$f_name?>" value="<?=$f_value?>">
  65. <?php endif?>
  66. </p>
  67. </div>
  68. <?php endforeach; ?>
  69. </div>
  70. </form>
  71. <?php endif ?>
  72. </div>