PageRenderTime 45ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/baser/views/elements/navi.php

https://github.com/hashing/basercms
PHP | 50 lines | 29 code | 0 blank | 21 comment | 13 complexity | 509d282e18ac39b2a9e710121535a7cc MD5 | raw file
Possible License(s): MIT
  1. <?php
  2. /* SVN FILE: $Id$ */
  3. /**
  4. * [PUBLISH] ナビゲーション
  5. *
  6. * ページタイトルが直属のカテゴリ名と同じ場合は、直属のカテゴリ名を省略する
  7. *
  8. * PHP versions 5
  9. *
  10. * baserCMS : Based Website Development Project <http://basercms.net>
  11. * Copyright 2008 - 2012, baserCMS Users Community <http://sites.google.com/site/baserusers/>
  12. *
  13. * @copyright Copyright 2008 - 2012, baserCMS Users Community
  14. * @link http://basercms.net baserCMS Project
  15. * @package baser.views
  16. * @since baserCMS v 0.1.0
  17. * @version $Revision$
  18. * @modifiedby $LastChangedBy$
  19. * @lastmodified $Date$
  20. * @license http://basercms.net/license/index.html
  21. * @deprecated 2.0の次のバージョンで削除
  22. */
  23. if(Configure::read('BcRequest.isMaintenance')) {
  24. return;
  25. }
  26. if ($this->viewPath == 'home'){
  27. echo '<strong>ホーム</strong>';
  28. }else{
  29. $crumbs = $bcBaser->getCrumbs();
  30. if (!empty($crumbs)){
  31. foreach($crumbs as $key => $crumb){
  32. if($bcArray->last($crumbs, $key+1)) {
  33. if($crumbs[$key+1]['name'] == $crumb['name']) {
  34. continue;
  35. }
  36. }
  37. if($bcArray->last($crumbs, $key)) {
  38. if ($this->viewPath != 'home' && $crumb['name']){
  39. $bcBaser->addCrumb('<strong>'.$crumb['name'].'</strong>');
  40. }elseif($this->name == 'CakeError'){
  41. $bcBaser->addCrumb('<strong>404 NOT FOUND</strong>');
  42. }
  43. } else {
  44. $bcBaser->addCrumb($crumb['name'], $crumb['url']);
  45. }
  46. }
  47. }
  48. $bcBaser->crumbs(' &gt; ','ホーム');
  49. }
  50. ?>