Skip to content

Commit

Permalink
Merge branch 'dev-5' of github.com:baserproject/basercms into dev-5
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuring committed Oct 2, 2023
2 parents 95f1800 + 38ae07d commit 68c90e6
Show file tree
Hide file tree
Showing 14 changed files with 265 additions and 80 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.

Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ public function setUp(int $tableId, array $postData = [])
* @param int $tableId
* @checked
* @noTodo
* @unitTest
*/
public function setUseTable(int $tableId)
{
Expand All @@ -179,6 +180,9 @@ public function setUseTable(int $tableId)
*
* @param int $tableId
* @return string
* @noTodo
* @checked
* @unitTest
*/
public function getTableName(int $tableId, string $name = ''): string
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ public function implementedEvents(): array
* ツリービヘイビアのスコープを設定する
*
* @param int $tableId
* @noTodo
* @checked
* @unitTest
*/
public function setTreeScope(int $tableId): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,20 @@ public function test_setUp()
public function test_setUseTable()
{
//準備

//正常系実行

//異常系実行


$dataBaseService = $this->getService(BcDatabaseServiceInterface::class);
$customTable = $this->getService(CustomTablesServiceInterface::class);
$customTable->create([
'id' => 1,
'name' => 'recruit',
'title' => '求人情報',
'type' => '1',
'display_field' => 'title',
]);
$this->CustomEntriesTable->setUseTable(1);
$result = $this->CustomEntriesTable->getTable();
$this->assertEquals('custom_entry_1_recruit', $result);
//不要なテーブルを削除
$dataBaseService->dropTable('custom_entry_1_recruit');
}

/**
Expand All @@ -310,11 +318,23 @@ public function test_setUseTable()
public function test_getTableName()
{
//準備

//正常系実行

//異常系実行

$dataBaseService = $this->getService(BcDatabaseServiceInterface::class);
$customTable = $this->getService(CustomTablesServiceInterface::class);
$customTable->create([
'id' => 1,
'name' => 'recruit',
'title' => '求人情報',
'type' => '1',
'display_field' => 'title',
]);
//正常系実行: name パラメータなし
$result = $this->CustomEntriesTable->getTableName(1);
$this->assertEquals('custom_entry_1_recruit', $result);
//正常系実行: name パラメータあり
$result = $this->CustomEntriesTable->getTableName(1, 'Nghiem');
$this->assertEquals('custom_entry_1_Nghiem', $result);
//不要なテーブルを削除
$dataBaseService->dropTable('custom_entry_1_recruit');

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ public function test_implementedEvents()
*/
public function test_setTreeScope()
{

$this->CustomLinksTable->setTreeScope(1);
$result = $this->CustomLinksTable->getBehavior('Tree')->getConfig('scope');
$this->assertEquals(['custom_table_id' => 1], $result);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class BcThemeConfigServiceProvider extends ServiceProvider
* @param \Cake\Core\ContainerInterface $container
* @checked
* @noTodo
* @unitTest
*/
public function services($container): void
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php
/**
* baserCMS : Based Website Development Project <https://basercms.net>
* Copyright (c) NPO baser foundation <https://baserfoundation.org/>
*
* @copyright Copyright (c) NPO baser foundation
* @link https://basercms.net baserCMS Project
* @since 5.0.0
* @license https://basercms.net/license/index.html MIT License
*/

namespace BcThemeConfig\Test\TestCase\ServiceProvider;

use BaserCore\TestSuite\BcTestCase;
use BcThemeConfig\Service\ThemeConfigsServiceInterface;
use BcThemeConfig\ServiceProvider\BcThemeConfigServiceProvider;
use Cake\Core\Container;

/**
* Class BcThemeConfigServiceProviderTest
* @property BcThemeConfigServiceProvider $BcThemeConfigServiceProvider
*/
class BcThemeConfigServiceProviderTest extends BcTestCase
{

/**
* Set Up
*
* @return void
*/
public function setUp(): void
{
parent::setUp();
$this->BcThemeConfigServiceProvider = new BcThemeConfigServiceProvider();
}

/**
* Tear Down
*
* @return void
*/
public function tearDown(): void
{
unset($this->BcThemeConfigServiceProvider);
parent::tearDown();
}

/**
* @test services
* @return void
*/
public function testServices()
{
$container = new Container();
$this->BcThemeConfigServiceProvider->services($container);
$this->assertTrue($container->has(ThemeConfigsServiceInterface::class));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ class ThemeFilesController extends BcAdminAppController
* @param string|null $name
* @param EventManagerInterface|null $eventManager
* @param ComponentRegistry|null $components
*
* @checked
* @noTodo
* @unitTest
*/
public function __construct(
?ServerRequest $request = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ class ThemeFilesController extends BcAdminApiController
* [API] テーマファイル ファイル新規追加
*
* @param ThemeFilesServiceInterface $service
* @checked
* @noTodo
* @unitTest
*/
public function add(ThemeFilesServiceInterface $service)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class ThemeFoldersController extends BcAdminApiController
* @param ThemeFoldersService $service
* @checked
* @noTodo
* @unitTest
*/
public function batch(ThemeFoldersServiceInterface $service)
{
Expand Down
Loading

0 comments on commit 68c90e6

Please sign in to comment.