Skip to content

Commit

Permalink
fix #1915 【テーマファイル管理】サブメニューのアコーディオン調整 (#2776)
Browse files Browse the repository at this point in the history
Co-authored-by: Đỗ Văn Hùng <[email protected]>
  • Loading branch information
HungDV2022 and dovanhung authored Oct 2, 2023
1 parent fc1feeb commit 38ae07d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
* @license https://basercms.net/license/index.html MIT License
*/

$(function (){
$(function () {
$('#ThemeFilesMenu').accordion({
collapsible: true,
heightStyle: "content"
heightStyle: "content",
active: parseInt($('.selected-plugin').attr("data-id"))
});
});

Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* @var \BaserCore\View\BcAdminAppView $this
* @var bool $isDefaultTheme
* @var string $theme
* @var string $plugin
*/
$types = [
'layout' => __d('baser_core', 'レイアウト'),
Expand All @@ -38,17 +39,25 @@


<div class="bca-main__submenu" id="ThemeFilesMenu">
<?php foreach($plugins as $plugin): ?>
<?php if (!\BaserCore\Utility\BcUtil::getExistsTemplateDir($theme, $plugin['name'], '', 'front') &&
!\BaserCore\Utility\BcUtil::getExistsWebrootDir($theme, $plugin['name'], '', 'front')) continue; ?>
<h2 class="bca-main__submenu-title">
<?php echo $plugin['title'] ?>
<?php foreach($plugins as $k => $pluginVal): ?>
<?php if (!\BaserCore\Utility\BcUtil::getExistsTemplateDir($theme, $pluginVal['name'], '', 'front') &&
!\BaserCore\Utility\BcUtil::getExistsWebrootDir($theme, $pluginVal['name'], '', 'front')) continue; ?>

<?php
if($pluginVal['name'] == $plugin) {
$activeClass = 'selected-plugin';
}else {
$activeClass = '';
}
?>
<h2 class="bca-main__submenu-title <?php echo $activeClass ?>" data-id="<?php echo ($k -1) ?>">
<?php echo $pluginVal['title'] ?>
</h2>
<ul class="bca-main__submenu-list clearfix">
<?php foreach($types as $key => $type): ?>
<li class="bca-main__submenu-list-item">
<?php if ($theme !== $plugin['name']): ?>
<?php $this->BcBaser->link(sprintf(__d('baser_core', '%s 一覧'), $type), ['action' => 'index', $theme, $plugin['name'], $key]) ?>
<?php if ($theme !== $pluginVal['name']): ?>
<?php $this->BcBaser->link(sprintf(__d('baser_core', '%s 一覧'), $type), ['action' => 'index', $theme, $pluginVal['name'], $key]) ?>
<?php else: ?>
<?php $this->BcBaser->link(sprintf(__d('baser_core', '%s 一覧'), $type), ['action' => 'index', $theme, $key]) ?>
<?php endif ?>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 38ae07d

Please sign in to comment.