postWidgetText/_admin.php

58 lines
2.6 KiB
PHP
Raw Normal View History

2021-09-10 19:06:49 +00:00
<?php
2021-09-10 19:18:51 +00:00
/**
* @brief postWidgetText, 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
*/
2021-09-10 19:06:49 +00:00
if (!defined('DC_CONTEXT_ADMIN')) {
2021-09-10 19:18:51 +00:00
return null;
2021-09-10 19:06:49 +00:00
}
require dirname(__FILE__).'/_widgets.php';
# Admin menu
if ($core->blog->settings->postwidgettext->postwidgettext_active) {
2021-09-10 19:18:51 +00:00
$_menu['Plugins']->addItem(
__('Post widget text'),
2021-10-29 22:36:04 +00:00
$core->adminurl->get('admin.plugin.postWidgetText'),
dcPage::getPF('postWidgetText/icon.png'),
preg_match('/' . preg_quote($core->adminurl->get('admin.plugin.postWidgetText')) . '(&.*)?$/', $_SERVER['REQUEST_URI']),
2021-09-10 19:18:51 +00:00
$core->auth->check('contentadmin', $core->blog->id)
);
2021-09-10 19:06:49 +00:00
2021-10-30 08:30:01 +00:00
$core->addBehavior('adminDashboardFavorites', ['adminPostWidgetText', 'adminDashboardFavorites']);
2021-09-10 19:06:49 +00:00
}
2021-10-29 22:36:04 +00:00
# Pref
2021-10-30 08:30:01 +00:00
$core->addBehavior('adminFiltersLists', ['adminPostWidgetText', 'adminFiltersLists']);
$core->addBehavior('adminBlogPreferencesForm', ['adminPostWidgetText', 'adminBlogPreferencesForm']);
$core->addBehavior('adminBeforeBlogSettingsUpdate', ['adminPostWidgetText', 'adminBeforeBlogSettingsUpdate']);
2021-09-10 19:06:49 +00:00
# Post
2021-10-30 08:30:01 +00:00
$core->addBehavior('adminPostHeaders', ['adminPostWidgetText', 'adminPostHeaders']);
$core->addBehavior('adminPostFormItems', ['adminPostWidgetText', 'adminPostFormItems']);
$core->addBehavior('adminAfterPostUpdate', ['adminPostWidgetText', 'adminAfterPostSave']);
$core->addBehavior('adminAfterPostCreate', ['adminPostWidgetText', 'adminAfterPostSave']);
$core->addBehavior('adminBeforePostDelete', ['adminPostWidgetText', 'adminBeforePostDelete']);
2021-09-10 19:06:49 +00:00
# Plugin "pages"
2021-10-30 08:30:01 +00:00
$core->addBehavior('adminPageHeaders', ['adminPostWidgetText', 'adminPostHeaders']);
$core->addBehavior('adminPageFormItems', ['adminPostWidgetText', 'adminPostFormItems']);
$core->addBehavior('adminAfterPageUpdate', ['adminPostWidgetText', 'adminAfterPostSave']);
$core->addBehavior('adminAfterPageCreate', ['adminPostWidgetText', 'adminAfterPostSave']);
$core->addBehavior('adminBeforePageDelete', ['adminPostWidgetText', 'adminBeforePostDelete']);
2021-09-10 19:06:49 +00:00
# Plugin "importExport"
if ($core->blog->settings->postwidgettext->postwidgettext_importexport_active) {
2021-10-30 08:30:01 +00:00
$core->addBehavior('exportFull', ['adminPostWidgetText', 'exportFull']);
$core->addBehavior('exportSingle', ['adminPostWidgetText', 'exportSingle']);
$core->addBehavior('importInit', ['adminPostWidgetText', 'importInit']);
$core->addBehavior('importSingle', ['adminPostWidgetText', 'importSingle']);
$core->addBehavior('importFull', ['adminPostWidgetText', 'importFull']);
2021-09-10 19:18:51 +00:00
}