use anonymous function

This commit is contained in:
Jean-Christian Denis 2022-12-01 10:51:56 +01:00
parent 491f3c065e
commit e557293f80
Signed by: JcDenis
GPG key ID: 1B5B8C5B90B6C951

View file

@ -50,7 +50,18 @@ class admin
private static function addAdminBehaviors(): void
{
dcCore::app()->addBehavior('adminDashboardFavoritesV2', __NAMESPACE__ . '\admin::adminDashboardFavorites');
dcCore::app()->addBehavior('adminDashboardFavoritesV2', function (dcFavorites $favs): void {
$favs->register(
'improve',
[
'title' => __('improve'),
'url' => dcCore::app()->adminurl->get('admin.plugin.improve'),
'small-icon' => dcPage::getPF('improve/icon.svg'),
'large-icon' => dcPage::getPF('improve/icon.svg'),
//'permissions' => null,
]
);
});
}
private static function addAdminMenu(): void
@ -73,20 +84,6 @@ class admin
}
}
}
public static function adminDashboardFavorites(dcFavorites $favs): void
{
$favs->register(
'improve',
[
'title' => __('improve'),
'url' => dcCore::app()->adminurl->get('admin.plugin.improve'),
'small-icon' => dcPage::getPF('improve/icon.svg'),
'large-icon' => dcPage::getPF('improve/icon.svg'),
'permissions' => null,
]
);
}
}
/* process */