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

/baser/views/helpers/bc_admin.php

https://github.com/hashing/basercms
PHP | 69 lines | 20 code | 3 blank | 46 comment | 4 complexity | bd7845d6a6ae4399121826f9ec29ba3e MD5 | raw file
Possible License(s): MIT
  1. <?php
  2. /* SVN FILE: $Id$ */
  3. /**
  4. * BcAdminヘルパー
  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 cake
  14. * @subpackage baser.app.view.helpers
  15. * @since baserCMS v 0.1.0
  16. * @version $Revision$
  17. * @modifiedby $LastChangedBy$
  18. * @lastmodified $Date$
  19. * @license http://basercms.net/license/index.html
  20. */
  21. /**
  22. * Include files
  23. */
  24. /**
  25. * BcAdminヘルパー
  26. *
  27. * @package cake
  28. * @subpackage baser.app.views.helpers
  29. */
  30. class BcAdminHelper extends AppHelper {
  31. /**
  32. * View
  33. *
  34. * @var View
  35. * @access protected
  36. */
  37. var $_view = null;
  38. /**
  39. * コンストラクタ
  40. *
  41. * @return void
  42. * @access public
  43. */
  44. function __construct() {
  45. $this->_view =& ClassRegistry::getObject('view');
  46. }
  47. /**
  48. * 管理システムグローバルメニューの利用可否確認
  49. *
  50. * @return boolean
  51. * @access public
  52. */
  53. function isAdminGlobalmenuUsed() {
  54. if(!BC_INSTALLED) {
  55. return false;
  56. }
  57. if(Configure::read('BcRequest.isUpdater')) {
  58. return false;
  59. }
  60. if(empty($this->params['admin']) && !empty($this->_view->viewVars['user'])) {
  61. return false;
  62. }
  63. $UserGroup = ClassRegistry::getObject('UserGroup');
  64. return $UserGroup->isAdminGlobalmenuUsed($this->_view->viewVars['user']['user_group_id']);
  65. }
  66. }