From e557293f80561d91c66f7a602162bf7987be6fe3 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Thu, 1 Dec 2022 10:51:56 +0100 Subject: [PATCH] use anonymous function --- _admin.php | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/_admin.php b/_admin.php index 8936fce..73d7f12 100644 --- a/_admin.php +++ b/_admin.php @@ -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 */