7 * LICENSE: This source file is licensed under the terms of the GNU General Public License.
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_default_login_boxWidgetContainer.php 5954 2013-04-21 03:55:07Z fishbone $
14 * @link http://www.magic3.org
16 require_once($gEnvManager->getContainerPath() . '/baseAdminWidgetContainer.php');
18 class admin_default_login_boxWidgetContainer extends BaseAdminWidgetContainer
20 const CF_AUTO_LOGIN = 'auto_login'; // 自動ログイン機能を使用するかどうか
25 function __construct()
28 parent::__construct();
33 * _assign()でデータを埋め込むテンプレートファイルのファイル名を返す。
34 * 読み込むディレクトリは、「自ウィジェットディレクトリ/include/template」に固定。
36 * @param RequestManager $request HTTPリクエスト処理クラス
37 * @param object $param 任意使用パラメータ。そのまま_assign()に渡る
38 * @return string テンプレートファイル名。テンプレートライブラリを使用しない場合は空文字列「''」を返す。
40 function _setTemplate($request, &$param)
42 return 'admin.tmpl.html';
47 * _setTemplate()で指定したテンプレートファイルにデータを埋め込む。
49 * @param RequestManager $request HTTPリクエスト処理クラス
50 * @param object $param 任意使用パラメータ。_setTemplate()と共有。
53 function _assign($request, &$param)
55 $act = $request->trimValueOf('act');
56 if ($act == 'update'){ // 設定更新のとき
58 $useAutoLogin = ($request->trimValueOf('item_use_auto_login') == 'on') ? 1 : 0; // 自動ログイン
60 if ($this->getMsgCount() == 0){ // エラーのないとき
61 $ret = $this->gSystem->updateSystemConfig(self::CF_AUTO_LOGIN, $useAutoLogin);
63 $this->setMsg(self::MSG_GUIDANCE, 'データを更新しました');
65 $this->setMsg(self::MSG_APP_ERR, 'データ更新に失敗しました');
67 $this->gPage->updateParentWindow();// 親ウィンドウを更新
71 $useAutoLogin = $this->gSystem->getSystemConfig(self::CF_AUTO_LOGIN);
75 if ($useAutoLogin) $checked = 'checked';
76 $this->tmpl->addVar("_widget", "use_auto_login", $checked);// 自動ログイン