PageRenderTime 45ms CodeModel.GetById 8ms RepoModel.GetById 1ms app.codeStats 0ms

/baser/plugins/blog/blog_app_controller.php

https://github.com/hashing/basercms
PHP | 70 lines | 29 code | 5 blank | 36 comment | 4 complexity | adf405ab8ad14c3de91367b624289dea MD5 | raw file
Possible License(s): MIT
  1. <?php
  2. /* SVN FILE: $Id$ */
  3. /**
  4. * ブログコントローラー基底クラス
  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
  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. /**
  21. * Include files
  22. */
  23. App::import('Controller', 'Plugins');
  24. /**
  25. * ブログコントローラー基底クラス
  26. *
  27. * @package baser.plugins.blog
  28. */
  29. class BlogAppController extends PluginsController {
  30. /**
  31. * コメントを管理者メールへメール送信する
  32. * @param array $data
  33. */
  34. function _sendComment() {
  35. if(!$this->data || empty($this->siteConfigs['email'])) {
  36. return false;
  37. }else {
  38. $data = $this->data;
  39. $data['SiteConfig'] = $this->siteConfigs;
  40. }
  41. $to = $this->siteConfigs['email'];
  42. $title = '【'.$this->siteConfigs['name'].'】コメントを受け付けました';
  43. $this->sendMail($to, $title, $data, array('template' => 'blog_comment'));
  44. }
  45. /**
  46. * beforeFilter
  47. *
  48. * @return void
  49. * @access public
  50. */
  51. function beforeFilter() {
  52. parent::beforeFilter();
  53. $user = $this->BcAuth->user();
  54. $userModel = $this->getUserModel();
  55. if(!$user || !$userModel) {
  56. return;
  57. }
  58. $newCatAddable = $this->BlogCategory->checkNewCategoryAddable(
  59. $user[$userModel]['user_group_id'],
  60. $this->checkRootEditable()
  61. );
  62. $this->set('newCatAddable', $newCatAddable);
  63. }
  64. }
  65. ?>