menu[dcAdmin::MENU_PLUGINS]->addItem( __('Comments list'), dcCore::app()->adminurl->get('admin.plugin.' . basename(__DIR__)), urldecode(dcPage::getPF(basename(__DIR__) . '/icon.png')), preg_match('/' . preg_quote(dcCore::app()->adminurl->get('admin.plugin.' . basename(__DIR__))) . '(&.*)?$/', $_SERVER['REQUEST_URI']), dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([dcAuth::PERMISSION_ADMIN]), dcCore::app()->blog->id) ); dcCore::app()->addBehaviors([ // Dashboard favorites 'adminDashboardFavoritesV2' => function (dcFavorites $favs) { $favs->register(basename(__DIR__), [ 'title' => __('Comments list'), 'url' => dcCore::app()->adminurl->get('admin.plugin.' . basename(__DIR__)), 'small-icon' => urldecode(dcPage::getPF(basename(__DIR__) . '/icon.png')), 'large-icon' => urldecode(dcPage::getPF(basename(__DIR__) . '/icon-big.png')), '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__)); } } ]);