OSDN Git Service

初回コミット(v2.6.17.1)
[magic3/magic3.git] / widgets / admin_main / include / container / admin_mainUserBaseWidgetContainer.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-2013 Magic3 Project.
12  * @license    http://www.gnu.org/copyleft/gpl.html  GPL License
13  * @version    SVN: $Id: admin_mainUserBaseWidgetContainer.php 5814 2013-03-11 10:22:45Z fishbone $
14  * @link       http://www.magic3.org
15  */
16 require_once($gEnvManager->getCurrentWidgetContainerPath() .    '/admin_mainBaseWidgetContainer.php');
17 require_once($gEnvManager->getCurrentWidgetDbPath() . '/admin_mainDb.php');
18
19 class admin_mainUserBaseWidgetContainer extends admin_mainBaseWidgetContainer
20 {
21         protected $_mainDb;                     // DB接続オブジェクト
22         const TASK_USERLIST             = 'userlist';           // ユーザ一覧
23         const TASK_USERLIST_DETAIL = 'userlist_detail'; // ユーザ詳細
24         const TASK_USERGROUP    = 'usergroup';          // ユーザグループ
25         const DEFAULT_TOP_PAGE = 'userlist';            // デフォルトのトップ画面
26         
27         /**
28          * コンストラクタ
29          */
30         function __construct()
31         {
32                 // 親クラスを呼び出す
33                 parent::__construct();
34                 
35                 $this->_mainDb = new admin_mainDb();
36         }
37         /**
38          * テンプレートにデータ埋め込む
39          *
40          * _setTemplate()で指定したテンプレートファイルにデータを埋め込む。
41          *
42          * @param RequestManager $request               HTTPリクエスト処理クラス
43          * @param object         $param                 任意使用パラメータ。_setTemplate()と共有。
44          * @return                                                              なし
45          */
46         function _postAssign($request, &$param)
47         {
48                 // 表示画面を決定
49                 $task = $request->trimValueOf(M3_REQUEST_PARAM_OPERATION_TASK);
50                 if (empty($task)) $task = self::DEFAULT_TOP_PAGE;
51                 
52                 // パンくずリストを作成
53                 switch ($task){
54                         case self::TASK_USERLIST:       // ユーザ一覧
55                         case self::TASK_USERLIST_DETAIL:        // ユーザ詳細
56                                 $linkList = ' &gt;&gt; ユーザ一覧';
57                                 break;
58                         case self::TASK_USERGROUP:      // ユーザグループ
59                                 $linkList = ' &gt;&gt; ユーザグループ';
60                                 break;
61                 }
62                                 
63                 // ####### 上段メニューの作成 #######
64                 $menuText = '<div id="configmenu-upper">' . M3_NL;
65                 $menuText .= '<ul>' . M3_NL;
66                 
67                 $current = '';
68                 $link = $this->gEnv->getDefaultAdminUrl() . '?' . M3_REQUEST_PARAM_OPERATION_COMMAND . '=' . M3_REQUEST_CMD_CONFIG_WIDGET . 
69                                 '&' . M3_REQUEST_PARAM_WIDGET_ID . '=' . $this->gEnv->getCurrentWidgetId();
70                                 
71                 // ### ユーザ一覧 ###
72                 $current = '';
73                 $link = $this->gEnv->getDefaultAdminUrl() . '?' . 'task=' . self::TASK_USERLIST;
74                 if ($task == self::TASK_USERLIST ||
75                         $task == self::TASK_USERLIST_DETAIL){   // ユーザ詳細
76                         $current = 'id="current"';
77                 }
78                 // ヘルプを作成
79                 $helpText = $this->gInstance->getHelpManager()->getHelpText(self::TASK_USERLIST);
80                 $menuText .= '<li ' . $current . '><a href="'. $this->getUrl($link) .'"><span ' . $helpText . '>ユーザ一覧</span></a></li>' . M3_NL;
81                 
82                 // ### ユーザグループ ###
83                 $current = '';
84                 $link = $this->gEnv->getDefaultAdminUrl() . '?' . 'task=' . self::TASK_USERGROUP;
85                 if ($task == self::TASK_USERGROUP){
86                         $current = 'id="current"';
87                 }
88                 // ヘルプを作成
89                 $helpText = $this->gInstance->getHelpManager()->getHelpText(self::TASK_USERGROUP);
90                 $menuText .= '<li ' . $current . '><a href="'. $this->getUrl($link) .'"><span ' . $helpText . '>ユーザグループ</span></a></li>' . M3_NL;
91                 
92                 // 上段メニュー終了
93                 $menuText .= '</ul>' . M3_NL;
94                 $menuText .= '</div>' . M3_NL;
95                 
96                 // 作成データの埋め込み
97                 $linkList = '<div id="configmenu-top"><label>' . 'ユーザ管理' . $linkList . '</div>';
98                 $outputText .= '<table width="90%"><tr><td>' . $linkList . $menuText . '</td></tr></table>' . M3_NL;
99                 $this->tmpl->addVar("_widget", "menu_items", $outputText);
100         }
101 }
102 ?>