preview.html.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <?php
  2. /**
  3. * The preview view file of pivot 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 Gang Liu <liugang@easycorp.ltd>
  7. * @package pivot
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. $currentMenu = $currentMenu ?? '';
  12. $generateData = function() use ($lang) {return div(setClass('bg-canvas center text-gray w-full h-40'), $lang->pivot->noPivot);};
  13. $viewFile = strtolower($method) . '.html.php';
  14. if(file_exists($viewFile)) include_once $viewFile;
  15. if($this->config->edition != 'open')
  16. {
  17. $pivotPath = $this->app->getModuleExtPath('pivot', 'ui');
  18. include $pivotPath['common'] . 'exportdata.html.php';
  19. }
  20. jsVar('dimensionID', $dimensionID);
  21. jsVar('groupID', $groupID);
  22. jsVar('emptyDrillTip', $this->lang->pivot->emptyDrillTip);
  23. $commonGroups = array_slice($groups, 0, $config->pivot->maxFeatureItem, true);
  24. $moreGroups = array_slice($groups, $config->pivot->maxFeatureItem, null, true);
  25. foreach($commonGroups as $id => $name) $lang->pivot->featureBar['preview'][$id] = $name;
  26. if(!empty($moreGroups)) $lang->pivot->featureBar['preview']['more'] = $lang->more;
  27. foreach($moreGroups as $id => $name) $lang->pivot->moreSelects['preview']['more'][$id] = $name;
  28. featureBar(set::current($groupID), set::load(''), set::linkParams("dimension={$dimensionID}&group={key}"));
  29. if($config->edition != 'open')
  30. {
  31. toolbar(hasPriv('pivot', 'export') ? item(set(array
  32. (
  33. 'text' => $lang->export,
  34. 'icon' => 'export',
  35. 'class' => 'ghost',
  36. 'data-target' => '#export',
  37. 'data-toggle' => 'modal',
  38. 'data-size' => 'sm'
  39. ))) : null, hasPriv('pivot', 'browse') ? item(set(array
  40. (
  41. 'text' => $lang->pivot->toDesign,
  42. 'class' => 'primary',
  43. 'url' => inlink('browse'),
  44. ))) : null);
  45. }
  46. sidebar
  47. (
  48. set::width(240),
  49. moduleMenu
  50. (
  51. to::header
  52. (
  53. div
  54. (
  55. setClass('bg-canvas my-3 mx-5 text-xl font-semibold text-ellipsis h-7 flex-none'),
  56. $groups[$groupID]
  57. )
  58. ),
  59. set::title($groups[$groupID]),
  60. set::activeKey($currentMenu),
  61. set::modules($menus),
  62. set::closeLink(''),
  63. set::showDisplay(false),
  64. set::titleShow(false),
  65. to::footer
  66. (
  67. $this->config->edition == 'open' ? div
  68. (
  69. set::width(240),
  70. setClass('bg-canvas px-4 py-2 module-menu'),
  71. html(empty($config->isINT) ? $lang->bizVersion : $lang->bizVersionINT)
  72. ) : null
  73. )
  74. )
  75. );
  76. div
  77. (
  78. setID('pivotContent'),
  79. setClass('flex col gap-4 w-full'),
  80. $generateData()
  81. );