header.html.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. $active = $menuKey == $currentMethod;
  19. $dropdownItems[] = array('icon' => $lang->execution->icons[$menuKey], 'text' => $menu['name'], 'url' => createLink($menu['module'], $menu['method'], $menu['vars']), 'active' => $active);
  20. }
  21. mainNavbar
  22. (
  23. to::left
  24. (
  25. zui::dropmenu
  26. (
  27. setID("execution-menu"),
  28. set('_id', 'switcher'),
  29. set(array('text' => $execution->name, 'fetcher' => createLink('execution', 'ajaxGetExecutionSwitcherMenu', "projectID={$execution->project}&executionID={$execution->id}&method={$currentMethod}"), 'defaultValue' => $execution->id))
  30. )
  31. ),
  32. to::right
  33. (
  34. dropdown
  35. (
  36. btn(
  37. setClass('ghost btn square btn-default absolute right-0'),
  38. set::icon($lang->execution->icons[$currentMethod]),
  39. span
  40. (
  41. setClass('pl-1'),
  42. $lang->execution->menu->{$currentMethod}['name']
  43. )
  44. ),
  45. set::placement('bottom-end'),
  46. set::items($dropdownItems)
  47. )
  48. )
  49. );