7 * LICENSE: This source file is licensed under the terms of the GNU General Public License.
10 * @author 株式会社 毎日メディアサービス
11 * @copyright Copyright 2010 株式会社 毎日メディアサービス.
12 * @license http://www.gnu.org/copyleft/gpl.html GPL License
13 * @version SVN: $Id: admin_user_contentBaseWidgetContainer.php 3655 2010-10-01 07:16:39Z fishbone $
14 * @link http://www.m-media.co.jp
16 require_once($gEnvManager->getContainerPath() . '/baseAdminWidgetContainer.php');
17 require_once($gEnvManager->getCurrentWidgetDbPath() . '/user_contentDb.php');
19 class admin_user_contentBaseWidgetContainer extends BaseAdminWidgetContainer
21 protected $_localDb; // DB接続オブジェクト
22 protected $_itemTypeArray; // コンテンツ項目のデータタイプ
23 const DEFAULT_TOP_PAGE = 'content'; // デフォルトのトップページ
24 const WIDGET_TITLE_NAME = 'ユーザコンテンツ'; // ウィジェットタイトル名
29 function __construct()
32 parent::__construct();
35 $this->_localDb = new user_contentDb();
38 $this->_itemTypeArray = array( array( 'name' => 'HTML', 'value' => '0'),
39 array( 'name' => 'テキスト', 'value' => '1'),
40 array( 'name' => '数値', 'value' => '2'));
45 * _setTemplate()で指定したテンプレートファイルにデータを埋め込む。
47 * @param RequestManager $request HTTPリクエスト処理クラス
48 * @param object $param 任意使用パラメータ。_setTemplate()と共有。
51 function _postAssign($request, &$param)
54 $openBy = $request->trimValueOf(M3_REQUEST_PARAM_OPEN_BY); // ウィンドウオープンタイプ
55 if (!empty($openBy)) $this->addOptionUrlParam(M3_REQUEST_PARAM_OPEN_BY, $openBy);
56 if ($openBy == 'simple') return; // シンプルウィンドウのときはメニューを表示しない
59 $task = $request->trimValueOf(M3_REQUEST_PARAM_OPERATION_TASK);
60 if (empty($task)) $task = self::DEFAULT_TOP_PAGE;
64 case 'content': // コンテンツ管理
65 case 'content_detail': // コンテンツ管理(詳細)
66 $linkList = ' >> コンテンツ管理 >> コンテンツ部品一覧';// パンくずリスト
69 case 'room_detail': // ルーム管理(詳細)
70 $linkList = ' >> ルーム管理 >> ルーム一覧';// パンくずリスト
73 case 'tab_detail': // タブ定義(詳細)
74 $linkList = ' >> 基本設定 >> タブ定義';// パンくずリスト
76 case 'item': // コンテンツ項目
77 case 'item_detail': // コンテンツ項目(詳細)
78 $linkList = ' >> 基本設定 >> コンテンツ部品定義';// パンくずリスト
80 case 'category': // カテゴリ定義
81 case 'category_detail': // カテゴリ定義(詳細)
82 $linkList = ' >> 基本設定 >> カテゴリ定義';// パンくずリスト
85 case 'other': // その他設定
86 $linkList = ' >> 基本設定 >> その他';// パンくずリスト
89 // ####### 上段メニューの作成 #######
90 $menuText = '<div id="configmenu-upper">' . M3_NL;
91 $menuText .= '<ul>' . M3_NL;
92 $baseUrl = $this->getAdminUrlWithOptionParam(true);// 画面定義ID付き
96 $link = $baseUrl . '&task=content';
97 if ($task == 'content' ||
98 $task == 'content_detail'){
99 $current = 'id="current"';
101 $menuText .= '<li ' . $current . '><a href="'. $this->getUrl($link, true) .'"><span>コンテンツ管理</span></a></li>' . M3_NL;
105 $link = $baseUrl . '&task=room';
106 if ($task == 'room' ||
107 $task == 'room_detail'){
108 $current = 'id="current"';
110 $menuText .= '<li ' . $current . '><a href="'. $this->getUrl($link, true) .'"><span>ルーム管理</span></a></li>' . M3_NL;
114 $link = $baseUrl . '&task=other';
115 if ($task == 'tab' || // タブ定義
116 $task == 'tab_detail' || // タブ定義(詳細)
117 $task == 'item' || // コンテンツ項目
118 $task == 'item_detail' || // コンテンツ項目(詳細)
119 $task == 'category' || // カテゴリ定義
120 $task == 'category_detail' || // カテゴリ定義(詳細)
121 $task == 'other'){ // その他
122 $current = 'id="current"';
124 $menuText .= '<li ' . $current . '><a href="'. $this->getUrl($link, true) .'"><span>基本設定</span></a></li>' . M3_NL;
127 $menuText .= '</ul>' . M3_NL;
128 $menuText .= '</div>' . M3_NL;
130 // ####### 下段メニューの作成 #######
131 $menuText .= '<div id="configmenu-lower">' . M3_NL;
132 $menuText .= '<ul>' . M3_NL;
134 if ($task == 'content' ||
135 $task == 'content_detail'){ // コンテンツ管理
138 $link = $baseUrl . '&task=content';
139 if ($task == 'content' || $task == 'content_detail') $current = 'id="current"';
140 $menuText .= '<li ' . $current . '><a href="'. $this->getUrl($link, true) .'"><span>コンテンツ部品一覧</span></a></li>' . M3_NL;
141 } else if ($task == 'room' ||
142 $task == 'room_detail'){ // ルーム管理
145 $link = $baseUrl . '&task=room';
146 if ($task == 'room' || $task == 'room_detail') $current = 'id="current"';
147 $menuText .= '<li ' . $current . '><a href="'. $this->getUrl($link, true) .'"><span>ルーム一覧</span></a></li>' . M3_NL;
148 } else if ($task == 'tab' || // タブ定義
149 $task == 'tab_detail' || // タブ定義(詳細)
150 $task == 'item' || // コンテンツ項目
151 $task == 'item_detail' || // コンテンツ項目(詳細)
152 $task == 'category' || // カテゴリ定義
153 $task == 'category_detail' || // カテゴリ定義(詳細)
154 $task == 'other'){ // その他
158 $link = $baseUrl . '&task=item';
159 if ($task == 'item' || $task == 'item_detail') $current = 'id="current"';
160 $menuText .= '<li ' . $current . '><a href="'. $this->getUrl($link, true) .'"><span>コンテンツ部品定義</span></a></li>' . M3_NL;
164 $link = $baseUrl . '&task=tab';
165 if ($task == 'tab' || $task == 'tab_detail') $current = 'id="current"';
166 $menuText .= '<li ' . $current . '><a href="'. $this->getUrl($link, true) .'"><span>タブ定義</span></a></li>' . M3_NL;
170 $link = $baseUrl . '&task=category';
171 if ($task == 'category' || $task == 'category_detail') $current = 'id="current"';
172 $menuText .= '<li ' . $current . '><a href="'. $this->getUrl($link, true) .'"><span>カテゴリ定義</span></a></li>' . M3_NL;
176 $link = $baseUrl . '&task=other';
177 if ($task == 'other') $current = 'id="current"';
178 $menuText .= '<li ' . $current . '><a href="'. $this->getUrl($link, true) .'"><span>その他</span></a></li>' . M3_NL;
182 $menuText .= '</ul>' . M3_NL;
183 $menuText .= '</div>' . M3_NL;
186 $linkList = '<div id="configmenu-top"><label>' . self::WIDGET_TITLE_NAME . $linkList . '</div>';
187 $outputText .= '<table width="90%"><tr><td>' . $linkList . $menuText . '</td></tr></table>' . M3_NL;
188 $this->tmpl->addVar("_widget", "menu_items", $outputText);