arlequin/_admin.php

45 lines
1.4 KiB
PHP
Raw Normal View History

2022-12-14 22:35:40 +00:00
<?php
/**
* @brief arlequin, a plugin for Dotclear 2
*
* @package Dotclear
* @subpackage Plugin
*
* @author Oleksandr Syenchuk, Pierre Van Glabeke and contributors
*
* @copyright Jean-Crhistian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
if (!defined('DC_CONTEXT_ADMIN')) {
return;
}
2015-04-22 13:29:49 +00:00
2022-12-14 22:35:40 +00:00
require __DIR__ . '/_widgets.php';
2015-04-22 13:29:49 +00:00
2022-12-14 22:35:40 +00:00
// Admin sidebar menu
dcCore::app()->menu[dcAdmin::MENU_BLOG]->addItem(
__('Arlequin'),
dcCore::app()->adminurl->get('admin.plugin.' . basename(__DIR__)),
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_CONTENT_ADMIN,
]), dcCore::app()->blog->id)
);
2015-04-22 13:29:49 +00:00
2022-12-14 22:35:40 +00:00
// Admin dashbaord favorite
dcCore::app()->addBehavior('adminDashboardFavoritesV2', function ($favs) {
$favs->register(basename(__DIR__), [
'title' => __('Arlequin'),
'url' => dcCore::app()->adminurl->get('admin.plugin.' . basename(__DIR__)),
'small-icon' => dcPage::getPF(basename(__DIR__) . '/icon.png'),
'large-icon' => dcPage::getPF(basename(__DIR__) . '/icon-big.png'),
'permissions' => dcCore::app()->auth->makePermissions([
dcAuth::PERMISSION_CONTENT_ADMIN,
]),
]);
});