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_chacha_mainOtherWidgetContainer.php 3238 2010-06-14 05:05:09Z fishbone $
14 * @link http://www.m-media.co.jp
16 require_once($gEnvManager->getCurrentWidgetContainerPath() . '/admin_chacha_mainBaseWidgetContainer.php');
18 class admin_chacha_mainOtherWidgetContainer extends admin_chacha_mainBaseWidgetContainer
23 function __construct()
26 parent::__construct();
31 * _assign()でデータを埋め込むテンプレートファイルのファイル名を返す。
32 * 読み込むディレクトリは、「自ウィジェットディレクトリ/include/template」に固定。
34 * @param RequestManager $request HTTPリクエスト処理クラス
35 * @param object $param 任意使用パラメータ。そのまま_assign()に渡る
36 * @return string テンプレートファイル名。テンプレートライブラリを使用しない場合は空文字列「''」を返す。
38 function _setTemplate($request, &$param)
40 return 'admin_other.tmpl.html';
45 * _setTemplate()で指定したテンプレートファイルにデータを埋め込む。
47 * @param RequestManager $request HTTPリクエスト処理クラス
48 * @param object $param 任意使用パラメータ。_setTemplate()と共有。
51 function _assign($request, &$param)
53 $defaultLang = $this->gEnv->getDefaultLanguage();
54 $act = $request->trimValueOf('act');
56 $textColor = $request->trimValueOf('text_color'); // 文字色
57 $bgColor = $request->trimValueOf('bg_color'); // 背景色
58 $innerBgColor = $request->trimValueOf('inner_bg_color'); // 内枠背景色
59 $profileColor = $request->trimValueOf('profile_color'); // プロフィール背景色
60 $errMessageColor = $request->trimValueOf('err_message_color'); // エラーメッセージ文字色
61 $messageLength = $request->trimValueOf('message_length'); // 投稿文最大長
62 $topContents = $request->valueOf('top_contents'); // トップコンテンツ
64 $reloadData = false; // データの再読み込み
65 if ($act == 'update'){ // 設定更新のとき
68 if ($this->getMsgCount() == 0){ // エラーのないとき
70 if ($ret) $this->_db->updateConfig(self::CF_TEXT_COLOR, $textColor, $this->_boardId); // 文字色
71 if ($ret) $this->_db->updateConfig(self::CF_BG_COLOR, $bgColor, $this->_boardId); // 背景色
72 if ($ret) $this->_db->updateConfig(self::CF_INNER_BG_COLOR, $innerBgColor, $this->_boardId); // 内枠背景色
73 if ($ret) $this->_db->updateConfig(self::CF_PROFILE_COLOR, $profileColor, $this->_boardId); // プロフィール背景色
74 if ($ret) $this->_db->updateConfig(self::CF_ERR_MESSAGE_COLOR, $errMessageColor, $this->_boardId); // エラーメッセージ文字色
75 if ($ret) $this->_db->updateConfig(self::CF_MESSAGE_LENGTH, $messageLength, $this->_boardId); // 投稿文最大長
76 if ($ret) $this->_db->updateConfig(self::CF_TOP_CONTENTS, $topContents, $this->_boardId); // トップコンテンツ
79 $this->setMsg(self::MSG_GUIDANCE, 'データを更新しました');
81 $this->setMsg(self::MSG_APP_ERR, 'データ更新に失敗しました');
83 $this->gPage->updateParentWindow();// 親ウィンドウを更新
86 $reloadData = true; // データの再読み込み
89 $textColor = $this->_configArray[self::CF_TEXT_COLOR]; // 文字色
90 $bgColor = $this->_configArray[self::CF_BG_COLOR]; // 背景色
91 $innerBgColor = $this->_configArray[self::CF_INNER_BG_COLOR]; // 内枠背景色
92 $profileColor = $this->_configArray[self::CF_PROFILE_COLOR]; // プロフィール背景色
93 $errMessageColor = $this->_configArray[self::CF_ERR_MESSAGE_COLOR]; // エラーメッセージ文字色
94 $messageLength = $this->_configArray[self::CF_MESSAGE_LENGTH]; // 投稿文最大長
95 $topContents = $this->_configArray[self::CF_TOP_CONTENTS]; // トップコンテンツ
98 $this->tmpl->addVar("_widget", "text_color", $textColor); // 文字色
99 $this->tmpl->addVar("_widget", "bg_color", $bgColor); // 背景色
100 $this->tmpl->addVar("_widget", "inner_bg_color", $innerBgColor); // 内枠背景色
101 $this->tmpl->addVar("_widget", "profile_color", $profileColor); // プロフィール背景色
102 $this->tmpl->addVar("_widget", "err_message_color", $errMessageColor); // エラーメッセージ文字色
103 $this->tmpl->addVar("_widget", "message_length", $messageLength); // 投稿文最大長
104 $this->tmpl->addVar("_widget", "top_contents", $topContents); // トップコンテンツ