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-2009 Magic3 Project.
12 * @license http://www.gnu.org/copyleft/gpl.html GPL License
13 * @version SVN: $Id: c_updateinfoWidgetContainer.php 2692 2009-12-15 09:42:40Z fishbone $
14 * @link http://www.magic3.org
16 require_once($gEnvManager->getContainerPath() . '/baseWidgetContainer.php');
17 require_once($gEnvManager->getCurrentWidgetDbPath() . '/updateinfoDb.php');
19 class c_updateinfoWidgetContainer extends BaseWidgetContainer
21 private $db; // DB接続オブジェクト
26 function __construct()
29 parent::__construct();
32 $this->db = new updateinfoDb();
37 * _assign()でデータを埋め込むテンプレートファイルのファイル名を返す。
38 * 読み込むディレクトリは、「自ウィジェットディレクトリ/include/template」に固定。
40 * @param RequestManager $request HTTPリクエスト処理クラス
41 * @param object $param 任意使用パラメータ。そのまま_assign()に渡る
42 * @return string テンプレートファイル名。テンプレートライブラリを使用しない場合は空文字列「''」を返す。
44 function _setTemplate($request, &$param)
46 return ''; // テンプレートは使用しない
51 * _setTemplate()で指定したテンプレートファイルにデータを埋め込む。
53 * @param RequestManager $request HTTPリクエスト処理クラス
54 * @param object $param 任意使用パラメータ。_setTemplate()と共有。
57 function _assign($request, &$param)
59 $retValue = '0'; // 実行結果
60 $act = $request->trimValueOf('act');
61 $type = $request->trimValueOf('content_type');
62 $serverId = $request->trimValueOf('server_id'); // サーバID
63 $registDt = $request->trimValueOf('regist_dt'); // 登録情報を有効にする日時
64 $name = $request->trimValueOf('content_name'); // コンテンツ名
65 $link = $request->trimValueOf('content_link'); // コンテンツへのリンク
66 $contentDt = $request->trimValueOf('content_dt'); // コンテンツ更新日時
67 $message = $request->trimValueOf('message'); // 表示メッセージ
68 $siteName = $request->trimValueOf('site_name'); // サイト名
69 $siteLink = $request->trimValueOf('site_link'); // サイトリンク
70 if ($act == 'regist'){ // データ登録のとき
71 $ret = $this->db->addNews($type, $serverId, $registDt, $name, $link, $contentDt, $message, $siteName, $siteLink);
72 if ($ret) $retValue = '1';/*正常終了*/
76 $xmlstr = $this->gPage->getDefaultXmlDeclaration() . '<root></root>';
77 $sxe = new SimpleXMLElement($xmlstr);
78 $status = $sxe->addChild('status', $retValue);