visionswitch.html.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /**
  3. * The vision switch 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 vision switch.
  14. */
  15. function printVisionSwitch()
  16. {
  17. global $lang, $config;
  18. $cells = array();
  19. foreach($lang->block->visions as $vision)
  20. {
  21. $image = $config->webRoot . "theme/default/images/guide/vision_{$vision->key}.png";
  22. if(!common::checkNotCN() and $vision->key == 'rnd') $image = $config->webRoot . "theme/default/images/guide/vision_{$vision->key}_cn.png";
  23. if(common::checkNotCN() and $vision->key == 'rnd') $image = $config->webRoot . "theme/default/images/guide/vision_{$vision->key}_en.png";
  24. $cells[] = cell
  25. (
  26. set('width', '50%'),
  27. set('class', 'flex-1 block mr-4 ' . ($config->vision == $vision->key ? 'active' : 'state')),
  28. div
  29. (
  30. set('class', 'w-full vision-block'),
  31. set('data-vision', $vision->key),
  32. img
  33. (
  34. set('class', 'p-2'),
  35. set('src', $image),
  36. set('style', array('height' => count($lang->block->visions) > 2 ? 'auto' : '180px'))
  37. ),
  38. div
  39. (
  40. set('class', 'px-4 pb-2'),
  41. div(set('class', 'pb-2'), span(set('class', 'font-bold'), $vision->title)),
  42. span(set('class', 'text-sm text-gray'), $vision->text)
  43. )
  44. )
  45. );
  46. }
  47. return div
  48. (
  49. set('class', 'vision-switch p-4'),
  50. div
  51. (
  52. span(set('class', 'py-2'), $lang->block->visionTitle),
  53. div
  54. (
  55. set('class','flex mt-2'),
  56. $cells
  57. )
  58. )
  59. );
  60. }