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-2011 Magic3 Project.
12 * @license http://www.gnu.org/copyleft/gpl.html GPL License
13 * @version SVN: $Id: event_mainBaseWidgetContainer.php 5230 2012-09-20 00:50:16Z fishbone $
14 * @link http://www.magic3.org
16 require_once($gEnvManager->getContainerPath() . '/baseWidgetContainer.php');
17 require_once($gEnvManager->getCurrentWidgetDbPath() . '/event_mainDb.php');
19 class event_mainBaseWidgetContainer extends BaseWidgetContainer
21 protected static $_localDb; // DB接続オブジェクト
22 protected static $_configArray; // イベント定義値
23 protected static $_paramObj; // ウィジェットパラメータオブジェクト
24 protected static $_canEditEntry; // 記事が編集可能かどうか
25 protected $_currentPageUrl; // 現在のページのURL
26 const CF_RECEIVE_COMMENT = 'receive_comment'; // コメントを受け付けるかどうか
27 const CF_ENTRY_VIEW_COUNT = 'entry_view_count'; // 記事表示数
28 const CF_ENTRY_VIEW_ORDER = 'entry_view_order'; // 記事表示方向
29 const CF_MAX_COMMENT_LENGTH = 'comment_max_length'; // コメント最大文字数
30 const CF_TOP_CONTENTS = 'top_contents'; // トップコンテンツ
31 const DEFAULT_COMMENT_LENGTH = 300; // デフォルトのコメント最大文字数
32 const DEFAULT_CATEGORY_COUNT = 2; // デフォルトのカテゴリ数
33 const DATE_RANGE_DELIMITER = '~'; // 日時範囲用デリミター
36 const TASK_TOP = 'top'; // トップ画面
37 const TASK_CALENDAR = 'calendar'; // カレンダー画面
38 const DEFAULT_TASK = 'top';
41 const CALENDAR_SCRIPT_FILE = '/jscalendar-1.0/calendar.js'; // カレンダースクリプトファイル
42 const CALENDAR_LANG_FILE = '/jscalendar-1.0/lang/calendar-ja.js'; // カレンダー言語ファイル
43 const CALENDAR_SETUP_FILE = '/jscalendar-1.0/calendar-setup.js'; // カレンダーセットアップファイル
44 const CALENDAR_CSS_FILE = '/jscalendar-1.0/calendar-win2k-1.css'; // カレンダー用CSSファイル
47 const CSS_LINK_STYLE_TOP = 'margin:0 10px;text-align:right;'; // 上のリンク部のスタイル
52 function __construct()
55 parent::__construct();
58 $this->_currentPageUrl = $this->gEnv->createCurrentPageUrl(); // 現在のページのURL
61 if (!isset(self::$_localDb)) self::$_localDb = new event_mainDb();
64 if (!isset(self::$_configArray)) $this->_loadConfig();
69 * _setTemplate()で指定したテンプレートファイルにデータを埋め込む。
71 * @param RequestManager $request HTTPリクエスト処理クラス
72 * @param object $param 任意使用パラメータ。_setTemplate()と共有。
75 function _postAssign($request, &$param)
77 $this->tmpl->addVar("top_link_area", "link_style_top", self::CSS_LINK_STYLE_TOP);// 上下のリンク部のスタイル
82 * @return bool true=取得成功、false=取得失敗
84 function _loadConfig()
86 self::$_configArray = array();
89 $ret = self::$_localDb->getAllConfig($rows);
92 $configCount = count($rows);
93 for ($i = 0; $i < $configCount; $i++){
94 $key = $rows[$i]['eg_id'];
95 $value = $rows[$i]['eg_value'];
96 self::$_configArray[$key] = $value;