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-2012 Magic3 Project.
12 * @license http://www.gnu.org/copyleft/gpl.html GPL License
13 * @version SVN: $Id: admin_top_content_boxWidgetContainer.php 5169 2012-09-06 01:39:07Z fishbone $
14 * @link http://www.magic3.org
16 require_once($gEnvManager->getContainerPath() . '/baseAdminWidgetContainer.php');
18 class admin_top_content_boxWidgetContainer extends BaseAdminWidgetContainer
20 const DEFAULT_ITEM_COUNT = 10; // デフォルトの表示項目数
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 $itemCount = $request->valueOf('item_count'); // 表示項目数
60 if ($this->getMsgCount() == 0){ // エラーのないとき
61 $paramObj = new stdClass;
62 $paramObj->itemCount = $itemCount;
63 $ret = $this->updateWidgetParamObj($paramObj);
65 $this->setMsg(self::MSG_GUIDANCE, 'データを更新しました');
67 $this->setMsg(self::MSG_APP_ERR, 'データ更新に失敗しました');
69 $this->gPage->updateParentWindow();// 親ウィンドウを更新
73 $itemCount = self::DEFAULT_ITEM_COUNT; // 表示項目数
74 $paramObj = $this->getWidgetParamObj();
75 if (!empty($paramObj)){
76 $itemCount = $paramObj->itemCount;
81 $this->tmpl->addVar("_widget", "item_count", $itemCount);