sidebar.html.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php
  2. /**
  3. * The yyy view file of xxx 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 Shujie Tian<tianshujie@easycorp.ltd>
  7. * @package xxx
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. $menuItems = array();
  12. if(!empty($lang->custom->{$module}->fields) && $module != 'reviewcl')
  13. {
  14. foreach($lang->custom->{$module}->fields as $key => $value)
  15. {
  16. $currentModule = 'custom';
  17. $method = $key;
  18. $params = $key == 'required' ? "module=$module" : '';
  19. $active = $app->rawMethod == strtolower($key) ? 'active' : '';
  20. $tab = '';
  21. if(!in_array($key, $config->custom->notSetMethods))
  22. {
  23. $params = "module=$module&field=$key";
  24. $method = 'set';
  25. $active = (isset($field) and $field == $key) ? 'active' : $active;
  26. }
  27. if($module == 'approvalflow')
  28. {
  29. $currentModule = 'approvalflow';
  30. $method = $key;
  31. $params = '';
  32. $tab = 'admin';
  33. }
  34. if($module == 'setDate')
  35. {
  36. if($key == 'holiday')
  37. {
  38. $currentModule = 'holiday';
  39. $method = 'browse';
  40. $params = '';
  41. $active = isset($type) ? '' : 'active';
  42. }
  43. else
  44. {
  45. $method = 'hours';
  46. $params = "type={$key}";
  47. $active = (isset($type) and $type == $key) ? 'active' : '';
  48. }
  49. }
  50. if(common::hasPriv($currentModule, $method))
  51. {
  52. $menuItems[] = li
  53. (
  54. setClass('menu-item'),
  55. a
  56. (
  57. setClass($active),
  58. set::href(createLink($currentModule, $method, $params)),
  59. $tab ? set('data-app', $tab) : null,
  60. $value
  61. )
  62. );
  63. }
  64. }
  65. }
  66. $isEn = $app->getClientLang() == 'en';
  67. $EnSidebarWidth = $isEn ? set::width('210') : null;
  68. $sidebarMenu = $menuItems ? sidebar
  69. (
  70. set::showToggle(false),
  71. $EnSidebarWidth,
  72. div
  73. (
  74. setClass('cell p-2.5 bg-white'),
  75. menu
  76. (
  77. $menuItems
  78. )
  79. )
  80. ) : null;