PageRenderTime 48ms CodeModel.GetById 24ms RepoModel.GetById 1ms app.codeStats 0ms

/baser/views/elements/page_list.php

https://github.com/hashing/basercms
PHP | 49 lines | 31 code | 0 blank | 18 comment | 11 complexity | 0ee653751d991f232e33bc8950de6035 MD5 | raw file
Possible License(s): MIT
  1. <?php
  2. /* SVN FILE: $Id$ */
  3. /**
  4. * [PUBLISH] ページリスト
  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. $pages = $bcBaser->getPageList($categoryId);
  21. $current = str_replace($this->base, '', $this->here);
  22. ?>
  23. <ul class="clearfix">
  24. <?php
  25. if(!empty($pages)){
  26. foreach($pages as $key => $page){
  27. $class = '';
  28. $classies = array('page-'.$no);
  29. $no = sprintf('%02d',$key+1);
  30. if($key == 0){
  31. $classies[] = 'first';
  32. }elseif($key == count($pages) - 1){
  33. $classies[] = 'last';
  34. }
  35. if($current == $page['url']) {
  36. $classies[] = 'current';
  37. }
  38. if($classies) {
  39. $class = ' class="'.implode(' ', $classies).'"';
  40. }
  41. if($this->base == '/index.php' && $page['url'] == '/'){
  42. echo '<li'.$class.'>'.str_replace('/index.php','',$bcBaser->getLink($page['title'],$page['url'])).'</li>';
  43. }else{
  44. echo '<li'.$class.'>'.$bcBaser->getLink($page['title'],$page['url']).'</li>';
  45. }
  46. }
  47. }
  48. ?>
  49. </ul>