flowchart.html.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /**
  3. * The flow chart view file of block module of ZenTaoPMS.
  4. * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
  5. * @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  6. * @author Yuting Wang <wangyuting@easycorp.ltd>
  7. * @package block
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. /**
  12. * 展示流程图。
  13. * Print flow chart.
  14. */
  15. function printFlowchart()
  16. {
  17. global $lang, $app;
  18. $isEn = $app->getClientLang() == 'en';
  19. $charts = array();
  20. foreach($lang->block->flowchart as $flowName => $flow)
  21. {
  22. $items = array();
  23. $index = 0;
  24. foreach ($flow as $flowItem)
  25. {
  26. $items[] = div
  27. (
  28. set('class', "flow-item flow-item-$index " . ($index >= 1 ? 'flow-item-arrow' : '')),
  29. $isEn ? set::style(array('flex' => '0 1 15.5%', 'padding-left' => '8px')) : null,
  30. div
  31. (
  32. set('class', 'flow-item-display'),
  33. $isEn ? set::title($flowItem) : null,
  34. $isEn ? set::style(array('font-size' => '11px')) : null,
  35. $flowItem
  36. )
  37. );
  38. $index ++;
  39. }
  40. $charts[] = div
  41. (
  42. set('class', 'row flow-chart-row row-' . $flowName),
  43. $items
  44. );
  45. }
  46. return div(set('class', 'flowchart p-6'), $charts);
  47. }