Cloud computing platform
Révision | 2a76f48d0573f70ba2c23767a3434e82c50155d3 (tree) |
---|---|
l'heure | 2015-04-16 18:18:42 |
Auteur | naoki hirata <naoki@magi...> |
Commiter | naoki hirata |
「イベントヘッドライン表示」ウィジェット更新。
@@ -23,8 +23,6 @@ class admin_event_headlineWidgetContainer extends BaseAdminWidgetContainer | ||
23 | 23 | private $sortOrder; // ソート順 |
24 | 24 | private $sortOrderArray; // ソート順 |
25 | 25 | private $imageType; // 選択中の画像タイプ |
26 | - const DEFAULT_ITEM_COUNT = 10; // デフォルトの表示項目数 | |
27 | - const DEFAULT_IMAGE_TYPE = '80c.jpg'; // デフォルトの画像タイプ | |
28 | 26 | |
29 | 27 | /** |
30 | 28 | * コンストラクタ |
@@ -217,12 +215,12 @@ class admin_event_headlineWidgetContainer extends BaseAdminWidgetContainer | ||
217 | 215 | $this->tmpl->setAttribute('item_name_visible', 'visibility', 'visible');// 名前入力フィールド表示 |
218 | 216 | if ($replaceNew){ // データ再取得時 |
219 | 217 | $name = $this->createConfigDefaultName(); // デフォルトの設定名を作成 |
220 | - $itemCount = self::DEFAULT_ITEM_COUNT; // 表示項目数 | |
218 | + $itemCount = event_headlineCommonDef::DEFAULT_ITEM_COUNT; // 表示項目数 | |
221 | 219 | $this->sortOrder = '0'; // ソート順 |
222 | 220 | $useBaseDay = '0'; // 基準日を使用するかどうか |
223 | 221 | $dayCount = 0; // 基準日からの日数 |
224 | 222 | $showImage = 0; // 画像を表示するかどうか |
225 | - $this->imageType = self::DEFAULT_IMAGE_TYPE; // 画像タイプ | |
223 | + $this->imageType = event_headlineCommonDef::DEFAULT_IMAGE_TYPE; // 画像タイプ | |
226 | 224 | $imageWidth = 0; // 画像幅 |
227 | 225 | $imageHeight = 0; // 画像高さ |
228 | 226 | $useRss = 1; // RSS配信を行うかどうか |
@@ -17,6 +17,8 @@ | ||
17 | 17 | class event_headlineCommonDef |
18 | 18 | { |
19 | 19 | // ##### 定義値 ##### |
20 | + const DEFAULT_ITEM_COUNT = 10; // デフォルトの表示項目数 | |
21 | + const DEFAULT_IMAGE_TYPE = '80c.jpg'; // デフォルトの画像タイプ | |
20 | 22 | |
21 | 23 | // ##### デフォルト値 ##### |
22 | 24 | const DEFAULT_EVENT_ITEM_LAYOUT = '<div style="float:left;">[#IMAGE#]</div><div class="clearfix"><div>[#TITLE#]([#CT_DATE#] [#CT_TIME#])</div><div>[#CT_SUMMARY#]</div></div>'; // イベント項目レイアウト |
@@ -23,14 +23,11 @@ class event_headlineWidgetContainer extends BaseWidgetContainer | ||
23 | 23 | private $isEntry; // 記事の投稿があるかどうか |
24 | 24 | private $defaultUrl; // システムのデフォルトURL |
25 | 25 | private $headRssFile; // RSS情報 |
26 | - private $optionPassage; // 表示オプション(経過日時) | |
27 | 26 | private $showImage; // 画像を表示するかどうか |
28 | 27 | private $imageType; // 画像タイプ |
29 | 28 | private $imageWidth; // 画像幅 |
30 | 29 | private $imageHeight; // 画像高さ |
31 | - const DEFAULT_ITEM_COUNT = 20; // デフォルトの表示項目数 | |
32 | - const DEFAULT_IMAGE_TYPE = '80c.jpg'; // デフォルトの画像タイプ | |
33 | - const MAX_TITLE_LENGTH = 20; // タイトルの最大文字列長 | |
30 | + const DEFAULT_CONFIG_ID = 0; | |
34 | 31 | const DEFAULT_TITLE = 'イベントヘッドライン'; // デフォルトのウィジェットタイトル名 |
35 | 32 | const RSS_ICON_FILE = '/images/system/rss14.png'; // RSSリンク用アイコン |
36 | 33 |
@@ -70,27 +67,29 @@ class event_headlineWidgetContainer extends BaseWidgetContainer | ||
70 | 67 | */ |
71 | 68 | function _assign($request, &$param) |
72 | 69 | { |
70 | + // 定義ID取得 | |
71 | + $configId = $this->gEnv->getCurrentWidgetConfigId(); | |
72 | + if (empty($configId)) $configId = self::DEFAULT_CONFIG_ID; | |
73 | + | |
73 | 74 | // 初期値設定 |
74 | - $itemCount = self::DEFAULT_ITEM_COUNT; // 表示項目数 | |
75 | + $itemCount = event_headlineCommonDef::DEFAULT_ITEM_COUNT; // 表示項目数 | |
75 | 76 | $useRss = 1; // RSS配信を行うかどうか |
76 | - $this->optionPassage = 0; // 表示オプション(経過日時) | |
77 | 77 | $this->showImage = 0; // 画像を表示するかどうか |
78 | - $this->imageType = self::DEFAULT_IMAGE_TYPE; // 画像タイプ | |
78 | + $this->imageType = event_headlineCommonDef::DEFAULT_IMAGE_TYPE; // 画像タイプ | |
79 | 79 | $this->imageWidth = 0; // 画像幅 |
80 | 80 | $this->imageHeight = 0; // 画像高さ |
81 | - | |
81 | + | |
82 | 82 | // 設定値を取得 |
83 | - $paramObj = $this->getWidgetParamObj(); | |
84 | - if (!empty($paramObj)){ | |
83 | + $paramObj = $this->getWidgetParamObjByConfigId($configId); | |
84 | + if (!empty($paramObj)){ // 定義データが取得できたとき | |
85 | 85 | if (isset($paramObj->itemCount)) $itemCount = $paramObj->itemCount; |
86 | 86 | if (isset($paramObj->useRss)) $useRss = $paramObj->useRss;// RSS配信を行うかどうか |
87 | - if (isset($paramObj->optionPassage)) $this->optionPassage = $paramObj->optionPassage; // 表示オプション(経過日時) | |
88 | 87 | if (isset($paramObj->showImage)) $this->showImage = $paramObj->showImage; // 画像を表示するかどうか |
89 | 88 | if (isset($paramObj->imageType)) $this->imageType = $paramObj->imageType; // 画像タイプ |
90 | 89 | if (isset($paramObj->imageWidth)) $this->imageWidth = $paramObj->imageWidth; // 画像幅 |
91 | 90 | if (isset($paramObj->imageHeight)) $this->imageHeight = $paramObj->imageHeight; // 画像高さ |
92 | 91 | } |
93 | - | |
92 | + | |
94 | 93 | // 新規ブログタイトルを取得 |
95 | 94 | $this->defaultUrl = $this->gEnv->getDefaultUrl(); |
96 | 95 | $this->db->getEntryItems($itemCount, $this->gEnv->getCurrentLanguage(), array($this, 'itemLoop')); |
@@ -161,12 +160,6 @@ class event_headlineWidgetContainer extends BaseWidgetContainer | ||
161 | 160 | |
162 | 161 | // タイトルを設定 |
163 | 162 | $title = $fetchedRow['be_name']; |
164 | - // タイトルの長さは制限 | |
165 | - if (function_exists('mb_substr')){ | |
166 | - $title = mb_substr($title, 0, self::MAX_TITLE_LENGTH); | |
167 | - } else { | |
168 | - $title = substr($title, 0, self::MAX_TITLE_LENGTH); | |
169 | - } | |
170 | 163 | |
171 | 164 | // 記事へのリンク |
172 | 165 | $url = $this->defaultUrl . '?'. M3_REQUEST_PARAM_BLOG_ENTRY_ID . '=' . $fetchedRow['be_id']; |
@@ -174,13 +167,6 @@ class event_headlineWidgetContainer extends BaseWidgetContainer | ||
174 | 167 | |
175 | 168 | // オプション項目 |
176 | 169 | $optionStr = ''; |
177 | - if ($this->optionPassage){ | |
178 | - $time = strtotime($fetchedRow['be_regist_dt']); | |
179 | - if ($time != strtotime($this->gEnv->getInitValueOfTimestamp())){ | |
180 | - $time = time() - $time; | |
181 | - $optionStr = '<div style="text-align:right;font-size:smaller;">' . $this->convertToDispString($this->convertToDispPassageTime($time) . '前') . '</div>'; | |
182 | - } | |
183 | - } | |
184 | 170 | |
185 | 171 | // 画像 |
186 | 172 | $imageTag = ''; |
@@ -14,6 +14,7 @@ | ||
14 | 14 | * @link http://www.magic3.org |
15 | 15 | */ |
16 | 16 | require_once($gEnvManager->getContainerPath() . '/baseRssContainer.php'); |
17 | +require_once($gEnvManager->getCurrentWidgetContainerPath() . '/event_headlineCommonDef.php'); | |
17 | 18 | require_once($gEnvManager->getCurrentWidgetDbPath() . '/event_headlineDb.php'); |
18 | 19 | |
19 | 20 | class rss_event_headlineWidgetContainer extends BaseRssContainer |
@@ -23,7 +24,6 @@ class rss_event_headlineWidgetContainer extends BaseRssContainer | ||
23 | 24 | private $rssChannel; // RSSチャンネル部出力データ |
24 | 25 | private $rssSeqUrl = array(); // 項目の並び |
25 | 26 | private $defaultUrl; // システムのデフォルトURL |
26 | - const DEFAULT_ITEM_COUNT = 10; // デフォルトの表示項目数 | |
27 | 27 | const DEFAULT_TITLE = 'ブログ最新記事'; // デフォルトのウィジェットタイトル |
28 | 28 | const DEFAULT_DESC = '最新のブログ記事が取得できます。'; |
29 | 29 |
@@ -63,13 +63,17 @@ class rss_event_headlineWidgetContainer extends BaseRssContainer | ||
63 | 63 | */ |
64 | 64 | function _assign($request, &$param) |
65 | 65 | { |
66 | - $langId = $this->gEnv->getCurrentLanguage(); | |
66 | + // 定義ID取得 | |
67 | + $configId = $this->gEnv->getCurrentWidgetConfigId(); | |
68 | + if (empty($configId)) $configId = self::DEFAULT_CONFIG_ID; | |
67 | 69 | |
68 | - // 設定値を取得 | |
69 | - $itemCount = self::DEFAULT_ITEM_COUNT; // 表示項目数 | |
70 | + // 初期値設定 | |
71 | + $itemCount = event_headlineCommonDef::DEFAULT_ITEM_COUNT; // 表示項目数 | |
70 | 72 | $useRss = 1; // RSS配信を行うかどうか |
71 | - $paramObj = $this->getWidgetParamObj(); | |
72 | - if (!empty($paramObj)){ | |
73 | + | |
74 | + // 設定値を取得 | |
75 | + $paramObj = $this->getWidgetParamObjByConfigId($configId); | |
76 | + if (!empty($paramObj)){ // 定義データが取得できたとき | |
73 | 77 | $itemCount = $paramObj->itemCount; |
74 | 78 | $useRss = $paramObj->useRss;// RSS配信を行うかどうか |
75 | 79 | if (!isset($useRss)) $useRss = 1; |