implement.html.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <?php
  2. /**
  3. * The implement file of metric module of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
  6. * @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  7. * @author zhouxin<zhouxin@easycorp.ltd>
  8. * @package metric
  9. * @link http://www.zentao.net
  10. */
  11. namespace zin;
  12. jsVar('metricId', $metric->id);
  13. jsVar('code', $metric->code);
  14. jsVar('verifyCustomMethods', $verifyCustom);
  15. jsVar('from', $from);
  16. jsVar('isVerify', isset($isVerify) ? $isVerify : false);
  17. jsVar('isModuleCalcExist', isset($isModuleCalcExist) ? $isModuleCalcExist : false);
  18. jsVar('moduleCalcTip', isset($moduleCalcTip) ? $moduleCalcTip : '');
  19. jsVar('checkModuleFile', $this->lang->metric->checkFile);
  20. detailHeader
  21. (
  22. to::title
  23. (
  24. entityLabel
  25. (
  26. setClass('text-xl font-black'),
  27. set::level(1),
  28. set::text($lang->metric->implement->common)
  29. ),
  30. label
  31. (
  32. to::before(icon(setClass('warning-ghost margin-left8'), 'help')),
  33. set::text($lang->metric->implement->tip),
  34. setClass('label ghost')
  35. )
  36. )
  37. );
  38. $fnGenerateInstructions = function() use($lang)
  39. {
  40. $instructions = array();
  41. foreach($lang->metric->implement->instructionTips as $tip)
  42. {
  43. $instructions[] = p
  44. (
  45. set::className('font-medium text-md'),
  46. setStyle('padding-top', '12px'),
  47. html($tip)
  48. );
  49. }
  50. return $instructions;
  51. };
  52. panel
  53. (
  54. setClass('clear-shadow'),
  55. set::bodyClass('relative'),
  56. btn
  57. (
  58. setClass('ghost btn-download'),
  59. $lang->metric->implement->downloadPHP,
  60. on::click('.btn-download', "download({$metric->id})")
  61. ),
  62. div
  63. (
  64. h1
  65. (
  66. setClass('border-bottom'),
  67. span
  68. (
  69. $lang->metric->implement->instruction,
  70. setClass('gray-pale text-md font-bold')
  71. )
  72. ),
  73. div
  74. (
  75. setClass('leading-loose'),
  76. $fnGenerateInstructions()
  77. ),
  78. h1
  79. (
  80. setClass('border-bottom'),
  81. span
  82. (
  83. $lang->metric->verifyResult,
  84. setClass('gray-pale text-md font-bold')
  85. )
  86. ),
  87. div
  88. (
  89. setClass('verify-content'),
  90. div
  91. (
  92. setClass('verify-result')
  93. ),
  94. div
  95. (
  96. setClass('metric-result')
  97. )
  98. )
  99. ),
  100. set::footerClass('footer-actions'),
  101. set::footerActions
  102. ([
  103. [
  104. 'type' => 'secondary',
  105. 'class' => 'btn-verify',
  106. 'text' => $lang->metric->verifyFile,
  107. ],
  108. [
  109. 'type' => 'primary',
  110. 'text' => $lang->metric->publish,
  111. 'class' => 'ajax-submit publish-btn-disabled',
  112. 'btnType' => 'submit',
  113. 'disabled' => true
  114. ],
  115. [
  116. 'type' => 'primary',
  117. 'text' => $lang->metric->publish,
  118. 'class' => 'ajax-submit publish-btn hidden',
  119. 'btnType' => 'submit',
  120. 'url' => helper::createLink('metric', 'publish', "metricID={$metric->id}&from={$from}")
  121. ]
  122. ]),
  123. on::click('.btn-verify', "verify()")
  124. );