PageRenderTime 49ms CodeModel.GetById 25ms RepoModel.GetById 1ms app.codeStats 0ms

/baser/views/elements/widget_area.php

https://github.com/hashing/basercms
PHP | 51 lines | 29 code | 0 blank | 22 comment | 6 complexity | 2bee90d2e00268602f9c63b2f2f2eb9d MD5 | raw file
Possible License(s): MIT
  1. <?php
  2. /* SVN FILE: $Id$ */
  3. /**
  4. * [PUBLISH] ウィジェットエリア
  5. *
  6. * no を引き数で渡して利用する
  7. * <?php $bcBaser->element('widget_areas',array('no'=>1)) ?>
  8. *
  9. *
  10. * PHP versions 5
  11. *
  12. * baserCMS : Based Website Development Project <http://basercms.net>
  13. * Copyright 2008 - 2012, baserCMS Users Community <http://sites.google.com/site/baserusers/>
  14. *
  15. * @copyright Copyright 2008 - 2012, baserCMS Users Community
  16. * @link http://basercms.net baserCMS Project
  17. * @package baser.plugins.blog.views
  18. * @since baserCMS v 0.1.0
  19. * @version $Revision$
  20. * @modifiedby $LastChangedBy$
  21. * @lastmodified $Date$
  22. * @license http://basercms.net/license/index.html
  23. */
  24. if(Configure::read('BcRequest.isMaintenance')) {
  25. return;
  26. }
  27. if(!empty($no)){
  28. $widgets = $this->requestAction('/widget_areas/get_widgets/'.$no);
  29. if($widgets){
  30. ?>
  31. <div class="widget-area widget-area-<?php echo $no ?>">
  32. <?php
  33. foreach($widgets as $key => $widget){
  34. $key = key($widget);
  35. if($widget[$key]['status']){
  36. $params = array();
  37. $params['widget']=true;
  38. if(empty($_SESSION['Auth']['User']) && !isset($cache)){
  39. $params['cache']='+1 month';
  40. }
  41. $params = am($params,$widget[$key]);
  42. $params[$no.'_'.$widget[$key]['id']] = $no.'_'.$widget[$key]['id']; // 同じタイプのウィジェットでキャッシュを特定する為に必要
  43. $bcBaser->element('widgets/'.$widget[$key]['element'],$params, false, $subDir);
  44. }
  45. }
  46. ?>
  47. </div>
  48. <?php
  49. }
  50. }
  51. ?>