PageRenderTime 43ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/baser/views/elements/admin/pagination.php

https://github.com/hashing/basercms
PHP | 44 lines | 25 code | 1 blank | 18 comment | 4 complexity | c45245d863bf660aec7754476fd02885 MD5 | raw file
Possible License(s): MIT
  1. <?php
  2. /* SVN FILE: $Id$ */
  3. /**
  4. * [PUBLISH] ページネーション
  5. *
  6. * PHP versions 4 and 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 2.0.0
  15. * @version $Revision$
  16. * @modifiedby $LastChangedBy$
  17. * @lastmodified $Date$
  18. * @license http://basercms.net/license/index.html
  19. */
  20. if(empty($paginator)) {
  21. return;
  22. }
  23. if(!isset($modules)) {
  24. $modules = 8;
  25. }
  26. $paginator->options = array('url' => $this->passedArgs);
  27. $pageCount = 0;
  28. if(isset($paginator->params['paging'][$paginator->defaultModel()]['pageCount'])) {
  29. $pageCount = $paginator->params['paging'][$paginator->defaultModel()]['pageCount'];
  30. }
  31. ?>
  32. <div class="pagination clearfix">
  33. <?php if($pageCount > 1): ?>
  34. <div class="page-numbers">
  35. <?php echo $paginator->prev('< 前へ', array('class'=>'prev'), null, array('class'=>'prev disabled')) ?>
  36. <?php echo $html->tag('span', $paginator->numbers(array('separator' => '', 'class' => 'number', 'modulus' => $modules), array('class' => 'page-numbers'))) ?>
  37. <?php echo $paginator->next('次へ >', array('class'=>'next'), null, array('class'=>'next disabled')) ?>
  38. </div>
  39. <?php endif ?>
  40. <div class="page-result">
  41. <?php echo $paginator->counter(array('format'=>'<span class="page-start-num">%start%</span>~<span class="page-end-num">%end%</span> 件 / <span class="page-total-num">%count%</span> 件')) ?>
  42. </div>
  43. </div>