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

/baser/views/elements/admin/list_num.php

https://github.com/hashing/basercms
PHP | 46 lines | 28 code | 0 blank | 18 comment | 8 complexity | 4b84320f292c1529e31e54f72ad985bb MD5 | raw file
Possible License(s): MIT
  1. <?php
  2. /* SVN FILE: $Id$ */
  3. /**
  4. * [ADMIN] リスト設定リンク
  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. $currentNum = '';
  21. if(empty($nums)){
  22. $nums = array('10','20','50','100');
  23. }
  24. if(!is_array($nums)){
  25. $nums = array($nums);
  26. }
  27. if(!empty($this->passedArgs['num'])){
  28. $currentNum = $this->passedArgs['num'];
  29. }
  30. $links = array();
  31. foreach($nums as $num){
  32. if($currentNum != $num){
  33. $links[] = '<span>'.$bcBaser->getLink($num, am($this->passedArgs,array('num'=>$num))).'</span>';
  34. } else {
  35. $links[] = '<span class="current">'. $num .'</span>';
  36. }
  37. }
  38. if ($links) {
  39. $link = implode('|',$links);
  40. }
  41. ?>
  42. <?php if($link): ?>
  43. <div class="list-num">
  44. <strong>表示件数</strong><p><?php echo $link ?></p>
  45. </div>
  46. <?php endif ?>