diff --git a/Backend/Controllers/HeaderNoticeBarAdmin.php b/Backend/Controllers/HeaderNoticeBarAdmin.php index 630a0e8..472b9be 100644 --- a/Backend/Controllers/HeaderNoticeBarAdmin.php +++ b/Backend/Controllers/HeaderNoticeBarAdmin.php @@ -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': diff --git a/Init/Init.php b/Init/Init.php index 561ab78..5d2dfc1 100644 --- a/Init/Init.php +++ b/Init/Init.php @@ -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'; @@ -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'); diff --git a/Init/module.json b/Init/module.json index fe7cb0d..8db17b6 100644 --- a/Init/module.json +++ b/Init/module.json @@ -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",