improve/_admin.php

54 lines
2.1 KiB
PHP
Raw Normal View History

2021-09-01 23:35:23 +00:00
<?php
/**
* @brief improve, a plugin for Dotclear 2
*
2021-09-01 23:35:23 +00:00
* @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
*
2021-09-01 23:35:23 +00:00
* @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', ['ImproveActionDcdeprecated', 'create']);
2021-09-01 23:35:23 +00:00
$core->addBehavior('improveAddAction', ['ImproveActionDcstore', 'create']);
$core->addBehavior('improveAddAction', ['ImproveActionEndoffile', 'create']);
$core->addBehavior('improveAddAction', ['ImproveActionGitshields', 'create']);
$core->addBehavior('improveAddAction', ['ImproveActionLicensefile', 'create']);
2021-09-01 23:35:23 +00:00
//$core->addBehavior('improveAddAction', ['ImproveActionLicense', 'create']);
$core->addBehavior('improveAddAction', ['ImproveActionNewline', 'create']);
$core->addBehavior('improveAddAction', ['ImproveActionPhpcsfixer', 'create']);
2021-09-01 23:35:23 +00:00
$core->addBehavior('improveAddAction', ['ImproveActionPhpheader', 'create']);
2021-11-06 23:55:24 +00:00
$core->addBehavior('improveAddAction', ['ImproveActionPhpstan', 'create']);
2021-09-01 23:35:23 +00:00
$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
{
2021-11-07 23:59:52 +00:00
public static function adminDashboardFavorites(dcCore $core, dcFavorites $favs): void
2021-09-01 23:35:23 +00:00
{
$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
]
);
}
}