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_exchange_classrateWidgetContainer.php 5437 2012-12-07 13:14:59Z fishbone $
14 * @link http://www.magic3.org
16 require_once($gEnvManager->getContainerPath() . '/baseIWidgetContainer.php');
18 class admin_exchange_classrateWidgetContainer extends BaseIWidgetContainer
23 function __construct()
26 parent::__construct();
31 * _assign()でデータを埋め込むテンプレートファイルのファイル名を返す。
32 * 読み込むディレクトリは、「自ウィジェットディレクトリ/include/template」に固定。
34 * @param RequestManager $request HTTPリクエスト処理クラス
35 * @param string $act 実行処理
36 * @param object $configObj 定義情報オブジェクト
37 * @param object $optionObj 可変パラメータオブジェクト
38 * @return string テンプレートファイル名。テンプレートライブラリを使用しない場合は空文字列「''」を返す。
40 function _setTemplate($request, $act, $configObj, $optionObj)
42 return 'admin.tmpl.html';
47 * _setTemplate()で指定したテンプレートファイルにデータを埋め込む。
49 * @param RequestManager $request HTTPリクエスト処理クラス
50 * @param string $act 実行処理
51 * @param object $configObj 定義情報オブジェクト
52 * @param object $optionObj 可変パラメータオブジェクト
55 function _assign($request, $act, $configObj, $optionObj)
58 $id = $optionObj->id; // ユニークなID(配送方法ID)
59 $init = $optionObj->init; // データ初期化を行うかどうか
62 $priceTable = $request->trimValueOf('iw_table'); // 料金表
64 if ($act == 'update'){ // 設定更新のとき
67 if ($this->getMsgCount() == 0){ // エラーのないとき
68 $configObj->table = $priceTable; // 料金表
69 $ret = $this->updateConfigObj($configObj);
70 if (!$ret) $this->setMsg(self::MSG_APP_ERR, 'インナーウィジェットデータの更新に失敗しました');
71 // ***** 正常に終了した場合はメッセージを残さない *****
73 } else if ($act == 'content'){ // 画面表示のとき
74 if (!empty($init)){ // 初期表示のとき
75 if (empty($configObj)){ // 定義値がないとき(管理画面なので最初は定義値が存在しない)
76 $priceTable = '5000:400;10000:300;20000:100;:0';
78 $priceTable = $configObj->table; // 定額料金
82 $this->tmpl->addVar("_widget", "price_table", $priceTable);