PageRenderTime 48ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/baser/views/elements/admin/toolbar.php

https://github.com/hashing/basercms
PHP | 119 lines | 99 code | 2 blank | 18 comment | 24 complexity | 60e732a8fadd853acd01d67f0be53374 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. $publishTheme = $bcBaser->BcHtml->themeWeb;
  21. if($this->name != 'Installations' && !Configure::read('BcRequest.isUpdater')) {
  22. $bcBaser->BcHtml->themeWeb = 'themed/'.$bcBaser->siteConfig['admin_theme'].'/';
  23. $bcBaser->Javascript->themeWeb = 'themed/'.$bcBaser->siteConfig['admin_theme'].'/';
  24. }
  25. $bcBaser->js(array('outerClick','jquery.fixedMenu', 'yuga'));
  26. ?>
  27. <script type="text/javascript">
  28. $(function(){
  29. $('#UserMenu').fixedMenu();
  30. $('#SystemMenu h2').click(function(){
  31. if($(this).next().css('display')=='none') {
  32. $(this).next().slideDown(200);
  33. } else {
  34. $(this).next().slideUp(200);
  35. }
  36. });
  37. $('#SystemMenu ul:first').show();
  38. $("#UserMenu ul li div ul li").each(function(){
  39. if(!$(this).html()) {
  40. $(this).remove();
  41. }
  42. });
  43. });
  44. </script>
  45. <div id="ToolBar">
  46. <div id="ToolbarInner" class="clearfix">
  47. <div id="ToolMenu">
  48. <ul>
  49. <?php if($this->name == 'Installations'): ?>
  50. <li><?php $bcBaser->link('インストールマニュアル', 'http://basercms.net/manuals/introductions/4.html', array('target' => '_blank')) ?></li>
  51. <?php elseif(Configure::read('BcRequest.isUpdater')): ?>
  52. <li><?php $bcBaser->link('アップデートマニュアル', 'http://basercms.net/manuals/introductions/8.html', array('target' => '_blank')) ?></li>
  53. <?php elseif(empty($this->params['admin'])): ?>
  54. <li><?php $bcBaser->link($bcBaser->getImg('admin/btn_logo.png', array('alt' => 'baserCMS管理システム', 'class' => 'btn')), '/admin', array('title' => 'baserCMS管理システム')) ?></li>
  55. <?php else: ?>
  56. <li><?php $bcBaser->link($bcBaser->siteConfig['name'], '/') ?></li>
  57. <?php endif ?>
  58. <?php if($bcBaser->existsEditLink()): ?>
  59. <li><?php $bcBaser->editLink() ?></li>
  60. <?php endif ?>
  61. <?php if($bcBaser->existsPublishLink()): ?>
  62. <li><?php $bcBaser->publishLink() ?></li>
  63. <?php endif ?>
  64. <?php if(!empty($this->params['admin']) && $this->params['url']['url'] != 'admin/users/login'): ?>
  65. <?php if(Configure::read('debug') == -1): ?>
  66. <li>&nbsp;&nbsp;<span class="corner5" id="DebugMode" title="インストールモードです。運営を開始する前にシステム設定よりノーマルモードに戻しましょう。">インストールモード</span>&nbsp;&nbsp;</li>
  67. <?php elseif(Configure::read('debug') > 0): ?>
  68. <li>&nbsp;&nbsp;<span class="corner5" id="DebugMode" title="デバッグモードです。運営を開始する前にシステム設定よりノーマルモードに戻しましょう。">デバッグモード<?php echo mb_convert_kana(Configure::read('debug'), 'N') ?></span>&nbsp;&nbsp;</li>
  69. <?php endif; ?>
  70. <?php endif ?>
  71. </ul>
  72. </div>
  73. <div id="UserMenu">
  74. <ul class="clearfix">
  75. <li>
  76. <?php if(!empty($user)): ?>
  77. <?php $bcBaser->link($user['real_name_1']." ".$user['real_name_2'].' '.$bcBaser->getImg('admin/btn_dropdown.png', array('width' => 8, 'height' => 11, 'class' => 'btn')), 'javascript:void(0)', array('class' => 'title')) ?>
  78. <ul>
  79. <?php if($session->check('AuthAgent')): ?>
  80. <li><?php $bcBaser->link('元のユーザーに戻る', array('admin' => true, 'plugin' => null, 'controller' => 'users', 'action' => 'back_agent')) ?></li>
  81. <?php endif ?>
  82. <li><?php $bcBaser->link('アカウント設定', array('admin' => true, 'plugin' => null, 'controller' => 'users', 'action' => 'edit', $user['id'])) ?></li>
  83. <li><?php $bcBaser->link('ログアウト', array('admin' => true, 'plugin' => null, 'controller' => 'users', 'action' => 'logout')) ?></li>
  84. </ul>
  85. <?php elseif($this->name != 'Installations' && $this->params['url']['url'] != 'admin/users/login' && !Configure::read('BcRequest.isUpdater')): ?>
  86. <?php $bcBaser->link('ログインしていません '.$bcBaser->getImg('admin/btn_dropdown.png', array('width' => 8, 'height' => 11, 'class' => 'btn')), 'javascript:void(0)', array('class' => 'title')) ?>
  87. <ul>
  88. <li><?php $bcBaser->link('ログイン', array('admin' => true, 'plugin' => null, 'controller' => 'users', 'action' => 'login')) ?></li>
  89. </ul>
  90. <?php endif ?>
  91. </li>
  92. <?php if(!empty($user)): ?>
  93. <li>
  94. <?php $bcBaser->link('システムナビ'.' '.$bcBaser->getImg('admin/btn_dropdown.png', array('width' => 8, 'height' => 11, 'class' => 'btn')), 'javascript:void(0)', array('class' => 'title')) ?>
  95. <div id="SystemMenu"><div>
  96. <?php $adminSitemap = Configure::read('BcApp.adminNavi') ?>
  97. <?php foreach($adminSitemap as $key => $package): ?>
  98. <?php if(empty($package['name'])): ?>
  99. <?php $package['name'] = $key ?>
  100. <?php endif ?>
  101. <h2><?php echo $package['name'] ?></h2>
  102. <?php if(!empty($package['contents'])): ?>
  103. <ul class="clearfix">
  104. <?php foreach($package['contents'] as $contents): ?>
  105. <li><?php $bcBaser->link($contents['name'], $contents['url'], array('title' => $contents['name'])) ?></li>
  106. <?php endforeach ?>
  107. </ul>
  108. <?php endif ?>
  109. <?php endforeach ?>
  110. </div></div>
  111. </li>
  112. <?php endif ?>
  113. </ul>
  114. </div>
  115. </div>
  116. </div>
  117. <?php $bcBaser->BcHtml->themeWeb = $publishTheme ?>