PageRenderTime 49ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/baser/plugins/blog/views/elements/widgets/blog_category_archives.php

https://github.com/hashing/basercms
PHP | 64 lines | 44 code | 2 blank | 18 comment | 9 complexity | 9bb1154e47690b62c720eab6a167b6f7 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.plugins.blog.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. if(empty($view_count)) {
  21. $view_count = '0';
  22. }
  23. if(empty($limit)) {
  24. $limit = '0';
  25. }
  26. if(!isset($by_year)) {
  27. $by_year = null;
  28. }
  29. if(isset($blogContent)){
  30. $id = $blogContent['BlogContent']['id'];
  31. }else{
  32. $id = $blog_content_id;
  33. }
  34. if(empty($depth)) {
  35. $depth = 1;
  36. }
  37. $actionUrl = '/blog/blog/get_categories/'.$id.'/'.$limit.'/'.$view_count.'/'.$depth;
  38. if($by_year) {
  39. $actionUrl .= '/year';
  40. }
  41. $data = $this->requestAction($actionUrl);
  42. $categories = $data['categories'];
  43. $this->viewVars['blogContent'] = $data['blogContent'];
  44. App::import('Helper','Blog.Blog');
  45. $blog = new BlogHelper();
  46. ?>
  47. <div class="widget widget-blog-categories-archives widget-blog-categories-archives-<?php echo $id ?> blog-widget">
  48. <?php if($name && $use_title): ?>
  49. <h2><?php echo $name ?></h2>
  50. <?php endif ?>
  51. <?php if($by_year): ?>
  52. <ul>
  53. <?php foreach($categories as $key => $category): ?>
  54. <li class="category-year"><span><?php $bcBaser->link($key.'年', array('plugin' => null, 'controller' => $blogContent['BlogContent']['name'], 'action' => 'archives', 'date', $key)) ?></span>
  55. <?php echo $blog->getCategoryList($category, $depth, $view_count, array('named' => array('year' => $key))) ?>
  56. </li>
  57. <?php endforeach ?>
  58. </ul>
  59. <?php else: ?>
  60. <?php echo $blog->getCategoryList($categories, $depth, $view_count) ?>
  61. <?php endif ?>
  62. </div>