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_m_chachaOtherWidgetContainer.php 3282 2010-06-23 05:58:43Z fishbone $
14 * @link http://www.m-media.co.jp
16 require_once($gEnvManager->getCurrentWidgetContainerPath() . '/admin_m_chachaBaseWidgetContainer.php');
18 class admin_m_chachaOtherWidgetContainer extends admin_m_chachaBaseWidgetContainer
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'); // 投稿文最大長
63 $topContents = $request->valueOf('top_contents'); // トップコンテンツ
65 $reloadData = false; // データの再読み込み
66 if ($act == 'update'){ // 設定更新のとき
69 if ($this->getMsgCount() == 0){ // エラーのないとき
71 /* if ($ret) $this->_db->updateConfig(self::CF_TEXT_COLOR, $textColor, $this->_boardId); // 文字色
72 if ($ret) $this->_db->updateConfig(self::CF_BG_COLOR, $bgColor, $this->_boardId); // 背景色
73 if ($ret) $this->_db->updateConfig(self::CF_INNER_BG_COLOR, $innerBgColor, $this->_boardId); // 内枠背景色
74 if ($ret) $this->_db->updateConfig(self::CF_PROFILE_COLOR, $profileColor, $this->_boardId); // プロフィール背景色
75 if ($ret) $this->_db->updateConfig(self::CF_ERR_MESSAGE_COLOR, $errMessageColor, $this->_boardId); // エラーメッセージ文字色
76 if ($ret) $this->_db->updateConfig(self::CF_MESSAGE_LENGTH, $messageLength, $this->_boardId); // 投稿文最大長
79 // 絵文字画像タグをMagic3内部タグに変換
80 $this->gInstance->getTextConvManager()->convToEmojiTag($topContents, $html);
82 $this->_db->updateConfig(self::CF_TOP_CONTENTS, $html, $this->_boardId); // トップコンテンツ
86 $this->setMsg(self::MSG_GUIDANCE, 'データを更新しました');
88 $this->setMsg(self::MSG_APP_ERR, 'データ更新に失敗しました');
90 $this->gPage->updateParentWindow();// 親ウィンドウを更新
93 $reloadData = true; // データの再読み込み
96 /* $textColor = $this->_configArray[self::CF_TEXT_COLOR]; // 文字色
97 $bgColor = $this->_configArray[self::CF_BG_COLOR]; // 背景色
98 $innerBgColor = $this->_configArray[self::CF_INNER_BG_COLOR]; // 内枠背景色
99 $profileColor = $this->_configArray[self::CF_PROFILE_COLOR]; // プロフィール背景色
100 $errMessageColor = $this->_configArray[self::CF_ERR_MESSAGE_COLOR]; // エラーメッセージ文字色
101 $messageLength = $this->_configArray[self::CF_MESSAGE_LENGTH]; // 投稿文最大長*/
102 $topContents = $this->_configArray[self::CF_TOP_CONTENTS]; // トップコンテンツ
105 $topContents = str_replace(M3_TAG_START . M3_TAG_MACRO_ROOT_URL . M3_TAG_END, $this->getUrl($this->gEnv->getRootUrl()), $topContents); // Magic3ルートURLの変換
106 $this->gInstance->getTextConvManager()->convFromEmojiTag($topContents, $topContents);// Magic3内部タグから絵文字画像タグに変換
109 /* $this->tmpl->addVar("_widget", "text_color", $textColor); // 文字色
110 $this->tmpl->addVar("_widget", "bg_color", $bgColor); // 背景色
111 $this->tmpl->addVar("_widget", "inner_bg_color", $innerBgColor); // 内枠背景色
112 $this->tmpl->addVar("_widget", "profile_color", $profileColor); // プロフィール背景色
113 $this->tmpl->addVar("_widget", "err_message_color", $errMessageColor); // エラーメッセージ文字色
114 $this->tmpl->addVar("_widget", "message_length", $messageLength); // 投稿文最大長
116 $this->tmpl->addVar("_widget", "top_contents", $topContents); // トップコンテンツ