Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Backend/Controllers/HeaderNoticeBarAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public function fetch(

$ids = $this->request->post('check');
if (is_array($ids)) {
$ids = array_map('intval', $ids);
$ids = array_filter($ids, function ($id) { return $id > 0; });
$ids = array_map(intval(...), $ids);
$ids = array_filter($ids, fn($id) => $id > 0);
$action = $this->request->post('action');
switch ($action) {
case 'disable':
Expand Down
30 changes: 15 additions & 15 deletions Init/Init.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class Init extends AbstractInit
{
private const PERMISSION = 'sviat__header_notice_bar';
private const string PERMISSION = 'sviat__header_notice_bar';
public const SETTING_DISPLAY_MODE = 'sviat_header_notice_bar_display_mode';
public const SETTING_INTERVAL_MINUTES = 'sviat_header_notice_bar_interval_minutes';
public const DISPLAY_MODE_RANDOM = 'random';
Expand All @@ -22,20 +22,20 @@ public function install()
$this->setBackendMainController('HeaderNoticeBarAdmin');

$this->migrateEntityTable(HeaderNoticeBarEntity::class, [
(new EntityField('id'))->setIndexPrimaryKey()->setTypeInt(11, false)->setAutoIncrement(),
(new EntityField('name'))->setTypeVarchar(255)->setIsLang(),
(new EntityField('content'))->setTypeText()->setIsLang(),
(new EntityField('background_type'))->setTypeVarchar(20)->setDefault('color'),
(new EntityField('background_color'))->setTypeVarchar(7)->setDefault('#ffffff'),
(new EntityField('background_gradient'))->setTypeVarchar(500)->setNullable(),
(new EntityField('gradient_color_from'))->setTypeVarchar(7)->setNullable(),
(new EntityField('gradient_color_to'))->setTypeVarchar(7)->setNullable(),
(new EntityField('visible'))->setTypeTinyInt(1, true)->setDefault(1)->setIndex(),
(new EntityField('position'))->setTypeInt(11)->setDefault(0)->setIndex(),
(new EntityField('publish_from'))->setTypeDatetime(true),
(new EntityField('publish_to'))->setTypeDatetime(true),
(new EntityField('created_at'))->setTypeDatetime(false),
(new EntityField('updated_at'))->setTypeDatetime(false),
new EntityField('id')->setIndexPrimaryKey()->setTypeInt(11, false)->setAutoIncrement(),
new EntityField('name')->setTypeVarchar(255)->setIsLang(),
new EntityField('content')->setTypeText()->setIsLang(),
new EntityField('background_type')->setTypeVarchar(20)->setDefault('color'),
new EntityField('background_color')->setTypeVarchar(7)->setDefault('#ffffff'),
new EntityField('background_gradient')->setTypeVarchar(500)->setNullable(),
new EntityField('gradient_color_from')->setTypeVarchar(7)->setNullable(),
new EntityField('gradient_color_to')->setTypeVarchar(7)->setNullable(),
new EntityField('visible')->setTypeTinyInt(1, true)->setDefault(1)->setIndex(),
new EntityField('position')->setTypeInt(11)->setDefault(0)->setIndex(),
new EntityField('publish_from')->setTypeDatetime(true),
new EntityField('publish_to')->setTypeDatetime(true),
new EntityField('created_at')->setTypeDatetime(false),
new EntityField('updated_at')->setTypeDatetime(false),
]);

$this->registerEntityLangInfo(HeaderNoticeBarEntity::class, 'sviat__header_notice_bar', 'banner');
Expand Down
2 changes: 1 addition & 1 deletion Init/module.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Okay": "4.5.3",
"version": "1.0.5",
"version": "1.0.6",
"moduleName": "Header Notice Bar",
"vendor": {
"email": "devsviat@proton.me",
Expand Down
Loading