From da4f96616edb6a327d0350d50eb47f2695d8fb6d Mon Sep 17 00:00:00 2001 From: naoki hirata Date: Sun, 8 Dec 2013 10:34:21 +0900 Subject: [PATCH] =?utf8?q?=E3=80=8C=E3=83=90=E3=83=8A=E3=83=BC3=E3=80=8D?= =?utf8?q?=E3=82=A6=E3=82=A3=E3=82=B8=E3=82=A7=E3=83=83=E3=83=88=E3=81=AE?= =?utf8?q?=E5=87=BA=E5=8A=9B=E3=82=92table=E3=81=8B=E3=82=89div=E3=81=AB?= =?utf8?q?=E5=A4=89=E6=9B=B4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- include/sql/update_widgets.sql | 4 +- .../admin_banner3BannerWidgetContainer.php | 57 +++-- .../include/container/banner3WidgetContainer.php | 240 +++++++++++---------- .../include/container/default_bannerCommonDef.php | 2 +- widgets/banner3/include/db/banner3Db.php | 16 ++ widgets/banner3/include/template/admin.tmpl.html | 34 +-- .../include/template/admin_image_detail.tmpl.html | 9 +- widgets/banner3/include/template/default.tmpl.css | 14 +- widgets/banner3/include/template/main_h.tmpl.html | 19 +- widgets/banner3/include/template/main_v.tmpl.html | 17 +- 10 files changed, 225 insertions(+), 187 deletions(-) diff --git a/include/sql/update_widgets.sql b/include/sql/update_widgets.sql index ba982768..d44f94f7 100644 --- a/include/sql/update_widgets.sql +++ b/include/sql/update_widgets.sql @@ -284,7 +284,7 @@ INSERT INTO _widgets DELETE FROM _widgets WHERE wd_id = 'banner3'; INSERT INTO _widgets (wd_id, wd_name, wd_content_type, wd_edit_content, wd_version, wd_author, wd_copyright, wd_license, wd_official_level, wd_description, wd_add_script_lib, wd_add_script_lib_a, wd_has_admin, wd_enable_operation, wd_use_instance_def, wd_initialized, wd_cache_type, wd_view_control_type, wd_release_dt, wd_install_dt, wd_create_dt) VALUES -('banner3', 'バナー表示3', 'banner', true, '2.0.1', 'Naoki Hirata', 'Magic3.org', 'GPL', 10, 'バナー画像をグループ化して、グループごとに表示できるバナー管理ウィジェットです。', '', 'elfinder', true, true, true, true, 0, 1, '2013-09-16', now(), now()); +('banner3', 'バナー表示3', 'banner', true, '3.0.0', 'Naoki Hirata', 'Magic3.org', 'GPL', 10, 'バナー画像をグループ化して、グループごとに表示できるバナー管理ウィジェットです。', '', 'elfinder', true, true, true, true, 0, 1, '2013-12-08', now(), now()); DELETE FROM _widgets WHERE wd_id = 'jquery_plugin'; INSERT INTO _widgets (wd_id, wd_name, wd_version, wd_author, wd_copyright, wd_license, wd_official_level, wd_description, wd_add_script_lib, wd_add_script_lib_a, wd_has_admin, wd_use_instance_def, wd_initialized, wd_launch_index, wd_cache_type, wd_view_control_type, wd_release_dt, wd_install_dt, wd_create_dt) VALUES @@ -580,7 +580,7 @@ INSERT INTO _widgets DELETE FROM _widgets WHERE wd_id = 's/banner'; INSERT INTO _widgets (wd_id, wd_parent_id, wd_name, wd_content_type, wd_edit_content, wd_version, wd_author, wd_copyright, wd_license, wd_official_level, wd_description, wd_device_type, wd_add_script_lib, wd_add_script_lib_a, wd_has_admin, wd_enable_operation, wd_use_instance_def, wd_initialized, wd_cache_type, wd_view_control_type, wd_release_dt, wd_install_dt, wd_create_dt) VALUES -('s/banner', 'banner3', 'バナー表示', 'banner', true, '2.0.0', 'Naoki Hirata', 'Magic3.org', 'GPL', 10, 'バナー画像をグループ化して、グループごとに表示できるバナー管理ウィジェットです。', 2, '', 'jquery-ui.tabs', true, true, true, true, 0, 1, '2013-03-26', now(), now()); +('s/banner', 'banner3', 'バナー表示', 'banner', true, '3.0.0', 'Naoki Hirata', 'Magic3.org', 'GPL', 10, 'バナー画像をグループ化して、グループごとに表示できるバナー管理ウィジェットです。', 2, '', 'jquery-ui.tabs', true, true, true, true, 0, 1, '2013-12-08', now(), now()); DELETE FROM _widgets WHERE wd_id = 's/bbs_2ch'; INSERT INTO _widgets (wd_id, wd_name, wd_type, wd_content_type, wd_version, wd_author, wd_copyright, wd_license, wd_official_level, wd_description, wd_device_type, wd_add_script_lib, wd_add_script_lib_a, wd_read_css, wd_has_admin, wd_enable_operation, wd_use_instance_def, wd_initialized, wd_cache_type, wd_view_control_type, wd_release_dt, wd_install_dt, wd_create_dt) VALUES diff --git a/widgets/banner3/include/container/admin_banner3BannerWidgetContainer.php b/widgets/banner3/include/container/admin_banner3BannerWidgetContainer.php index 526f9278..99204eb7 100644 --- a/widgets/banner3/include/container/admin_banner3BannerWidgetContainer.php +++ b/widgets/banner3/include/container/admin_banner3BannerWidgetContainer.php @@ -10,17 +10,14 @@ * @author 平田直毅(Naoki Hirata) * @copyright Copyright 2006-2013 Magic3 Project. * @license http://www.gnu.org/copyleft/gpl.html GPL License - * @version SVN: $Id: admin_banner3BannerWidgetContainer.php 5868 2013-03-28 04:08:49Z fishbone $ + * @version SVN: $Id$ * @link http://www.magic3.org */ //require_once($gEnvManager->getCurrentWidgetContainerPath() . '/admin_banner3BaseWidgetContainer.php'); require_once($gEnvManager->getWidgetContainerPath('banner3') . '/admin_banner3BaseWidgetContainer.php'); -//require_once($gEnvManager->getCurrentWidgetDbPath() . '/banner3Db.php'); class admin_banner3BannerWidgetContainer extends admin_banner3BaseWidgetContainer { -// private $db; // DB接続オブジェクト - private $sysDb; // DB接続オブジェクト private $serialNo; // 選択中の項目のシリアル番号 private $serialArray = array(); // 表示中のシリアル番号 private $configId; // 定義ID @@ -29,6 +26,7 @@ class admin_banner3BannerWidgetContainer extends admin_banner3BaseWidgetContaine private $cssId; // CSS用ID private $dispType; // 画像リンク表示方法 private $dispTypeDef; // 画像リンク表示方法定義 + private $bannerNameArray; // バナー定義名保存用 const DEFAULT_NAME_HEAD = '名称未設定'; // デフォルトの設定名 const IMAGE_ICON_FILE = '/images/system/image16.png'; // イメージアイコン const FLASH_ICON_FILE = '/images/system/flash16.png'; // Flashアイコン @@ -93,7 +91,7 @@ class admin_banner3BannerWidgetContainer extends admin_banner3BaseWidgetContaine { // ページ定義IDとページ定義のレコードシリアル番号を取得 $this->startPageDefParam($defSerial, $defConfigId, $this->paramObj); - + $userId = $this->gEnv->getCurrentUserId(); $langId = $this->gEnv->getCurrentLanguage(); // 表示言語を取得 $this->serialNo = $request->trimValueOf('serial'); // 選択項目のシリアル番号 @@ -170,7 +168,11 @@ class admin_banner3BannerWidgetContainer extends admin_banner3BaseWidgetContaine $this->configId = $defConfigId; // 呼び出しウィンドウから引き継いだ定義ID $replaceNew = true; // データ再取得 } - + + // 設定項目選択メニュー作成 + $this->bannerNameArray = array(); + self::$_mainDb->getBannerList(array($this, 'bannerListLoop')); + // 表示用データを取得 if (empty($this->configId)){ // 新規登録の場合 $this->tmpl->setAttribute('item_name_visible', 'visibility', 'visible');// 名前入力フィールド表示 @@ -180,9 +182,9 @@ class admin_banner3BannerWidgetContainer extends admin_banner3BaseWidgetContaine $this->dispType = 0; // 表示方法 $dispDirect = 0; // 表示方向 $dispCount = 1; // 表示項目数 + $this->cssId = $this->createDefaultCssId(); // CSS用ID $this->css = $this->getParsedTemplateData('default.tmpl.css', array($this, 'makeCss'));// デフォルト用のCSSを取得 } - $this->cssId = $this->createDefaultCssId(); // CSS用ID } else { if ($replaceNew){ // 登録済みのバナー定義を取得 @@ -195,8 +197,8 @@ class admin_banner3BannerWidgetContainer extends admin_banner3BaseWidgetContaine $this->dispType = $row['bd_disp_type']; // 表示方法 $dispDirect = $row['bd_disp_direction']; // 表示方向 $html = $row['bd_item_html']; // 画像リンクテンプレート - $this->css = $row['bd_css']; // 表示用CSS $this->cssId = $row['bd_css_id']; // CSS用ID + $this->css = $row['bd_css']; // 表示用CSS $updateUser = $this->convertToDispString($row['lu_name']);// 更新者 $updateDt = $this->convertToDispDateTime($row['bd_update_dt']);// 更新日時 } @@ -207,9 +209,6 @@ class admin_banner3BannerWidgetContainer extends admin_banner3BaseWidgetContaine } $this->serialNo = $this->configId; - // 設定項目選択メニュー作成 - self::$_mainDb->getBannerList(array($this, 'bannerListLoop')); - // 画像リンク表示順選択メニュー作成 $this->createDispTypeMenu(); @@ -279,14 +278,7 @@ class admin_banner3BannerWidgetContainer extends admin_banner3BaseWidgetContaine for ($j = 1; $j < 100; $j++){ $name = self::DEFAULT_NAME_HEAD . $j; // 設定名の重複チェック - for ($i = 0; $i < count($this->paramObj); $i++){ - $targetObj = $this->paramObj[$i]->object; - if ($name == $targetObj->name){ // 定義名 - break; - } - } - // 重複なしのときは終了 - if ($i == count($this->paramObj)) break; + if (!in_array($name, $this->bannerNameArray)) break; } return $name; } @@ -297,7 +289,8 @@ class admin_banner3BannerWidgetContainer extends admin_banner3BaseWidgetContaine */ function createDefaultCssId() { - return $this->gEnv->getCurrentWidgetId() . '_' . $this->getTempConfigId($this->paramObj); + //return $this->gEnv->getCurrentWidgetId() . '_' . $this->getTempConfigId($this->paramObj); + return $this->gEnv->getCurrentWidgetId() . '_' . self::$_mainDb->getNextBannerId(); } /** * 一覧画面作成 @@ -355,7 +348,7 @@ class admin_banner3BannerWidgetContainer extends admin_banner3BaseWidgetContaine */ function itemListLoop($index, $fetchedRow, $param) { - $id = $this->convertToDispString($fetchedRow['bd_id']); + $id = $fetchedRow['bd_id']; // 使用数取得 $defCount = 0; @@ -366,12 +359,12 @@ class admin_banner3BannerWidgetContainer extends admin_banner3BaseWidgetContaine if ($defCount > 0) $operationDisagled = 'disabled'; $row = array( - 'index' => $index, // インデックス番号 - 'id' => $id, // ID - 'name' => $this->convertToDispString($fetchedRow['bd_name']), // 名前 - 'image_item' => $this->convertToDispString($fetchedRow['bd_item_id']), // バナー項目ID - 'ope_disabled' => $operationDisagled, // 選択可能かどうか - 'def_count' => $defCount // 使用数 + 'index' => $index, // インデックス番号 + 'id' => $this->convertToDispString($id), // ID + 'name' => $this->convertToDispString($fetchedRow['bd_name']), // 名前 + 'image_item' => $this->convertToDispString($fetchedRow['bd_item_id']), // バナー項目ID + 'ope_disabled' => $operationDisagled, // 選択可能かどうか + 'def_count' => $defCount // 使用数 ); $this->tmpl->addVars('itemlist', $row); $this->tmpl->parseTemplate('itemlist', 'a'); @@ -390,19 +383,21 @@ class admin_banner3BannerWidgetContainer extends admin_banner3BaseWidgetContaine */ function bannerListLoop($index, $fetchedRow, $param) { - $value = $this->convertToDispString($fetchedRow['bd_id']); // 定義ID - $name = $this->convertToDispString($fetchedRow['bd_name']); // 名前 + $value = $fetchedRow['bd_id']; // 定義ID + $name = $fetchedRow['bd_name']; // 名前 $selected = ''; if ($value == $this->configId) $selected = 'selected'; $row = array( - 'value' => $value, // 値 - 'name' => $name, // 名前 + 'value' => $this->convertToDispString($value), // 値 + 'name' => $this->convertToDispString($name), // 名前 'selected' => $selected // 選択中かどうか ); $this->tmpl->addVars('title_list', $row); $this->tmpl->parseTemplate('title_list', 'a'); + + $this->bannerNameArray[] = $fetchedRow['bd_name']; return true; } /** diff --git a/widgets/banner3/include/container/banner3WidgetContainer.php b/widgets/banner3/include/container/banner3WidgetContainer.php index bdec60b5..d6a94640 100644 --- a/widgets/banner3/include/container/banner3WidgetContainer.php +++ b/widgets/banner3/include/container/banner3WidgetContainer.php @@ -99,136 +99,138 @@ class banner3WidgetContainer extends BaseWidgetContainer return; } // バナー定義が取得できたときは、バナーを画面に出力 - if (empty($this->record)){ - $this->cancelParse(); // 出力しない - } else { - $itemArray = explode(',', $this->record['bd_item_id']); - if (count($itemArray) > 0){ - // 表示するバナー項目を決定する - $itemCount = $this->record['bd_disp_item_count']; - $dispItemArray = array(); - switch ($this->record['bd_disp_type']){ - case 0:// サイクリック - $firstIndex = $this->record['bd_first_item_index']; - if ($firstIndex < 0 || $firstIndex >= count($itemArray)) $firstIndex = 0; - if ($itemCount > count($itemArray)) $itemCount = count($itemArray); - $count = count($itemArray); - for ($i = $firstIndex; $i < $count; $i++) - { - $dispItemArray[] = $itemArray[$i]; - if (count($dispItemArray) >= $itemCount){ - $nextIndex = $i + 1; - break; - } - } - $count = $itemCount - count($dispItemArray); - for ($i = 0; $i < $count; $i++) - { - $dispItemArray[] = $itemArray[$i]; - } - if ($count > 0) $nextIndex = $count; - if ($nextIndex >= count($itemArray)) $nextIndex = 0; - // 読み込みインデックスを保存 - if (!$this->gEnv->isSystemAdmin()){ // システム管理者の場合はカウントしない - $ret = $this->db->updateBannerItemIndex($this->record['bd_id'], $nextIndex); - } - break; - case 1:// ランダム - while (true){ - $index = mt_rand(0, count($itemArray) -1); - $dispItemArray[] = $itemArray[$index]; - array_splice($itemArray, $index, 1); // 取得した項目を削除 - if (count($itemArray) == 0 || // 元のデータからすべて取得した - count($dispItemArray) >= $itemCount) break; // 取得最大個数に達した + if (empty($this->record)) $this->cancelParse(); // 出力しない + + $cssId = $this->record['bd_css_id']; + $this->headCss = $this->convertM3ToText($this->record['bd_css']); // 標準マクロ変換してCSSを作成 + + $itemArray = explode(',', $this->record['bd_item_id']); + if (count($itemArray) > 0){ + // 表示するバナー項目を決定する + $itemCount = $this->record['bd_disp_item_count']; + $dispItemArray = array(); + switch ($this->record['bd_disp_type']){ + case 0:// サイクリック + $firstIndex = $this->record['bd_first_item_index']; + if ($firstIndex < 0 || $firstIndex >= count($itemArray)) $firstIndex = 0; + if ($itemCount > count($itemArray)) $itemCount = count($itemArray); + $count = count($itemArray); + for ($i = $firstIndex; $i < $count; $i++) + { + $dispItemArray[] = $itemArray[$i]; + if (count($dispItemArray) >= $itemCount){ + $nextIndex = $i + 1; + break; } - break; - } - } - // バナー出力 - for ($i = 0; $i < count($dispItemArray); $i++) - { - $ret = $this->db->getImageById($dispItemArray[$i], $row); - if ($ret && $row['bi_visible']){ // 表示可能なときは表示 - // DBにバナー表示のログを残す - $key = ''; + } + $count = $itemCount - count($dispItemArray); + for ($i = 0; $i < $count; $i++) + { + $dispItemArray[] = $itemArray[$i]; + } + if ($count > 0) $nextIndex = $count; + if ($nextIndex >= count($itemArray)) $nextIndex = 0; + // 読み込みインデックスを保存 if (!$this->gEnv->isSystemAdmin()){ // システム管理者の場合はカウントしない - $key = $this->db->viewBannerItemLog($row['bi_serial'], $this->gAccess->getAccessLogSerialNo()); + $ret = $this->db->updateBannerItemIndex($this->record['bd_id'], $nextIndex); } - - $itemType = $row['bi_type']; // 画像タイプ - $imageUrl = $row['bi_image_url']; - if (!empty($imageUrl)) $imageUrl = str_replace(M3_TAG_START . M3_TAG_MACRO_ROOT_URL . M3_TAG_END, $this->gEnv->getRootUrl(), $imageUrl); - $imageWidth = $row['bi_image_width']; - $imageHeight = $row['bi_image_height']; - $imageAlt = $row['bi_image_alt']; // 代替テキスト - $srcHtml = $row['bi_html']; // HTML - $attr = $row['bi_attr']; // その他の属性 - - // その他の属性を設定 - $targetType = ''; // リンクターゲット - if (!empty($attr)){ - $attrArray = explode(';', $attr); - for ($j = 0; $j < count($attrArray); $j++){ - list($key, $value) = explode('=', $attrArray[$j]); - $key = trim($key); - $value = trim($value); - switch ($key){ - case 'target': - $targetType = $value; // リンクターゲットの種類 - break; - } - } + break; + case 1:// ランダム + while (true){ + $index = mt_rand(0, count($itemArray) -1); + $dispItemArray[] = $itemArray[$index]; + array_splice($itemArray, $index, 1); // 取得した項目を削除 + if (count($itemArray) == 0 || // 元のデータからすべて取得した + count($dispItemArray) >= $itemCount) break; // 取得最大個数に達した } - - // バナー表示イメージの作成 - $destImg = ''; - if (!empty($imageUrl)){ - if ($itemType == 0){ // 画像ファイルの場合 - $destImg = ' 0) $destImg .= ' width="' . $imageWidth . '"'; - if (!empty($imageHeight) && $imageHeight > 0) $destImg .= ' height="' . $imageHeight. '"'; - if (!empty($imageAlt)) $destImg .= ' alt="' . $this->convertToDispString($imageAlt) . '"'; // 代替テキスト - $destImg .= ' />'; - } else if ($itemType == 1){ // Flashファイルの場合 - $destImg = ' 0) $destImg .= ' width="' . $imageWidth . '"'; - if (!empty($imageHeight) && $imageHeight > 0) $destImg .= ' height="' . $imageHeight . '"'; - $destImg .= '>'; + break; + } + } + // バナー出力 + for ($i = 0; $i < count($dispItemArray); $i++) + { + $ret = $this->db->getImageById($dispItemArray[$i], $row); + if ($ret && $row['bi_visible']){ // 表示可能なときは表示 + // DBにバナー表示のログを残す + $key = ''; + if (!$this->gEnv->isSystemAdmin()){ // システム管理者の場合はカウントしない + $key = $this->db->viewBannerItemLog($row['bi_serial'], $this->gAccess->getAccessLogSerialNo()); + } + + $itemType = $row['bi_type']; // 画像タイプ + $imageUrl = $row['bi_image_url']; + if (!empty($imageUrl)) $imageUrl = str_replace(M3_TAG_START . M3_TAG_MACRO_ROOT_URL . M3_TAG_END, $this->gEnv->getRootUrl(), $imageUrl); + $imageWidth = $row['bi_image_width']; + $imageHeight = $row['bi_image_height']; + $imageAlt = $row['bi_image_alt']; // 代替テキスト + $srcHtml = $row['bi_html']; // HTML + $attr = $row['bi_attr']; // その他の属性 + + // その他の属性を設定 + $targetType = ''; // リンクターゲット + if (!empty($attr)){ + $attrArray = explode(';', $attr); + for ($j = 0; $j < count($attrArray); $j++){ + list($key, $value) = explode('=', $attrArray[$j]); + $key = trim($key); + $value = trim($value); + switch ($key){ + case 'target': + $targetType = $value; // リンクターゲットの種類 + break; } } - - // リンク作成 - if (empty($row['bi_link_url'])){ - $link = $destImg; - } else { // リンク先が設定されているとき - // リンク先URLを取得 - $redirectUrl = default_bannerCommonDef::getLinkUrlByDevice($row['bi_link_url']); - - $linkUrl = $this->gEnv->getDefaultUrl() . '?' . M3_REQUEST_PARAM_OPERATION_COMMAND . '=' . M3_REQUEST_CMD_DO_WIDGET; - $linkUrl .= '&' . M3_REQUEST_PARAM_WIDGET_ID . '=' . $this->gEnv->getCurrentWidgetId(); - if (!empty($key)) $linkUrl .= '&stamp=' . $key; - //$linkUrl .= '&url=' . urlencode($row['bi_link_url']); // URLはエンコードする - $linkUrl .= '&url=' . urlencode($redirectUrl); // URLはエンコードする - $link = 'getUrl($imageUrl) . '"'; + if (!empty($imageWidth) && $imageWidth > 0) $destImg .= ' width="' . $imageWidth . '"'; + if (!empty($imageHeight) && $imageHeight > 0) $destImg .= ' height="' . $imageHeight. '"'; + if (!empty($imageAlt)) $destImg .= ' alt="' . $this->convertToDispString($imageAlt) . '"'; // 代替テキスト + $destImg .= ' />'; + } else if ($itemType == 1){ // Flashファイルの場合 + $destImg = ' 0) $destImg .= ' width="' . $imageWidth . '"'; + if (!empty($imageHeight) && $imageHeight > 0) $destImg .= ' height="' . $imageHeight . '"'; + $destImg .= '>'; } + } + + // リンク作成 + if (empty($row['bi_link_url'])){ + $link = $destImg; + } else { // リンク先が設定されているとき + // リンク先URLを取得 + $redirectUrl = default_bannerCommonDef::getLinkUrlByDevice($row['bi_link_url']); - // テンプレートに埋め込む - $keyTag = M3_TAG_START . M3_TAG_MACRO_ITEM . M3_TAG_END; - $srcHtml = str_replace($keyTag, $link, $srcHtml, $count); - // if ($count <= 0) $srcHtml .= self::MSG_NOT_FOUND_IMG_TAG; // 置換用のタグが見つからないときはエラーメッセージを設定 - - $lineOutput = array( - 'item_data' => $srcHtml - ); - $this->tmpl->addVars('itemlist', $lineOutput); - $this->tmpl->parseTemplate('itemlist', 'a'); + $linkUrl = $this->gEnv->getDefaultUrl() . '?' . M3_REQUEST_PARAM_OPERATION_COMMAND . '=' . M3_REQUEST_CMD_DO_WIDGET; + $linkUrl .= '&' . M3_REQUEST_PARAM_WIDGET_ID . '=' . $this->gEnv->getCurrentWidgetId(); + if (!empty($key)) $linkUrl .= '&stamp=' . $key; + //$linkUrl .= '&url=' . urlencode($row['bi_link_url']); // URLはエンコードする + $linkUrl .= '&url=' . urlencode($redirectUrl); // URLはエンコードする + $link = ' $srcHtml + ); + $this->tmpl->addVars('itemlist', $lineOutput); + $this->tmpl->parseTemplate('itemlist', 'a'); } } + $this->tmpl->addVar("_widget", "css_id", $cssId); // CSS用ID } /** * ウィジェットのタイトルを設定 diff --git a/widgets/banner3/include/container/default_bannerCommonDef.php b/widgets/banner3/include/container/default_bannerCommonDef.php index 3240f221..83e12f5f 100644 --- a/widgets/banner3/include/container/default_bannerCommonDef.php +++ b/widgets/banner3/include/container/default_bannerCommonDef.php @@ -10,7 +10,7 @@ * @author 平田直毅(Naoki Hirata) * @copyright Copyright 2006-2013 Magic3 Project. * @license http://www.gnu.org/copyleft/gpl.html GPL License - * @version SVN: $Id: default_bannerCommonDef.php 5868 2013-03-28 04:08:49Z fishbone $ + * @version SVN: $Id$ * @link http://www.magic3.org */ diff --git a/widgets/banner3/include/db/banner3Db.php b/widgets/banner3/include/db/banner3Db.php index 79c3fbb2..0a8965fb 100644 --- a/widgets/banner3/include/db/banner3Db.php +++ b/widgets/banner3/include/db/banner3Db.php @@ -312,6 +312,22 @@ class banner3Db extends BaseDb $this->selectLoop($queryStr, array(), $callback, null); } /** + * 次のバナー定義IDを取得 + * + * @return int バナーID + */ + function getNextBannerId() + { + $queryStr = 'SELECT MAX(bd_id) AS bid FROM bn_def '; + $ret = $this->selectRecord($queryStr, array(), $row); + if ($ret){ + $newBannerId = $row['bid'] + 1; + } else { + $newBannerId = 1; + } + return $newBannerId; + } + /** * バナー定義の更新 * * @param int $bannerId バナーID(0=新規追加、0以外=更新) diff --git a/widgets/banner3/include/template/admin.tmpl.html b/widgets/banner3/include/template/admin.tmpl.html index 69ffb887..fcc411b9 100644 --- a/widgets/banner3/include/template/admin.tmpl.html +++ b/widgets/banner3/include/template/admin.tmpl.html @@ -7,7 +7,7 @@ * @author 平田直毅(Naoki Hirata) * @copyright Copyright 2006-2012 Magic3 Project. * @license http://www.gnu.org/copyleft/gpl.html GPL License - * @version SVN: $Id: admin.tmpl.html 4845 2012-04-13 04:47:07Z fishbone $ + * @version SVN: $Id$ * @link http://www.magic3.org */ @@ -65,11 +65,11 @@ function setBannerItem(value) - +
- - + - - + + - +
名前 + 名前
表示方法
表示方法 表示順:   è¡¨ç¤ºé …目数:
@@ -124,22 +124,22 @@ function setBannerItem(value)
+
- - + - +
- - - - + + + + - + diff --git a/widgets/banner3/include/template/admin_image_detail.tmpl.html b/widgets/banner3/include/template/admin_image_detail.tmpl.html index 68631290..03252b8a 100644 --- a/widgets/banner3/include/template/admin_image_detail.tmpl.html +++ b/widgets/banner3/include/template/admin_image_detail.tmpl.html @@ -161,13 +161,7 @@ $(function(){ setupItems(); // WYSIWYGエディター作成 - //m3_setHtmlEditor('item_html'); - m3SetWysiwygEditor('item_html', 150, false); - - var config = {}; - config['customConfig'] = M3_ROOT_URL + '/scripts/m3/ckconfig_direct.js'; - CKEDITOR.replace('linkinfo', config); - $('#linkinfo_parent').hide(); + m3SetWysiwygEditor('item_html', 150, false, 'layout'); }); //]]> @@ -279,5 +273,4 @@ $(function(){
ID{ID}名前{NAME}ID{ID}名前{NAME}
表示画像{IMAGE}{IMAGE}
リンク先URL
-
diff --git a/widgets/banner3/include/template/default.tmpl.css b/widgets/banner3/include/template/default.tmpl.css index 85677f53..fda613de 100644 --- a/widgets/banner3/include/template/default.tmpl.css +++ b/widgets/banner3/include/template/default.tmpl.css @@ -1,4 +1,16 @@ -{ID} { +{ID} .banner_image { + margin:2px; +} +{ID}.banner_horizontal .banner_image_outer { + float:left; + padding:0px; + width:240px; + display:inline-block; +} +{ID}.banner_vertical .banner_image_outer { + float:none; + padding:0px; + width:240px; } diff --git a/widgets/banner3/include/template/main_h.tmpl.html b/widgets/banner3/include/template/main_h.tmpl.html index 4335b480..0b0be916 100644 --- a/widgets/banner3/include/template/main_h.tmpl.html +++ b/widgets/banner3/include/template/main_h.tmpl.html @@ -1,7 +1,16 @@ +/** + * 表示データ作成用テンプレート(patTemplate) + * + * LICENSE: This source file is licensed under the terms of the GNU General Public License. + * + * @package Magic3 Framework + * @author 平田直毅(Naoki Hirata) + * @copyright Copyright 2006-2013 Magic3 Project. + * @license http://www.gnu.org/copyleft/gpl.html GPL License + * @version SVN: $Id$ + * @link http://www.magic3.org + */ - - - - -
{ITEM_DATA}
+ +
diff --git a/widgets/banner3/include/template/main_v.tmpl.html b/widgets/banner3/include/template/main_v.tmpl.html index 11ba5c76..53f93a17 100644 --- a/widgets/banner3/include/template/main_v.tmpl.html +++ b/widgets/banner3/include/template/main_v.tmpl.html @@ -1,5 +1,16 @@ +/** + * 表示データ作成用テンプレート(patTemplate) + * + * LICENSE: This source file is licensed under the terms of the GNU General Public License. + * + * @package Magic3 Framework + * @author 平田直毅(Naoki Hirata) + * @copyright Copyright 2006-2013 Magic3 Project. + * @license http://www.gnu.org/copyleft/gpl.html GPL License + * @version SVN: $Id$ + * @link http://www.magic3.org + */ - - -
{ITEM_DATA}
+ +
-- 2.11.0