OSDN Git Service

初回コミット(v2.6.17.1)
[magic3/magic3.git] / widgets / ec_menu / include / container / admin_ec_menuBaseWidgetContainer.php
1 <?php
2 /**
3  * index.php用コンテナクラス
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-2012 Magic3 Project.
12  * @license    http://www.gnu.org/copyleft/gpl.html  GPL License
13  * @version    SVN: $Id: admin_ec_menuBaseWidgetContainer.php 5562 2013-01-18 03:49:58Z fishbone $
14  * @link       http://www.magic3.org
15  */
16 require_once($gEnvManager->getContainerPath() . '/baseAdminWidgetContainer.php');
17
18 class admin_ec_menuBaseWidgetContainer extends BaseAdminWidgetContainer
19 {
20         const DEFAULT_TASK = 'menudef';
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                 switch ($task){
51                         case 'menudef':         // メニュー定義
52                         case 'menudef_detail':          // メニュー定義詳細
53                                 $linkList = ' &gt;&gt; メニュー定義';// パンくずリスト
54                                 break;
55                         case 'other':           // その他
56                                 $linkList = ' &gt;&gt; その他';// パンくずリスト
57                                 break;
58                 }
59
60                 // ####### 上段メニューの作成 #######
61                 $menuText = '<div id="configmenu-upper">' . M3_NL;
62                 $menuText .= '<ul>' . M3_NL;
63         
64                 $current = '';
65                 $baseUrl = $this->getAdminUrlWithOptionParam(true);// 画面定義ID付き
66         
67                 // メニュー定義
68                 $current = '';
69                 $link = $this->getUrl($baseUrl . '&task=menudef');
70                 if ($task == 'menudef' ||
71                         $task == 'menudef_detail'){
72                         $current = 'id="current"';
73                 }
74                 $menuText .= '<li ' . $current . '><a href="'. $this->convertUrlToHtmlEntity($link) .'"><span>メニュー定義</span></a></li>' . M3_NL;
75         
76                 // その他設定
77                 $current = '';
78                 $link = $this->getUrl($baseUrl . '&task=other');
79                 if ($task == 'other'){          // その他設定
80                         $current = 'id="current"';
81                 }
82                 $menuText .= '<li ' . $current . '><a href="'. $this->convertUrlToHtmlEntity($link) .'"><span>その他</span></a></li>' . M3_NL;
83         
84                 // 上段メニュー終了
85                 $menuText .= '</ul>' . M3_NL;
86                 $menuText .= '</div>' . M3_NL;
87         
88                 // 作成データの埋め込み
89                 $linkList = '<div id="configmenu-top"><label>' . '商品メニュー' . $linkList . '</label></div>';
90                 $outputText .= '<table width="90%"><tr><td>' . $linkList . $menuText . '</td></tr></table>' . M3_NL;
91                 $this->tmpl->addVar("_widget", "menu_items", $outputText);
92         }
93 }
94 ?>