header.html.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. * The header view file of execution 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 execution
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. h::css('#mainNavbar .main-navbar-right {position: absolute; right: 2.5rem; top: 0.5rem;}#mainNavbar .main-navbar-right .btn {padding: 0.5rem;}');
  12. $currentModule = $app->rawModule;
  13. $currentMethod = $app->rawMethod;
  14. $config->hasMainNavBar = array("{$currentModule}-{$currentMethod}");
  15. $dropdownItems = array();
  16. foreach($lang->execution->menu as $menuKey => $menu)
  17. {
  18. if(empty($menu['module'])) continue;
  19. $active = $menuKey == $currentMethod;
  20. $dropdownItems[] = array('icon' => $lang->execution->icons[$menuKey], 'text' => $menu['name'], 'url' => createLink($menu['module'], $menu['method'], $menu['vars']), 'active' => $active);
  21. }
  22. mainNavbar
  23. (
  24. to::left
  25. (
  26. zui::dropmenu
  27. (
  28. setID("execution-menu"),
  29. set('_id', 'switcher'),
  30. set(array('text' => $execution->name, 'fetcher' => createLink('execution', 'ajaxGetExecutionSwitcherMenu', "projectID={$execution->project}&executionID={$execution->id}&method={$currentMethod}"), 'defaultValue' => $execution->id))
  31. )
  32. ),
  33. to::right
  34. (
  35. dropdown
  36. (
  37. btn(
  38. setClass('ghost btn square btn-default absolute right-0'),
  39. set::icon($lang->execution->icons[$currentMethod]),
  40. span
  41. (
  42. setClass('pl-1'),
  43. $lang->execution->menu->{$currentMethod}['name']
  44. )
  45. ),
  46. set::placement('bottom-end'),
  47. set::items($dropdownItems)
  48. )
  49. )
  50. );