custominstall.html.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. /**
  3. * The custom install view file of instance module of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
  6. * @license ZPL (http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  7. * @author Jianhua Wang <wangjianhua@easycorp.ltd>
  8. * @package instance
  9. * @version $Id$
  10. * @link https://www.zentao.net
  11. */
  12. ?>
  13. <?php include $this->app->getModuleRoot() . '/common/view/header.html.php';?>
  14. <div id='mainMenu' class='clearfix'>
  15. <div class="btn-toolbar pull-left">
  16. <?php echo html::a($this->createLink('store', 'appView', "id={$appID}"), '<i class="icon icon-back icon-sm"></i> ' . $lang->goback, '', "class='btn btn-secondary'");?>
  17. </div>
  18. </div>
  19. <div id='mainContent' class='main-row'>
  20. <form class="cell load-indicator main-form form-ajax" method='post'>
  21. <h3><?php echo $lang->instance->customInstall;?></h3>
  22. <?php if(empty($components)):?>
  23. <div class="table-empty-tip">
  24. <p><?php echo html::a($this->createLink('store', 'appView', "id={$appID}"), $lang->instance->noComponent . '<i class="icon icon-back icon-sm"></i> ' . $lang->goback, '', "class='btn btn-info'");?></p>
  25. </div>
  26. <?php endif?>
  27. <ul class="nav nav-tabs">
  28. <?php foreach($components as $component):?>
  29. <li class="<?php echo$activeTab == $component->name ? 'active' : '';?>">
  30. <a data-tab href="#<?php echo $component->name;?>"><?php echo $component->name;?></a>
  31. </li>
  32. <?php endforeach?>
  33. </ul>
  34. <div class="tab-content">
  35. <?php foreach($components as $component):?>
  36. <div class="tab-pane <?php echo$activeTab == $component->name ? 'active' : '';?>" id="<?php echo $component->name;?>">
  37. <table class="table table-form">
  38. <tbody>
  39. <?php foreach($component->settings as $setting):?>
  40. <?php
  41. if($setting->type == 'choice')
  42. {
  43. $selectOptions = array_combine($setting->options, $setting->options);
  44. if(strpos($setting->field, 'resources_cpu') !== false) $selectOptions = $this->instance->getCpuOptions($setting->options);
  45. if(strpos($setting->field, 'resources_memory') !== false) $selectOptions = $this->instance->getMemOptions($setting->options);
  46. }
  47. ?>
  48. <tr>
  49. <th class='w-150px'><?php echo zget($this->lang->instance->componentFields, $setting->name, $setting->name);?></th>
  50. <td class='w-200px'>
  51. <div class='input-group'>
  52. <?php if($setting->type == 'choice') echo html::select($setting->field, $selectOptions, $setting->value, "class='form-control chosen'");?>
  53. <?php if($setting->type == 'int') echo html::number($setting->field, $setting->value, "class='form-control'", "require");?>
  54. </div>
  55. </td>
  56. <td></td>
  57. </tr>
  58. <?php endforeach;?>
  59. </tbody>
  60. </table>
  61. </div>
  62. <?php endforeach;?>
  63. <?php if(!empty($components)):?>
  64. <div class="text-center form-actions"><?php echo html::submitButton($lang->instance->install);?></div>
  65. <?php endif;?>
  66. </div>
  67. </form>
  68. </div>
  69. <?php include $this->app->getModuleRoot() . '/common/view/footer.html.php';?>