m.header.html.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <?php
  2. /**
  3. * The header mobile view of common module of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2016 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
  6. * @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  7. * @author Fei Chen <chenfei@cnezsoft.com>
  8. * @package common
  9. * @version $Id: header.lite.html.php 3299 2015-12-02 02:10:06Z daitingting $
  10. * @link http://www.zentao.net
  11. */
  12. if($extView = $this->getExtViewFile(__FILE__)){include $extView; return helper::cd();}
  13. if(!isset($bodyClass)) $bodyClass = '';
  14. $bodyClass .= ' with-heading-top with-nav-top';
  15. if(isonlybody()) return false;
  16. include 'm.header.lite.html.php';
  17. include 'm.avatar.html.php';
  18. $currentModule = $this->app->rawModule;
  19. if(!isset($headerTitle))
  20. {
  21. $mainModule = isset($lang->navGroup->$currentModule) ? $lang->navGroup->$currentModule : $currentModule;
  22. $headerTitle = '';
  23. if(isset($lang->webMainNav->$mainModule)) list($headerTitle) = explode('|', $lang->webMainNav->$mainModule);
  24. if($mainModule == 'admin' or $mainModule == 'system') list($headerTitle) = explode('|', $lang->webMainNav->company);
  25. if(!empty($lang->switcherMenu)) $headerTitle = $lang->switcherMenu;
  26. $headerTitle = preg_replace('/<i[^>]*>[^<]*<\/i>/U', '', $headerTitle);
  27. }
  28. ?>
  29. <header id='appbar' class='heading skin-default affix dock-top'>
  30. <a data-target='#userMenu' data-backdrop='true' data-display class='profile has-padding' data-target-dismiss='true'>
  31. <div class='avatar text-tint circle'>
  32. <img src='<?php echo $webRoot . 'mobile/img/profile.png' ?>' alt='<?php echo $this->app->user->realname;?>'>
  33. </div>
  34. </a>
  35. <strong id='headerTitle'><nobr><?php echo $headerTitle;?></nobr></strong>
  36. <nav id='searchbar' class='has-padding'>
  37. <?php if(common::hasPriv('search', 'index')):?>
  38. <a data-target='#searchBox' data-backdrop='true' data-display data-placement='top' class='avatar'>
  39. <img src='<?php echo $webRoot . 'mobile/img/search.png' ?>'>
  40. </a>
  41. <?php endif;?>
  42. </nav>
  43. </header>
  44. <nav id='appnav' class='affix dock-top nav skin-default-pale'>
  45. <?php extCommonModel::printWebModuleMenu($currentModule);?>
  46. <a class='moreAppnav hidden' data-display='dropdown' data-placement='beside-bottom'><i class='icon icon-bars'></i></a>
  47. <div id='moreAppnav' class='list dropdown-menu'></div>
  48. </nav>
  49. <div id='userMenu' class='list compact layer hidden fade'>
  50. <a class='item multi-lines primary-pale' data-remote='<?php echo $this->createLink('my', 'profile');?>' data-display='modal' data-placement='bottom' data-name='userProfile'>
  51. <?php printUserAvatar('circle', $app->user);?>
  52. <div class='content'>
  53. <div class='title'><?php echo empty($app->user->realname) ? ('@' . $app->user->account) : $app->user->realname ?></div>
  54. <div class='subtitle'><?php echo $lang->user->profile ?></div>
  55. </div>
  56. </a>
  57. <div class='item'>
  58. <i class='icon icon-globe muted'></i>
  59. <div class="content">
  60. <nav class='nav lang-menu dock'>
  61. <?php foreach($config->langs as $key => $value):?>
  62. <a data-value='<?php echo $key; ?>'<?php if($key === $this->app->getClientLang()) echo ' class="active"' ?>><?php echo $value; ?></a>
  63. <?php endforeach;?>
  64. </nav>
  65. </div>
  66. </div>
  67. <div class='divider no-margin'></div>
  68. <a class='item' data-remote='<?php echo $this->createLink('misc', 'about');?>' data-display='modal' data-placement='bottom'><i class='icon icon-info-sign muted'></i> <span class='title'><?php echo $lang->aboutZenTao?></span></a>
  69. <div class='divider no-margin'></div>
  70. <?php echo html::a($this->createLink('user', 'logout'), "<i class='icon icon-signout muted'></i> <span class='title'>{$lang->logout}</span>", '', "class='item'")?>
  71. </div>
  72. <div id='searchBox' class='fade hidden layer'>
  73. <div class='heading divider'>
  74. <div class='title'><strong><?php echo $lang->searchAB?></strong></div>
  75. <nav class='nav'><a data-dismiss='display'><i class='icon icon-remove muted'></i></a></nav>
  76. </div>
  77. <form class='content box' action='<?php echo $this->createLink('search', 'index')?>' method='post'>
  78. <div class='control-group'>
  79. <?php echo html::input('words', '', "class='input'")?>
  80. <?php echo html::submitButton("<i class='icon-search'></i>")?>
  81. </div>
  82. </form>
  83. <?php
  84. if($moduleName == 'product')
  85. {
  86. if($methodName == 'browse') $searchObject = 'story';
  87. }
  88. elseif($moduleName == 'execution')
  89. {
  90. if(strpos('task|story|bug|build', $methodName) !== false) $searchObject = $methodName;
  91. }
  92. elseif($moduleName == 'my' or $moduleName == 'user')
  93. {
  94. $searchObject = $methodName;
  95. }
  96. if(empty($searchObject) or empty($lang->searchObjects[$searchObject])) $searchObject = 'bug';
  97. echo html::hidden('searchType', $searchObject);
  98. ?>
  99. <ul class='dropdown-search-menu hidden'>
  100. <?php
  101. foreach ($lang->searchObjects as $key => $value)
  102. {
  103. if(in_array($key, $config->noWebModules) or $key == 'user') continue;
  104. echo "<li><a href='javascript:;' data-value='{$key}'>{$value}</a></li>";
  105. }
  106. ?>
  107. </ul>
  108. </div>
  109. <div class="nav affix dock-bottom justified">
  110. <?php extCommonModel::printWebMainMenu();?>
  111. </div>