OSDN Git Service

テスト用画面更新。
authornaoki hirata <naoki@magic3.org>
Mon, 3 Feb 2014 13:06:54 +0000 (22:06 +0900)
committernaoki hirata <naoki@magic3.org>
Mon, 3 Feb 2014 13:06:54 +0000 (22:06 +0900)
widgets/admin_main/include/container/admin_mainTestWidgetContainer.php
widgets/admin_main/include/container/admin_mainTest_bootstrapWidgetContainer.php [new file with mode: 0644]
widgets/admin_main/include/template/test_bootstrap.tmpl.html [new file with mode: 0644]

index 500034d..1bbda36 100644 (file)
@@ -8,7 +8,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    SVN: $Id$
  * @link       http://www.magic3.org
@@ -34,6 +34,26 @@ class admin_mainTestWidgetContainer extends admin_mainBaseWidgetContainer
                $this->db = new admin_mainDb();
        }
        /**
+        * ディスパッチ処理
+        *
+     * HTTPリクエストの内容を見て処理をコンテナに振り分ける
+        *
+        * @param RequestManager $request               HTTPリクエスト処理クラス
+        * @param object         $param                 任意使用パラメータ。そのまま_assign()に渡る
+        * @return bool                                                 このクラスの_setTemplate(), _assign()へ処理を継続するかどうかを返す。
+        *                                      true=処理を継続、false=処理を終了
+        */
+       function _dispatch($request, &$param)
+       {
+               $task = $request->trimValueOf(M3_REQUEST_PARAM_OPERATION_TASK);
+               if ($task == 'test'){
+                       return true;
+               } else {
+                       $this->gLaunch->goSubWidget($task);
+                       return false;
+               }
+       }
+       /**
         * テンプレートファイルを設定
         *
         * _assign()でデータを埋め込むテンプレートファイルのファイル名を返す。
diff --git a/widgets/admin_main/include/container/admin_mainTest_bootstrapWidgetContainer.php b/widgets/admin_main/include/container/admin_mainTest_bootstrapWidgetContainer.php
new file mode 100644 (file)
index 0000000..12a7768
--- /dev/null
@@ -0,0 +1,61 @@
+<?php
+/**
+ * コンテナクラス
+ *
+ * PHP versions 5
+ *
+ * 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
+ */
+require_once($gEnvManager->getCurrentWidgetContainerPath() .   '/admin_mainBaseWidgetContainer.php');
+require_once($gEnvManager->getCurrentWidgetDbPath() . '/admin_mainDb.php');
+
+class admin_mainTest_bootstrapWidgetContainer extends admin_mainBaseWidgetContainer
+{
+       private $db;    // DB接続オブジェクト
+               
+       /**
+        * コンストラクタ
+        */
+       function __construct()
+       {
+               // 親クラスを呼び出す
+               parent::__construct();
+               
+               // DB接続オブジェクト作成
+               $this->db = new admin_mainDb();
+       }
+       /**
+        * テンプレートファイルを設定
+        *
+        * _assign()でデータを埋め込むテンプレートファイルのファイル名を返す。
+        * 読み込むディレクトリは、「自ウィジェットディレクトリ/include/template」に固定。
+        *
+        * @param RequestManager $request               HTTPリクエスト処理クラス
+        * @param object         $param                 任意使用パラメータ。そのまま_assign()に渡る
+        * @return string                                               テンプレートファイル名。テンプレートライブラリを使用しない場合は空文字列「''」を返す。
+        */
+       function _setTemplate($request, &$param)
+       {       
+               return 'test_bootstrap.tmpl.html';
+       }
+       /**
+        * テンプレートにデータ埋め込む
+        *
+        * _setTemplate()で指定したテンプレートファイルにデータを埋め込む。
+        *
+        * @param RequestManager $request               HTTPリクエスト処理クラス
+        * @param object         $param                 任意使用パラメータ。_setTemplate()と共有。
+        * @param                                                               なし
+        */
+       function _assign($request, &$param)
+       {
+       }
+}
+?>
diff --git a/widgets/admin_main/include/template/test_bootstrap.tmpl.html b/widgets/admin_main/include/template/test_bootstrap.tmpl.html
new file mode 100644 (file)
index 0000000..b69eea3
--- /dev/null
@@ -0,0 +1,76 @@
+/**
+ * 表示データ作成用テンプレート(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">
+<script type="text/javascript">
+//<![CDATA[
+$(function(){
+    $('#accordion .panel-collapse').on('shown.bs.collapse', function (n){
+          $(n.target).siblings('.panel-heading').find('.glyphicon').removeClass("glyphicon-chevron-down").addClass("glyphicon-chevron-up");
+    });
+    $('#accordion .panel-collapse').on('hidden.bs.collapse', function (n){
+       $(n.target).siblings('.panel-heading').find('.glyphicon').removeClass("glyphicon-chevron-up").addClass("glyphicon-chevron-down");
+    });
+});
+//]]>
+</script>
+
+<div class="row">
+<div class="col-lg-6">
+<div class="panel-group" id="accordion" >
+  <label for="pageid">ページ:</label>
+  <div class="panel panel-default" id="pageid" >
+    <div class="panel-heading" data-toggle="collapse" data-parent="#accordion" data-target="#collapseOne" >
+      <h4 class="panel-title">
+        <!--<a class="accordion-toggle">-->
+          Collapsible Group Item #1<i class="indicator glyphicon glyphicon-chevron-up"></i>
+        <!--</a>-->
+      </h4>
+    </div>
+    <div id="collapseOne" class="panel-collapse collapse in">
+      <div class="panel-body">
+        Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
+      </div>
+    </div>
+  </div>
+  <div class="panel panel-default">
+    <div class="panel-heading">
+      <h4 class="panel-title"  data-toggle="collapse" data-parent="#accordion" data-target="#collapseTwo">
+        <a class="accordion-toggle">
+          Collapsible Group Item #2<i class="indicator glyphicon glyphicon-chevron-down pull-right"></i>
+        </a>
+      </h4>
+    </div>
+    <div id="collapseTwo" class="panel-collapse collapse">
+      <div class="panel-body">
+        Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
+      </div>
+    </div>
+  </div>
+  <div class="panel panel-default">
+    <div class="panel-heading">
+      <h4 class="panel-title" data-toggle="collapse" data-parent="#accordion" data-target="#collapseThree">
+        <a class="accordion-toggle">
+          Collapsible Group Item #3
+        </a>
+      </h4>
+    </div>
+    <div id="collapseThree" class="panel-collapse collapse">
+      <div class="panel-body">
+        Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
+      </div>
+    </div>
+  </div>
+</div>
+</div>
+</div>
+</patTemplate:tmpl>
\ No newline at end of file