dcAdvancedCleaner/_admin.php

40 lines
1.2 KiB
PHP
Raw Normal View History

2018-02-19 18:10:58 +00:00
<?php
2021-09-06 22:09:09 +00:00
/**
* @brief dcAdvancedCleaner, a plugin for Dotclear 2
*
* @package Dotclear
* @subpackage Plugin
*
* @author Jean-Christian Denis and Contributors
*
* @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
2018-02-19 18:10:58 +00:00
2021-09-06 23:39:52 +00:00
if (!defined('DC_CONTEXT_ADMIN')) {
return null;
}
2018-02-19 18:10:58 +00:00
$_menu['Plugins']->addItem(
2021-09-06 22:09:09 +00:00
__('Advanced cleaner'),
2021-09-06 23:39:52 +00:00
$core->adminurl->get('admin.plugin.dcAdvancedCleaner'),
dcPage::getPF('dcAdvancedCleaner/icon.png'),
preg_match(
'/' . preg_quote($core->adminurl->get('admin.plugin.dcAdvancedCleaner')) . '(&.*)?$/',
$_SERVER['REQUEST_URI']
),
2021-09-06 22:09:09 +00:00
$core->auth->isSuperAdmin()
2018-02-19 18:10:58 +00:00
);
2021-09-06 23:39:52 +00:00
$core->addBehavior('adminDashboardFavorites', 'dcAdvancedCleanerDashboardFavorites');
2018-02-19 18:10:58 +00:00
2021-09-06 23:39:52 +00:00
function dcAdvancedCleanerDashboardFavorites(dcCore $core, $favs)
2018-02-19 18:10:58 +00:00
{
2021-09-06 23:39:52 +00:00
$favs->register('dcAdvancedCleaner', [
2021-09-06 22:09:09 +00:00
'title' => __('Advanced cleaner'),
2021-09-06 23:39:52 +00:00
'url' => $core->adminurl->get('admin.plugin.dcAdvancedCleaner'),
'small-icon' => dcPage::getPF('dcAdvancedCleaner/icon.png'),
'large-icon' => dcPage::getPF('dcAdvancedCleaner/icon-big.png'),
'permissions' => $core->auth->isSuperAdmin()
]);
2018-02-19 18:10:58 +00:00
}