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'),
|
|
|
|
'plugin.php?p=postWidgetText',
|
|
|
|
'index.php?pf=postWidgetText/icon.png',
|
|
|
|
preg_match(
|
|
|
|
'/plugin.php\?p=postWidgetText(&.*)?$/',
|
|
|
|
$_SERVER['REQUEST_URI']),
|
|
|
|
$core->auth->check('contentadmin', $core->blog->id)
|
|
|
|
);
|
2021-09-10 19:06:49 +00:00
|
|
|
|
2021-09-10 19:18:51 +00:00
|
|
|
$core->addBehavior(
|
|
|
|
'adminDashboardFavorites',
|
|
|
|
array('postWidgetTextDashboard', 'favorites')
|
|
|
|
);
|
2021-09-10 19:06:49 +00:00
|
|
|
}
|
|
|
|
# Post
|
|
|
|
$core->addBehavior(
|
2021-09-10 19:18:51 +00:00
|
|
|
'adminPostHeaders',
|
|
|
|
array('postWidgetTextAdmin', 'headers'));
|
2021-09-10 19:06:49 +00:00
|
|
|
$core->addBehavior(
|
2021-09-10 19:18:51 +00:00
|
|
|
'adminPostFormItems',
|
|
|
|
array('postWidgetTextAdmin', 'form'));
|
2021-09-10 19:06:49 +00:00
|
|
|
$core->addBehavior(
|
2021-09-10 19:18:51 +00:00
|
|
|
'adminAfterPostUpdate',
|
|
|
|
array('postWidgetTextAdmin', 'save'));
|
2021-09-10 19:06:49 +00:00
|
|
|
$core->addBehavior(
|
2021-09-10 19:18:51 +00:00
|
|
|
'adminAfterPostCreate',
|
|
|
|
array('postWidgetTextAdmin', 'save'));
|
2021-09-10 19:06:49 +00:00
|
|
|
$core->addBehavior(
|
2021-09-10 19:18:51 +00:00
|
|
|
'adminBeforePostDelete',
|
|
|
|
array('postWidgetTextAdmin', 'delete'));
|
2021-09-10 19:06:49 +00:00
|
|
|
|
|
|
|
# Plugin "pages"
|
|
|
|
$core->addBehavior(
|
2021-09-10 19:18:51 +00:00
|
|
|
'adminPageHeaders',
|
|
|
|
array('postWidgetTextAdmin', 'headers'));
|
2021-09-10 19:06:49 +00:00
|
|
|
$core->addBehavior(
|
2021-09-10 19:18:51 +00:00
|
|
|
'adminPageFormItems',
|
|
|
|
array('postWidgetTextAdmin', 'form'));
|
2021-09-10 19:06:49 +00:00
|
|
|
$core->addBehavior(
|
2021-09-10 19:18:51 +00:00
|
|
|
'adminAfterPageUpdate',
|
|
|
|
array('postWidgetTextAdmin', 'save'));
|
2021-09-10 19:06:49 +00:00
|
|
|
$core->addBehavior(
|
2021-09-10 19:18:51 +00:00
|
|
|
'adminAfterPageCreate',
|
|
|
|
array('postWidgetTextAdmin', 'save'));
|
2021-09-10 19:06:49 +00:00
|
|
|
$core->addBehavior(
|
2021-09-10 19:18:51 +00:00
|
|
|
'adminBeforePageDelete',
|
|
|
|
array('postWidgetTextAdmin', 'delete'));
|
2021-09-10 19:06:49 +00:00
|
|
|
|
|
|
|
# Plugin "importExport"
|
|
|
|
if ($core->blog->settings->postwidgettext->postwidgettext_importexport_active) {
|
2021-09-10 19:18:51 +00:00
|
|
|
$core->addBehavior(
|
|
|
|
'exportFull',
|
|
|
|
array('postWidgetTextBackup', 'exportFull')
|
|
|
|
);
|
|
|
|
$core->addBehavior(
|
|
|
|
'exportSingle',
|
|
|
|
array('postWidgetTextBackup', 'exportSingle')
|
|
|
|
);
|
|
|
|
$core->addBehavior(
|
|
|
|
'importInit',
|
|
|
|
array('postWidgetTextBackup', 'importInit')
|
|
|
|
);
|
|
|
|
$core->addBehavior(
|
|
|
|
'importSingle',
|
|
|
|
array('postWidgetTextBackup', 'importSingle')
|
|
|
|
);
|
|
|
|
$core->addBehavior(
|
|
|
|
'importFull',
|
|
|
|
array('postWidgetTextBackup', 'importFull')
|
|
|
|
);
|
|
|
|
}
|