OSDN Git Service

管理画面ダッシュボードのユーザ情報ウィジェットをBootstrapに対応。 v2.7.25
authornaoki hirata <naoki@magic3.org>
Fri, 10 Jan 2014 12:08:25 +0000 (21:08 +0900)
committernaoki hirata <naoki@magic3.org>
Fri, 10 Jan 2014 12:08:25 +0000 (21:08 +0900)
include/global.php
include/manager/envManager.php
include/manager/pageManager.php
widgets/admin/loginuser/include/container/admin_loginuserWidgetContainer.php
widgets/admin/loginuser/include/template/index_bs.tmpl.html [new file with mode: 0644]
widgets/admin_main/include/template/menu_bs.tmpl.html

index d827c61..1da4d14 100644 (file)
@@ -10,7 +10,7 @@
  *
  * @package    Magic3 Framework
  * @author     平田直毅(Naoki Hirata) <naoki@aplo.co.jp>
- * @copyright  Copyright 2006-2013 Magic3 Project.
+ * @copyright  Copyright 2006-2014 Magic3 Project.
  * @license    http://www.gnu.org/copyleft/gpl.html  GPL License
  * @version    Release 2.7.x SVN: $Id$
  * @link       http://www.magic3.org
@@ -48,8 +48,8 @@ define('M3_ENCODING', 'UTF-8');       // 内部エンコーディング
 // ########## システム関係 ##########
 // システム基本情報
 define('M3_SYSTEM_NAME',                       'Magic3');              // システム名称
-define('M3_SYSTEM_VERSION',                    '2.7.24');              // システムのバージョン
-define('M3_SYSTEM_RELEASE_DATE',       '2013/12/30');  // システムのリリース日付
+define('M3_SYSTEM_VERSION',                    '2.7.25');              // システムのバージョン
+define('M3_SYSTEM_RELEASE_DATE',       '2014/1/9');    // システムのリリース日付
 define('M3_SYSTEM_ID',                         'M3');                  // コンポーネント識別用ID
 define('M3_SYSTEM_DESCRIPTION',                'Magic3 is open source cms and web communication platform.');           // システムの説明
 define('M3_SYSTEM_MIN_MEMORY',         '16M');                 // 最小メモリ使用量
index 852f583..b51b3cd 100644 (file)
@@ -1119,6 +1119,8 @@ class EnvManager extends Core
         */
        public function setCurrentTemplateId($name)
        {
+               global $gPageManager;
+               
                $this->currentTemplateId = $name;
 
                // テンプレートの属性を取得
@@ -1130,6 +1132,9 @@ class EnvManager extends Core
                                $this->currentTemplateType = $row['tm_type'];           // テンプレートタイプ
                                $this->currentTemplateCleanType = $row['tm_clean_type'];        // 現在のテンプレートのクリーンタイプ
                                $this->currentTemplateUseBootstrap = $row['tm_use_bootstrap'];  // 現在のテンプレートでBootstrapライブラリを使用するかどうか
+                               
+                               // テンプレートが設定された段階でBootstrapの使用があればページマネージャーに反映する。ウィジェット側で使用状況を参照してビューを作成することがあるため。
+                               if ($this->currentTemplateUseBootstrap) $gPageManager->useBootstrap();
                        }
                }
        }
index 62e416d..b6f383d 100644 (file)
@@ -213,7 +213,7 @@ class PageManager extends Core
                                $this->wysiwygEditor = ScriptLibInfo::LIB_FCKEDITOR;                            // FCKEditorに固定
                        }
                        
