PageRenderTime 38ms CodeModel.GetById 13ms RepoModel.GetById 1ms app.codeStats 0ms

/baser/views/elements/crumbs.php

https://github.com/hashing/basercms
PHP | 46 lines | 26 code | 0 blank | 20 comment | 12 complexity | e2792433c59ba20794a54e5414c311aa 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. */
  22. if ($this->viewPath == 'home'){
  23. echo '<strong>ホーム</strong>';
  24. }else{
  25. $crumbs = $bcBaser->getCrumbs();
  26. if (!empty($crumbs)){
  27. foreach($crumbs as $key => $crumb){
  28. if($bcArray->last($crumbs, $key+1)) {
  29. if($crumbs[$key+1]['name'] == $crumb['name']) {
  30. continue;
  31. }
  32. }
  33. if($bcArray->last($crumbs, $key)) {
  34. if ($this->viewPath != 'home' && $crumb['name']){
  35. $bcBaser->addCrumb('<strong>'.$crumb['name'].'</strong>');
  36. }elseif($this->name == 'CakeError'){
  37. $bcBaser->addCrumb('<strong>404 NOT FOUND</strong>');
  38. }
  39. } else {
  40. $bcBaser->addCrumb($crumb['name'], $crumb['url']);
  41. }
  42. }
  43. }
  44. $bcBaser->crumbs(' &gt; ','ホーム');
  45. }
  46. ?>