add item to plugin simple menu

This commit is contained in:
Jean-Christian Paul Denis 2023-01-02 01:29:15 +01:00
parent 7d77a95c5d
commit 476a6bfc7c
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
2 changed files with 11 additions and 0 deletions

View File

@ -8,6 +8,7 @@ todo
* use anonymous functions (WIP)
* use abstract plugin id
* use short settings id
* add item to plugin simple menu
* add install process
comListe 0.4.2 - 11-11-2017 - Pierre Van Glabeke

View File

@ -36,4 +36,14 @@ dcCore::app()->addBehaviors([
'permissions' => dcCore::app()->auth->makePermissions([dcAuth::PERMISSION_ADMIN]),
]);
},
'adminSimpleMenuAddType' => function (ArrayObject $items) {
$items['comListe'] = new ArrayObject([__('Comments list'), false]);
},
'adminSimpleMenuBeforeEdit' => function ($type, $select, &$item) {
if (basename(__DIR__) == $type) {
$item[0] = __('Comments list');
$item[1] = __('Comments list');
$item[2] = dcCore::app()->admin->blog_url . dcCore::app()->url->getURLFor(basename(__DIR__));
}
}
]);