-                       // 管理画面にBOOTSTRAPを使用するかどうか
+                       // 管理画面にBOOTSTRAPを使用するかどうか(初期値)
                        $this->useBootstrap = self::USE_BOOTSTRAP_ADMIN;
                } else {
                        $value = $gSystemManager->getSystemConfig(self::CF_JQUERY_VERSION);// jQueryバージョン
@@ -2571,7 +2571,7 @@ class PageManager extends Core
                // ********************************************************
                // ##### テンプレートの設定、フレームの設定から必要なライブラリを取得 #####
                // Bootstrapライブラリ
-               if (!$this->useBootstrap) $this->useBootstrap = $gEnvManager->getCurrentTemplateUseBootstrap();
+//             if (!$this->useBootstrap) $this->useBootstrap = $gEnvManager->getCurrentTemplateUseBootstrap();
                if ($this->useBootstrap){
                        if ($gEnvManager->isAdminDirAccess()){
                                if ($gEnvManager->isSystemManageUser()){                // システム運用権限がある場合のみ有効(ログイン中の場合)
index 5dfc6f8..42bec87 100644 (file)
@@ -8,9 +8,9 @@
  *
  * @package    Magic3 Framework
  * @author     平田直毅(Naoki Hirata) <naoki@aplo.co.jp>
- * @copyright  Copyright 2006-2013 Magic3 Project.
+ * @copyright  Copyright 2006-2014 Magic3 Project.
  * @license    http://www.gnu.org/copyleft/gpl.html  GPL License
- * @version    SVN: $Id: admin_loginuserWidgetContainer.php 5816 2013-03-11 13:24:26Z fishbone $
+ * @version    SVN: $Id$
  * @link       http://www.magic3.org
  */
 require_once($gEnvManager->getContainerPath() . '/baseAdminWidgetContainer.php');
@@ -20,6 +20,7 @@ class admin_loginuserWidgetContainer extends BaseWidgetContainer
 {
        private $db;                    // DB接続オブジェクト
        private $langId;                // 言語
+       private $useBootstrap;
        const DEFAULT_TITLE = 'ログインユーザ';          // デフォルトのウィジェットタイトル名
 //     const ICON_SIZE = 128;          // アイコンのサイズ
                
@@ -33,6 +34,8 @@ class admin_loginuserWidgetContainer extends BaseWidgetContainer
                
                // DBオブジェクト作成
                $this->db = new admin_loginuserDb();
+               
+               $this->useBootstrap = $this->gPage->getUseBootstrap();
        }
        /**
         * テンプレートファイルを設定
@@ -46,7 +49,11 @@ class admin_loginuserWidgetContainer extends BaseWidgetContainer
         */
        function _setTemplate($request, &$param)
        {
-               return 'index.tmpl.html';
+               if ($this->useBootstrap){
+                       return 'index_bs.tmpl.html';
+               } else {
+                       return 'index.tmpl.html';
+               }
        }
        /**
         * テンプレートにデータ埋め込む
@@ -105,5 +112,25 @@ class admin_loginuserWidgetContainer extends BaseWidgetContainer
        {
                return self::DEFAULT_TITLE;
        }
+       /**
+        * CSSファイルをHTMLヘッダ部に設定
+        *
+        * CSSファイルをHTMLのheadタグ内に追加出力する。
+        * _assign()よりも後に実行される。
+        *
+        * @param RequestManager $request               HTTPリクエスト処理クラス
+        * @param object         $param                 任意使用パラメータ。
+        * @return string                                               CSS文字列。出力しない場合は空文字列を設定。
+        */
+       function _addCssFileToHead($request, &$param)
+       {
+               // Bootstrapを使用する場合はjQueryUIテーマを使用しない
+               $useBootstrap = $this->gPage->getUseBootstrap();
+               if ($useBootstrap){
+                       return '';
+               } else {
+                       return array($this->getUrl($this->gEnv->getAdminDefaultThemeUrl()));
+               }
+       }
 }
 ?>
diff --git a/widgets/admin/loginuser/include/template/index_bs.tmpl.html b/widgets/admin/loginuser/include/template/index_bs.tmpl.html
new file mode 100644 (file)
index 0000000..de45624
--- /dev/null
@@ -0,0 +1,29 @@
+/**
+ * 表示データ作成用テンプレート(patTemplate)
+ *
+ * LICENSE: This source file is licensed under the terms of the GNU General Public License.
+ *
+ * @package    Magic3 Framework
+ * @author     平田直毅(Naoki Hirata) <naoki@aplo.co.jp>
+ * @copyright  Copyright 2006-2014 Magic3 Project.
+ * @license    http://www.gnu.org/copyleft/gpl.html  GPL License
+ * @version    SVN: $Id$
+ * @link       http://www.magic3.org
+ */
+<patTemplate:tmpl name="_widget">
+<div class="col-sm-3">
+<div class="hero-widget well well-sm">
+<div class="icon">
+<i class="glyphicon glyphicon-user"></i>
+</div>
+<div class="text">
+<var>3</var>
+<label class="text-muted">invited guests</label>
+</div>
+</div>
+</div>
+<div style="text-align:center;"><a href="{USER_DETAIL_URL}">{AVATAR_IMAGE}</a></div>
+<div>名前:<a href="{USER_DETAIL_URL}">{NAME}</a></div>
+<div>前回ログイン:{LOGIN_DT}</div>
+<div>ログイン回数:<a href="{LOGIN_STATUS_URL}">{LOGIN_COUNT}</a></div>
+</patTemplate:tmpl>
index a30590a..f883574 100644 (file)
@@ -11,7 +11,7 @@
  * @link       http://www.magic3.org
  */
 <patTemplate:tmpl name="_widget">
-<div class="panel panel-success" style="width:300px;margin:0 auto;" >
+<div class="panel panel-info" style="width:300px;margin:0 auto;" >
     <div class="panel-heading"><span >システム制御</span></div>
     <ul class="list-group">
         <li class="list-group-item"><a href="?task=initwizard" ><span >システム初期化ウィザード</span></a></li>