PageRenderTime 63ms CodeModel.GetById 39ms RepoModel.GetById 0ms app.codeStats 0ms

/baser/views/elements/global_menu.php

https://github.com/hashing/basercms
PHP | 53 lines | 35 code | 0 blank | 18 comment | 13 complexity | 08ad0feceb37f66df34302fb70540e65 MD5 | raw file
Possible License(s): MIT
  1. <?php
  2. /* SVN FILE: $Id$ */
  3. /**
  4. * [ADMIN] グロバールメニュー
  5. *
  6. * PHP versions 5
  7. *
  8. * baserCMS : Based Website Development Project <http://basercms.net>
  9. * Copyright 2008 - 2012, baserCMS Users Community <http://sites.google.com/site/baserusers/>
  10. *
  11. * @copyright Copyright 2008 - 2012, baserCMS Users Community
  12. * @link http://basercms.net baserCMS Project
  13. * @package baser.views
  14. * @since baserCMS v 0.1.0
  15. * @version $Revision$
  16. * @modifiedby $LastChangedBy$
  17. * @lastmodified $Date$
  18. * @license http://basercms.net/license/index.html
  19. */
  20. if(Configure::read('BcRequest.isMaintenance')) {
  21. return;
  22. }
  23. $prefix = '';
  24. if(Configure::read('BcRequest.agent')) {
  25. $prefix = '/'.Configure::read('BcRequest.agentAlias');
  26. }
  27. ?>
  28. <ul class="global-menu clearfix">
  29. <?php if(empty($menuType)) $menuType = '' ?>
  30. <?php $globalMenus = $bcBaser->getMenus() ?>
  31. <?php if(!empty($globalMenus)): ?>
  32. <?php foreach($globalMenus as $key => $globalMenu): ?>
  33. <?php $no = sprintf('%02d',$key+1) ?>
  34. <?php if($globalMenu['GlobalMenu']['status']): ?>
  35. <?php if($key == 0): ?>
  36. <?php $class = ' class="first menu'.$no.'"' ?>
  37. <?php elseif($key == count($globalMenus) - 1): ?>
  38. <?php $class = ' class="last menu'.$no.'"' ?>
  39. <?php else: ?>
  40. <?php $class = ' class="menu'.$no.'"' ?>
  41. <?php endif ?>
  42. <?php if(!Configure::read('BcRequest.agent') && $this->base == '/index.php' && $globalMenu['GlobalMenu']['link'] == '/'): ?>
  43. <?php /* PC版トップページ */ ?>
  44. <li<?php echo $class ?>><?php echo str_replace('/index.php','',$bcBaser->link($globalMenu['GlobalMenu']['name'],$globalMenu['GlobalMenu']['link'])) ?></li>
  45. <?php else: ?>
  46. <li<?php echo $class ?>>
  47. <?php $bcBaser->link($globalMenu['GlobalMenu']['name'], $prefix.$globalMenu['GlobalMenu']['link']) ?>
  48. </li>
  49. <?php endif ?>
  50. <?php endif ?>
  51. <?php endforeach ?>
  52. <?php endif ?>
  53. </ul>