improve/_admin.php

49 lines
1.7 KiB
PHP
Raw Normal View History

2021-09-01 23:35:23 +00:00
<?php
/**
* @brief improve, a plugin for Dotclear 2
*
* @package Dotclear
2021-09-06 21:36:50 +00:00
* @subpackage Plugin
2021-09-01 23:35:23 +00:00
*
* @author Jean-Christian Denis and contributors
*
* @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
$core->blog->settings->addNamespace('improve');
$core->addBehavior('adminDashboardFavorites', ['ImproveBehaviors', 'adminDashboardFavorites']);
$core->addBehavior('improveAddAction', ['ImproveActionDcstore', 'create']);
$core->addBehavior('improveAddAction', ['ImproveActionEndoffile', 'create']);
//$core->addBehavior('improveAddAction', ['ImproveActionLicense', 'create']);
$core->addBehavior('improveAddAction', ['ImproveActionNewline', 'create']);
$core->addBehavior('improveAddAction', ['ImproveActionPhpheader', 'create']);
$core->addBehavior('improveAddAction', ['ImproveActionTab', 'create']);
$core->addBehavior('improveAddAction', ['ImproveActionZip', 'create']);
$_menu['Plugins']->addItem(
__('improve'),
$core->adminurl->get('admin.plugin.improve'),
dcPage::getPF('improve/icon.png'),
preg_match('/' . preg_quote($core->adminurl->get('admin.plugin.improve')) . '(&.*)?$/', $_SERVER['REQUEST_URI']),
$core->auth->isSuperAdmin()
);
class ImproveBehaviors
{
public static function adminDashboardFavorites($core, $favs)
{
$favs->register(
'improve',
[
'title' => __('improve'),
'url' => $core->adminurl->get('admin.plugin.improve'),
'small-icon' => dcPage::getPF('improve/icon.png'),
'large-icon' => dcPage::getPF('improve/icon-b.png'),
'permissions' => null
]
);
}
}