diff --git a/Controller/AdminMakeResponsiveController.php b/Controller/AdminMakeResponsiveController.php index cccb70c..79053b0 100644 --- a/Controller/AdminMakeResponsiveController.php +++ b/Controller/AdminMakeResponsiveController.php @@ -7,6 +7,7 @@ public function admin_index() { $this->data = $this->AdminMakeResponsive->find('first'); } else { $this->AdminMakeResponsive->addColorConfig($this->request->data); + $this->AdminMakeResponsive->addColorConfigToolbar($this->request->data); $this->AdminMakeResponsive->set($this->request->data['AdminMakeResponsive']); $id = $this->request->data['AdminMakeResponsive']['id']; if ($this->AdminMakeResponsive->save(['conditions' => ['id' => $id]])) { diff --git a/Event/AdminMakeResponsiveViewEventListener.php b/Event/AdminMakeResponsiveViewEventListener.php index 25c313a..989c433 100644 --- a/Event/AdminMakeResponsiveViewEventListener.php +++ b/Event/AdminMakeResponsiveViewEventListener.php @@ -77,7 +77,7 @@ public function beforeLayout(CakeEvent $event) { // +レスポンシブ有効 +テーマカラー有効 $View->start('admin_make_responsive'); $AdminMakeResponsive = $View->element('AdminMakeResponsive.admin/admin_make_responsive_toolbar_addfiles',['setdatas' => $setdatas]); - $AdminMakeResponsive = $View->element('AdminMakeResponsive.admin/admin_make_responsive_addcolorfiles',['setdatas' => $setdatas]); + $AdminMakeResponsive = $View->element('AdminMakeResponsive.admin/admin_make_responsive_toolbar_addcolorfiles',['setdatas' => $setdatas]); $View->end(); $View->append('css', $AdminMakeResponsive); } else if ( @@ -97,7 +97,7 @@ public function beforeLayout(CakeEvent $event) { ) { // +レスポンシブ無効 +テーマカラー有効 $View->start('admin_make_responsive'); - $AdminMakeResponsive = $View->element('AdminMakeResponsive.admin/admin_make_responsive_addcolorfiles',['setdatas' => $setdatas]); + $AdminMakeResponsive = $View->element('AdminMakeResponsive.admin/admin_make_responsive_toolbar_addcolorfiles',['setdatas' => $setdatas]); $View->end(); $View->append('css', $AdminMakeResponsive); } else { @@ -138,7 +138,7 @@ public function beforeLayout(CakeEvent $event) { // +レスポンシブ有効 +テーマカラー有効 $View->start('admin_make_responsive'); $AdminMakeResponsive = $View->element('AdminMakeResponsive.admin/admin_make_responsive_toolbar_addfiles',['setdatas' => $setdatas]); - $AdminMakeResponsive = $View->element('AdminMakeResponsive.admin/admin_make_responsive_addcolorfiles',['setdatas' => $setdatas]); + $AdminMakeResponsive = $View->element('AdminMakeResponsive.admin/admin_make_responsive_toolbar_addcolorfiles',['setdatas' => $setdatas]); $View->end(); $View->append('css', $AdminMakeResponsive); } else if ( @@ -158,7 +158,7 @@ public function beforeLayout(CakeEvent $event) { ) { // +レスポンシブ無効 +テーマカラー有効 $View->start('admin_make_responsive'); - $AdminMakeResponsive = $View->element('AdminMakeResponsive.admin/admin_make_responsive_addcolorfiles',['setdatas' => $setdatas]); + $AdminMakeResponsive = $View->element('AdminMakeResponsive.admin/admin_make_responsive_toolbar_addcolorfiles',['setdatas' => $setdatas]); $View->end(); $View->append('css', $AdminMakeResponsive); } else { diff --git a/Lib/addcolorconfig.css b/Lib/addcolorconfig.css index bfc18a8..cc9a3a6 100644 --- a/Lib/addcolorconfig.css +++ b/Lib/addcolorconfig.css @@ -26,9 +26,6 @@ tr .bca-table-listup__thead-th--select a { tr .bca-table-listup__thead-th--select a .bca-btn-icon-text[data-bca-btn-type=draggable]::before { color: ADMINMAIN; } -.bca-login__title { - color: ADMINMAIN; - } .bca-btn[data-bca-btn-category=text] { color: ADMINMAIN; } @@ -93,21 +90,6 @@ tr .bca-table-listup__thead-th--select a .bca-btn-icon-text[data-bca-btn-type=dr background: ADMINMAIN !important; } - -/* linear-gradient */ -.bca-btn-icon[data-bca-btn-type=login] { - background-image: linear-gradient(ADMINMAIN 10%, ADMINSUB 100%); - } -.bca-btn-icon[data-bca-btn-type=login]:hover, .bca-btn-icon[data-bca-btn-type=login]:focus { - background-image: linear-gradient(ADMINSUB 10%, ADMINSUB 100%); - } -.bca-btn[data-bca-btn-type=login] { - background-image: linear-gradient(ADMINMAIN 10%, ADMINSUB 100%); - } -.bca-btn[data-bca-btn-type=login]:hover, .bca-btn[data-bca-btn-type=login]:focus { - background-image: linear-gradient(ADMINSUB 10%, ADMINSUB 100%); - } - /* border-color */ /* box-shadow */ @@ -176,17 +158,6 @@ tr .bca-table-listup__thead-th--select a .bca-btn-icon-text[data-bca-btn-type=dr } -.bca-btn-icon[data-bca-btn-type=login] { - border: 1px solid ADMINSUB; - } -.bca-btn-icon-text[data-bca-btn-type=login] { - border: 1px solid ADMINSUB; - } -.bca-btn[data-bca-btn-type=login] { - border: 1px solid ADMINSUB; - } - - /* toolbar.cssに対する上書き */ .bca-toolbar__users > ul > li.active > ul a:hover { background-color: ADMINMAIN !important; diff --git a/Lib/addcolorconfig_toolbar.css b/Lib/addcolorconfig_toolbar.css new file mode 100644 index 0000000..ba761b8 --- /dev/null +++ b/Lib/addcolorconfig_toolbar.css @@ -0,0 +1,50 @@ +@charset "UTF-8"; +/* v4.5.6時点でのadmin-third管理画面のstyle.cssおよびtoolbar.cssを対象に作成 */ +/* toolbar.cssに対する上書き */ +.bca-toolbar__users > ul > li.active > ul a:hover { + background-color: ADMINMAIN !important; + } + + +/* style.cssに対する上書き */ +/* ログイン画面 */ +/* color */ +.bca-login__title { + color: ADMINMAIN; + } +.bca-login-forgot-pass a { + color: ADMINMAIN; + } + +/* linear-gradient */ +.bca-btn-icon[data-bca-btn-type=login] { + background-image: linear-gradient(ADMINMAIN 10%, ADMINSUB 100%); + } +.bca-btn-icon[data-bca-btn-type=login]:hover, .bca-btn-icon[data-bca-btn-type=login]:focus { + background-image: linear-gradient(ADMINSUB 10%, ADMINSUB 100%); + } +.bca-btn[data-bca-btn-type=login] { + background-image: linear-gradient(ADMINMAIN 10%, ADMINSUB 100%); + } +.bca-btn[data-bca-btn-type=login]:hover, .bca-btn[data-bca-btn-type=login]:focus { + background-image: linear-gradient(ADMINSUB 10%, ADMINSUB 100%); + } + +/* border-color */ +/* box-shadow */ +.bca-login-form-item .bca-textbox .bca-textbox__input:focus { + border-color: ADMINMAIN; + } +.bca-btn:focus, .ui-dialog-buttonset button:focus, .button-small:focus { + box-shadow: 0 0 4px 0px ADMINMAIN; + } + +.bca-btn-icon[data-bca-btn-type=login] { + border: 1px solid ADMINSUB; + } +.bca-btn-icon-text[data-bca-btn-type=login] { + border: 1px solid ADMINSUB; + } +.bca-btn[data-bca-btn-type=login] { + border: 1px solid ADMINSUB; + } \ No newline at end of file diff --git a/Model/AdminMakeResponsive.php b/Model/AdminMakeResponsive.php index 3dda221..b9ac0c7 100644 --- a/Model/AdminMakeResponsive.php +++ b/Model/AdminMakeResponsive.php @@ -69,5 +69,35 @@ public function addColorConfig($data){ $File->write($config); $File->close(); } + + +/** + * テーマカラー設定を保存する(toolbarおよびログイン画面用) + * + */ + public function addColorConfigToolbar($data){ + $configPath = APP . 'Plugin' . DS . 'AdminMakeResponsive' . DS . 'Lib' . DS . 'addcolorconfig_toolbar.css'; + if (!file_exists($configPath)) { + return false; + } + $File = new File($configPath); + $config = $File->read(); + $settings = [ + 'ADMINMAIN' => 'admin_color_main', + 'ADMINSUB' => 'admin_color_sub' + ]; + $settingExists = false; + foreach($settings as $key => $setting) { + if (empty($data['AdminMakeResponsive'][$setting])) { + $config = preg_replace("/\n.+?" . $key . ".+?\n/", "\n", $config); + } else { + $config = str_replace($key, '#' . $data['AdminMakeResponsive'][$setting], $config); + $settingExists = true; + } + } + $File = new File(APP . 'Plugin' . DS . 'AdminMakeResponsive' . DS . 'webroot' . DS . 'css' . DS . 'admin' . DS . 'addcolor_3rd_toolbar.css', true, 0644); + $File->write($config); + $File->close(); + } } \ No newline at end of file diff --git a/VERSION.txt b/VERSION.txt index 58781d4..cf6fb4b 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1,7 +1,12 @@ -1.1.0 +1.1.1 // Release Notes // +[2022-04-26] AdminMakeResponsive-1.1.1 +- #11バグfix。addcolor_3rd.cssのa要素にクラス属性をつけられないため、ユーザー側テーマに影響してしまうバグに対応。 +- コンテンツリスト、ファンクションアイコンエリアのオーバーフロー対策。 +- 条件分岐処理の整理。 + [2022-04-18] AdminMakeResponsive-1.1.0 - #1管理側のみのテーマカラー変更機能の追加。 - #1に伴うデータベース構造の変更。 diff --git a/View/Elements/admin/admin_make_responsive_toolbar_addcolorfiles.php b/View/Elements/admin/admin_make_responsive_toolbar_addcolorfiles.php new file mode 100644 index 0000000..d417dc4 --- /dev/null +++ b/View/Elements/admin/admin_make_responsive_toolbar_addcolorfiles.php @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/webroot/css/admin/addcolor_3rd_toolbar.css b/webroot/css/admin/addcolor_3rd_toolbar.css new file mode 100644 index 0000000..3bdf651 --- /dev/null +++ b/webroot/css/admin/addcolor_3rd_toolbar.css @@ -0,0 +1,38 @@ +@charset "UTF-8"; +/* v4.5.6時点でのadmin-third管理画面のstyle.cssおよびtoolbar.cssを対象に作成 */ +/* toolbar.cssに対する上書き */ +.bca-toolbar__users > ul > li.active > ul a:hover { + } + + +/* style.cssに対する上書き */ +/* ログイン画面 */ +/* color */ +.bca-login__title { + } +.bca-login-forgot-pass a { + } + +/* linear-gradient */ +.bca-btn-icon[data-bca-btn-type=login] { + } +.bca-btn-icon[data-bca-btn-type=login]:hover, .bca-btn-icon[data-bca-btn-type=login]:focus { + } +.bca-btn[data-bca-btn-type=login] { + } +.bca-btn[data-bca-btn-type=login]:hover, .bca-btn[data-bca-btn-type=login]:focus { + } + +/* border-color */ +/* box-shadow */ +.bca-login-form-item .bca-textbox .bca-textbox__input:focus { + } +.bca-btn:focus, .ui-dialog-buttonset button:focus, .button-small:focus { + } + +.bca-btn-icon[data-bca-btn-type=login] { + } +.bca-btn-icon-text[data-bca-btn-type=login] { + } +.bca-btn[data-bca-btn-type=login] { + } \ No newline at end of file