Skip to content

Commit

Permalink
Merge pull request #12 from GUSSAN-BEEDAN/work#11
Browse files Browse the repository at this point in the history
addcolor_3rd.cssがユーザー側テーマに影響してしまう。fixed-#11
  • Loading branch information
GUSSAN-BEEDAN authored Apr 26, 2022
2 parents d2876db + 4a8e531 commit 707a1ae
Show file tree
Hide file tree
Showing 8 changed files with 130 additions and 34 deletions.
1 change: 1 addition & 0 deletions Controller/AdminMakeResponsiveController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]])) {
Expand Down
8 changes: 4 additions & 4 deletions Event/AdminMakeResponsiveViewEventListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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 {
Expand Down Expand Up @@ -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 (
Expand All @@ -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 {
Expand Down
29 changes: 0 additions & 29 deletions Lib/addcolorconfig.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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;
Expand Down
50 changes: 50 additions & 0 deletions Lib/addcolorconfig_toolbar.css
Original file line number Diff line number Diff line change
@@ -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;
}
30 changes: 30 additions & 0 deletions Model/AdminMakeResponsive.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

7 changes: 6 additions & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -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に伴うデータベース構造の変更。
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<link rel="stylesheet" type="text/css" href="/admin_make_responsive/css/admin/addcolor_3rd_toolbar.css<?php echo '?' . @filemtime(APP . 'Plugin' . DS . 'AdminMakeResponsive' . DS . 'webroot' . DS . 'css' . DS . 'admin' . DS . 'addcolor_3rd_toolbar.css'); ?>">
38 changes: 38 additions & 0 deletions webroot/css/admin/addcolor_3rd_toolbar.css
Original file line number Diff line number Diff line change
@@ -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] {
}

0 comments on commit 707a1ae

Please sign in to comment.