2021-09-01 23:35:23 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @brief improve, a plugin for Dotclear 2
|
2021-11-01 21:08:56 +00:00
|
|
|
*
|
2021-09-01 23:35:23 +00:00
|
|
|
* @package Dotclear
|
2021-09-06 21:36:50 +00:00
|
|
|
* @subpackage Plugin
|
2021-11-01 21:08:56 +00:00
|
|
|
*
|
2021-09-01 23:35:23 +00:00
|
|
|
* @author Jean-Christian Denis and contributors
|
2021-11-01 21:08:56 +00:00
|
|
|
*
|
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']);
|
|
|
|
|
2021-09-25 21:14:51 +00:00
|
|
|
$core->addBehavior('improveAddAction', ['ImproveActionDcdeprecated', 'create']);
|
2021-09-01 23:35:23 +00:00
|
|
|
$core->addBehavior('improveAddAction', ['ImproveActionDcstore', 'create']);
|
|
|
|
$core->addBehavior('improveAddAction', ['ImproveActionEndoffile', 'create']);
|
2021-09-11 20:25:18 +00:00
|
|
|
$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']);
|
2021-11-01 21:08:56 +00:00
|
|
|
$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
|
|
|
|
{
|
|
|
|
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
|
|
|
|
]
|
|
|
|
);
|
|
|
|
}
|
2021-11-01 21:08:56 +00:00
|
|
|
}
|