From 938c27b99a87c73f26cc89a995a04a70b4fbce96 Mon Sep 17 00:00:00 2001 From: naoki hirata Date: Fri, 11 Apr 2014 20:13:18 +0900 Subject: [PATCH] =?utf8?q?=E3=80=8C=E7=B0=A1=E6=98=93=E3=81=8A=E5=95=8F?= =?utf8?q?=E3=81=84=E5=90=88=E3=82=8F=E3=81=9B=E3=80=8D=E3=82=A6=E3=82=A3?= =?utf8?q?=E3=82=B8=E3=82=A7=E3=83=83=E3=83=88=E3=82=92Bootstrap=E5=9E=8B?= =?utf8?q?=E3=83=86=E3=83=B3=E3=83=97=E3=83=AC=E3=83=BC=E3=83=88=E3=81=AB?= =?utf8?q?=E5=AF=BE=E5=BF=9C=E3=81=99=E3=82=8B=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- include/manager/pageManager.php | 11 ++- include/sql/update_widgets.sql | 5 +- scripts/m3/default.css | 15 +++ templates/bootstrap_cerulean/css/style.css | 3 +- templates/bootstrap_yeti/css/style.css | 1 - .../include/container/contactusWidgetContainer.php | 34 ++++--- widgets/contactus/include/template/index.tmpl.html | 4 +- .../include/template/index_bootstrap.tmpl.html | 109 +++++++++++++++++++++ 8 files changed, 157 insertions(+), 25 deletions(-) create mode 100644 scripts/m3/default.css create mode 100644 widgets/contactus/include/template/index_bootstrap.tmpl.html diff --git a/include/manager/pageManager.php b/include/manager/pageManager.php index 637caa89..72e5930b 100644 --- a/include/manager/pageManager.php +++ b/include/manager/pageManager.php @@ -183,6 +183,7 @@ class PageManager extends Core const M3_OPTION_SCRIPT_FILENAME = 'm3opt1.1.0.js'; // AJAXを含んだオプションライブラリファイル(jQuery必須) const M3_ADMIN_CSS_FILE = 'm3/admin.css'; // 管理機能用のCSS const M3_EDIT_CSS_FILE = 'm3/edit.css'; // 一般画面編集用のCSS + const M3_DEFAULT_CSS_FILE = 'm3/default.css'; // 一般画面共通のデフォルトCSS // const M3_NO_BOOTSTRAP_CSS_FILE = 'm3/nobootstrap/style.css'; // 管理画面でBootstrapの読み込みなしの場合のCSS // 読み込み制御 @@ -217,7 +218,7 @@ class PageManager extends Core // 共通スクリプトファイル // 「ルート/scripts」ディレクトリからの相対パスで指定する $this->defaultScriptFiles = array(self::M3_STD_SCRIPT_FILENAME); - $this->defaultCssFiles = array(); + $this->defaultCssFiles = array(self::M3_DEFAULT_CSS_FILE); // 一般画面共通のデフォルトCSS $this->wysiwygEditor = $gSystemManager->getSystemConfig(self::CF_WYSIWYG_EDITOR); // 管理画面用WYSIWYGエディター @@ -252,8 +253,8 @@ class PageManager extends Core // self::M3_STD_SCRIPT_FILENAME, // self::M3_ADMIN_SCRIPT_FILENAME, // self::M3_OPTION_SCRIPT_FILENAME); - - $this->defaultAdminCssFiles = array(); // 管理機能用のCSS + + $this->defaultAdminCssFiles = array(); // 管理機能用のCSS } else { $this->defaultAdminScriptFiles = array($this->selectedJQueryFilename, // jQuery $this->selectedJQueryUiFilename, // jQuery UI Core @@ -261,8 +262,8 @@ class PageManager extends Core self::M3_STD_SCRIPT_FILENAME, self::M3_ADMIN_SCRIPT_FILENAME, self::M3_OPTION_SCRIPT_FILENAME); - - $this->defaultAdminCssFiles = array(self::M3_ADMIN_CSS_FILE); // 管理機能用のCSS + + $this->defaultAdminCssFiles = array(self::M3_ADMIN_CSS_FILE);// 管理機能用のCSS // if (!$this->useBootstrap) $this->defaultAdminCssFiles[] = self::M3_NO_BOOTSTRAP_CSS_FILE; // Bootstrapを読み込まない場合は代替CSSを読み込む // Javascriptライブラリ diff --git a/include/sql/update_widgets.sql b/include/sql/update_widgets.sql index f35f4df9..ebeae905 100644 --- a/include/sql/update_widgets.sql +++ b/include/sql/update_widgets.sql @@ -281,8 +281,9 @@ DELETE FROM _widgets WHERE wd_id = 'bbs_login_box'; INSERT INTO _widgets (wd_id, wd_name, wd_type, wd_version, wd_params, wd_author, wd_copyright, wd_license, wd_official_level, wd_description, wd_add_script_lib, wd_read_scripts, wd_read_css, wd_available, wd_editable, wd_has_admin, wd_enable_operation, wd_use_instance_def, wd_initialized, wd_launch_index, wd_cache_type, wd_view_control_type, wd_install_dt, wd_create_dt) VALUES ('bbs_login_box', '掲示板 - ログイン', 'BBML', '1.0.0', '', 'Naoki Hirata', 'Magic3.org', 'GPL', 10, '掲示板の会員ログイン用ボックス。', 'md5', false, false, true, true, false, false, false,true, 0, 2, -1, now(), now()); DELETE FROM _widgets WHERE wd_id = 'contactus'; -INSERT INTO _widgets (wd_id, wd_name, wd_type, wd_version, wd_params, wd_author, wd_copyright, wd_license, wd_official_level, wd_description, wd_read_scripts, wd_read_css, wd_available, wd_editable, wd_has_admin, wd_enable_operation, 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 -('contactus', '簡易お問い合わせ', 'CONU', '1.1.0', '', 'Naoki Hirata', 'Magic3.org', 'GPL', 10, 'お問い合わせの入力データをメールで送る。', false, false, true, true, true, false, false,true, 0, 0, 0, '2012-06-09', now(), now()); +INSERT INTO _widgets +(wd_id, wd_name, wd_version, wd_author, wd_copyright, wd_license, wd_official_level, wd_description, wd_read_scripts, wd_read_css, wd_available, wd_editable, wd_has_admin, wd_enable_operation, 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 +('contactus', '簡易お問い合わせ', '2.0.0', 'Naoki Hirata', 'Magic3.org', 'GPL', 10, 'お問い合わせの入力データをメールで送る。', false, false, true, true, true, false, false,true, 0, 0, 0, '2014-04-11', now(), now()); DELETE FROM _widgets WHERE wd_id = 'joomla_clock'; INSERT INTO _widgets (wd_id, wd_name, wd_type, wd_version, wd_params, wd_author, wd_copyright, wd_license, wd_official_level, wd_description, wd_available, wd_editable, wd_has_admin, wd_enable_operation, wd_use_instance_def, wd_initialized, wd_launch_index, wd_cache_type, wd_view_control_type, wd_install_dt, wd_create_dt) VALUES ('joomla_clock', 'Joomla時計', 'JMCK', '1.0.0', '', 'Naoki Hirata', 'Magic3.org', 'GPL', 10, 'Joomlaロゴの時計。', false, true, false, false, false,true, 0, 1, -1, now(), now()); diff --git a/scripts/m3/default.css b/scripts/m3/default.css new file mode 100644 index 00000000..1d1bfb2f --- /dev/null +++ b/scripts/m3/default.css @@ -0,0 +1,15 @@ +/** + * Magic3システムデフォルトCSS + * + * LICENSE: This source file is licensed under the terms of the GNU General Public License. + * + * @package Magic3 Framework + * @author 平田直毅(Naoki Hirata) + * @copyright Copyright 2006-2014 Magic3 Project. + * @license http://www.gnu.org/copyleft/gpl.html GPL License + * @version SVN: $Id$ + * @link http://www.magic3.org + */ +.required { + color:red; +} diff --git a/templates/bootstrap_cerulean/css/style.css b/templates/bootstrap_cerulean/css/style.css index cd00a217..5f949c34 100644 --- a/templates/bootstrap_cerulean/css/style.css +++ b/templates/bootstrap_cerulean/css/style.css @@ -1,4 +1,3 @@ - /* メニューバー固定用 */ body { padding-top: 75px; @@ -23,4 +22,4 @@ body { #pos-fixed, #pos-slide { width: auto; } -} \ No newline at end of file +} diff --git a/templates/bootstrap_yeti/css/style.css b/templates/bootstrap_yeti/css/style.css index cd00a217..a14e4cee 100644 --- a/templates/bootstrap_yeti/css/style.css +++ b/templates/bootstrap_yeti/css/style.css @@ -1,4 +1,3 @@ - /* メニューバー固定用 */ body { padding-top: 75px; diff --git a/widgets/contactus/include/container/contactusWidgetContainer.php b/widgets/contactus/include/container/contactusWidgetContainer.php index 6cde4cce..f970ebd9 100644 --- a/widgets/contactus/include/container/contactusWidgetContainer.php +++ b/widgets/contactus/include/container/contactusWidgetContainer.php @@ -8,9 +8,9 @@ * * @package Magic3 Framework * @author 平田直毅(Naoki Hirata) - * @copyright Copyright 2006-2012 Magic3 Project. + * @copyright Copyright 2006-2014 Magic3 Project. * @license http://www.gnu.org/copyleft/gpl.html GPL License - * @version SVN: $Id: contactusWidgetContainer.php 5455 2012-12-10 13:21:36Z fishbone $ + * @version SVN: $Id$ * @link http://www.magic3.org */ require_once($gEnvManager->getContainerPath() . '/baseWidgetContainer.php'); @@ -21,10 +21,12 @@ class contactusWidgetContainer extends BaseWidgetContainer private $db; // DB接続オブジェクト private $langId; // 表示言語 private $state; // 都道府県 + private $tagRequired; // 「必須」ラベルタグ const CONTACTUS_FORM = 'contact_us'; // お問い合わせフォーム const DEFAULT_SEND_MESSAGE = 1; // メール送信機能を使用するかどうか(デフォルト使用) const DEFAULT_TITLE_NAME = 'お問い合わせ'; // デフォルトのタイトル名 - const DEFAULT_STR_REQUIRED = '*必須'; // 「必須」表示用テキスト + const DEFAULT_STR_REQUIRED = '*必須'; // 「必須」表示用テキスト + const BOOTSTRAP_STR_REQUIRED = '必須'; // 「必須」表示用テキスト(Bootstrap出力用) /** * コンストラクタ @@ -49,7 +51,13 @@ class contactusWidgetContainer extends BaseWidgetContainer */ function _setTemplate($request, &$param) { - return 'index.tmpl.html'; + if ($this->_renderType == M3_RENDER_BOOTSTRAP){ + $this->tagRequired = self::BOOTSTRAP_STR_REQUIRED; // 「必須」ラベルタグ + return 'index_bootstrap.tmpl.html'; + } else { + $this->tagRequired = self::DEFAULT_STR_REQUIRED; // 「必須」ラベルタグ + return 'index.tmpl.html'; + } } /** * テンプレートにデータ埋め込む @@ -247,40 +255,40 @@ class contactusWidgetContainer extends BaseWidgetContainer } // 入力フィールドの表示制御 if ($nameVisible){ - if ($nameRequired) $this->tmpl->addVar('show_name', 'required', self::DEFAULT_STR_REQUIRED);// 「必須」表示 + if ($nameRequired) $this->tmpl->addVar('show_name', 'required', $this->tagRequired);// 「必須」表示 $this->tmpl->setAttribute('show_name', 'visibility', 'visible');// 名前入力フィールドの表示 } if ($nameKanaVisible){ - if ($nameKanaRequired) $this->tmpl->addVar('show_name_kana', 'required', self::DEFAULT_STR_REQUIRED);// 「必須」表示 + if ($nameKanaRequired) $this->tmpl->addVar('show_name_kana', 'required', $this->tagRequired);// 「必須」表示 $this->tmpl->setAttribute('show_name_kana', 'visibility', 'visible');// 名前カナ入力フィールドの表示 } if ($emailVisible){ - if ($emailRequired) $this->tmpl->addVar('show_email', 'required', self::DEFAULT_STR_REQUIRED);// 「必須」表示 + if ($emailRequired) $this->tmpl->addVar('show_email', 'required', $this->tagRequired);// 「必須」表示 $this->tmpl->setAttribute('show_email', 'visibility', 'visible');// Eメール入力フィールドの表示 } if ($companyVisible){ - if ($companyRequired) $this->tmpl->addVar('show_company_name', 'required', self::DEFAULT_STR_REQUIRED);// 「必須」表示 + if ($companyRequired) $this->tmpl->addVar('show_company_name', 'required', $this->tagRequired);// 「必須」表示 $this->tmpl->setAttribute('show_company_name', 'visibility', 'visible');// 会社名入力フィールドの表示 } if ($zipcodeVisible){ - if ($zipcodeRequired) $this->tmpl->addVar('show_zipcode', 'required', self::DEFAULT_STR_REQUIRED);// 「必須」表示 + if ($zipcodeRequired) $this->tmpl->addVar('show_zipcode', 'required', $this->tagRequired);// 「必須」表示 $this->tmpl->setAttribute('show_zipcode', 'visibility', 'visible');// 郵便番号入力フィールドの表示 } if ($stateVisible){ - if ($stateRequired) $this->tmpl->addVar('show_state', 'required', self::DEFAULT_STR_REQUIRED);// 「必須」表示 + if ($stateRequired) $this->tmpl->addVar('show_state', 'required', $this->tagRequired);// 「必須」表示 $this->tmpl->setAttribute('show_state', 'visibility', 'visible');//都道府県入力フィールドの表示 $this->db->getAllState('JPN', $this->langId, array($this, 'stateLoop'));// 都道府県メニュー } if ($addressVisible){ // 住所入力フィールドの表示 - if ($addressRequired) $this->tmpl->addVar('show_address', 'required', self::DEFAULT_STR_REQUIRED);// 「必須」表示 + if ($addressRequired) $this->tmpl->addVar('show_address', 'required', $this->tagRequired);// 「必須」表示 $this->tmpl->setAttribute('show_address', 'visibility', 'visible');// 住所入力フィールドの表示 } if ($telVisible){ - if ($telRequired) $this->tmpl->addVar('show_tel', 'required', self::DEFAULT_STR_REQUIRED);// 「必須」表示 + if ($telRequired) $this->tmpl->addVar('show_tel', 'required', $this->tagRequired);// 「必須」表示 $this->tmpl->setAttribute('show_tel', 'visibility', 'visible');// 電話番号入力フィールドの表示 } if ($bodyVisible){ - if ($bodyRequired) $this->tmpl->addVar('show_body', 'required', self::DEFAULT_STR_REQUIRED);// 「必須」表示 + if ($bodyRequired) $this->tmpl->addVar('show_body', 'required', $this->tagRequired);// 「必須」表示 $this->tmpl->setAttribute('show_body', 'visibility', 'visible');// 内容入力フィールドの表示 } } diff --git a/widgets/contactus/include/template/index.tmpl.html b/widgets/contactus/include/template/index.tmpl.html index f93607f0..87d108c5 100644 --- a/widgets/contactus/include/template/index.tmpl.html +++ b/widgets/contactus/include/template/index.tmpl.html @@ -5,9 +5,9 @@ * * @package Magic3 Framework * @author 平田直毅(Naoki Hirata) - * @copyright Copyright 2006-2012 Magic3 Project. + * @copyright Copyright 2006-2014 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 */ diff --git a/widgets/contactus/include/template/index_bootstrap.tmpl.html b/widgets/contactus/include/template/index_bootstrap.tmpl.html new file mode 100644 index 00000000..0331fc0c --- /dev/null +++ b/widgets/contactus/include/template/index_bootstrap.tmpl.html @@ -0,0 +1,109 @@ +/** + * 表示データ作成用テンプレート(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-2014 Magic3 Project. + * @license http://www.gnu.org/copyleft/gpl.html GPL License + * @version SVN: $Id$ + * @link http://www.magic3.org + */ + + + +
+ + +

{TITLE_NAME}

+

{EXPLANATION}

+ +
+ +
+

{REQUIRED}

+
+
+ +
+ +
+

{REQUIRED}

+
+
+ +
+ +
+

{REQUIRED}

+
+
+ +
+

{REQUIRED}

+
+
+ +
+ +
+

{REQUIRED}

+
+
+ +
+ +
+

{REQUIRED}

+
+
+ +
+ +
+ +
+

{REQUIRED}

+
+
+ +
+ +
+

{REQUIRED}

+
+
+ +
+ +
+

{REQUIRED}

+
+
+ +
+ +
+

{REQUIRED}

+
+
+
+
+
+
+
-- 2.11.0