OSDN Git Service

初回コミット(v2.6.17.1)
[magic3/magic3.git] / widgets / m / quizk / include / container / admin_m_quizkBaseWidgetContainer.php
1 <?php
2 /**
3  * コンテナクラス
4  *
5  * PHP versions 5
6  *
7  * LICENSE: This source file is licensed under the terms of the GNU General Public License.
8  *
9  * @package    Magic3 Framework
10  * @author     平田直毅(Naoki Hirata) <naoki@aplo.co.jp>
11  * @copyright  Copyright 2006-2009 Magic3 Project.
12  * @license    http://www.gnu.org/copyleft/gpl.html  GPL License
13  * @version    SVN: $Id: admin_m_quizkBaseWidgetContainer.php 2458 2009-10-24 07:26:44Z fishbone $
14  * @link       http://www.magic3.org
15  */
16 require_once($gEnvManager->getContainerPath() . '/baseAdminWidgetContainer.php');
17
18 class admin_m_quizkBaseWidgetContainer extends BaseAdminWidgetContainer
19 {
20         const DEFAULT_TASK = 'operation';               // デフォルトの画面
21
22         /**
23          * コンストラクタ
24          */
25         function __construct()
26         {
27                 // 親クラスを呼び出す
28                 parent::__construct();
29         }
30         /**
31          * テンプレートにデータ埋め込む
32          *
33          * _setTemplate()で指定したテンプレートファイルにデータを埋め込む。
34          *
35          * @param RequestManager $request               HTTPリクエスト処理クラス
36          * @param object         $param                 任意使用パラメータ。_setTemplate()と共有。
37          * @return                                                              なし
38          */
39         function _postAssign($request, &$param)
40         {
41                 // ウィンドウオープンタイプ取得
42                 $openBy = $request->trimValueOf(M3_REQUEST_PARAM_OPEN_BY);              // ウィンドウオープンタイプ
43                 if (!empty($openBy)) $this->addOptionUrlParam(M3_REQUEST_PARAM_OPEN_BY, $openBy);
44                                 
45                 // 表示画面を決定
46                 $task = $request->trimValueOf(M3_REQUEST_PARAM_OPERATION_TASK);
47                 if (empty($task)) $task = self::DEFAULT_TASK;           // デフォルト画面を設定
48                 
49                 // パンくずリストを作成
50                 $createList = true;             // パンくずリストを作成するかどうか
51                 switch ($task){
52                         case 'operation':                       // 運用管理
53                                 $linkList = ' &gt;&gt; 運用管理';// パンくずリスト
54                                 break;
55                         case 'csv':             // アンケートデータアップロード
56                                 $linkList = ' &gt;&gt; CSVデータ';// パンくずリスト
57                                 break;
58                         case 'total':                   // 集計画面
59                                 $linkList = ' &gt;&gt; 集計';// パンくずリスト
60                                 break;
61                         default:
62                                 break;
63                 }
64
65                 if ($createList){                               // パンくずリストを作成するとき
66                         // ####### 上段メニューの作成 #######
67                         $menuText = '<div id="configmenu-upper">' . M3_NL;
68                         $menuText .= '<ul>' . M3_NL;
69                 
70                         $current = '';
71                         $baseUrl = $this->getAdminUrlWithOptionParam(true);// 画面定義ID付き
72                 
73                         // 運用管理
74                         $current = '';
75                         $link = $baseUrl . '&task=operation';
76                         if ($task == 'operation'){
77                                 $current = 'id="current"';
78                         }
79                         $menuText .= '<li ' . $current . '><a href="'. $this->convertUrlToHtmlEntity($link) .'"><span>運用管理</span></a></li>' . M3_NL;
80                         
81                         // CSVデータ管理
82                         $current = '';
83                         $link = $baseUrl . '&task=csv';
84                         if ($task == 'csv'){
85                                 $current = 'id="current"';
86                         }
87                         $menuText .= '<li ' . $current . '><a href="'. $this->convertUrlToHtmlEntity($link) .'"><span>CSVデータ</span></a></li>' . M3_NL;
88                         
89                         // 集計
90                         /*$current = '';
91                         $link = $baseUrl . '&task=total';
92                         if ($task == 'total'){
93                                 $current = 'id="current"';
94                         }
95                         $menuText .= '<li ' . $current . '><a href="'. $this->convertUrlToHtmlEntity($link) .'"><span>集計</span></a></li>' . M3_NL;
96                         */
97                         
98                         // 上段メニュー終了
99                         $menuText .= '</ul>' . M3_NL;
100                         $menuText .= '</div>' . M3_NL;
101                 
102                         // 作成データの埋め込み
103                         $linkList = '<div id="configmenu-top"><label>' . '携帯クイズ' . $linkList . '</div>';
104                         $outputText .= '<table width="90%"><tr><td>' . $linkList . $menuText . '</td></tr></table>' . M3_NL;
105                         $this->tmpl->addVar("_widget", "menu_items", $outputText);
106                 } else {
107                         $this->tmpl->addVar("_widget", "menu_items", '');
108                 }
109         }
110 }
111 ?>