[1806] | 1 | <?php |
---|
[3731] | 2 | /** |
---|
| 3 | * @brief dclegacy, a plugin for Dotclear 2 |
---|
| 4 | * |
---|
| 5 | * @package Dotclear |
---|
| 6 | * @subpackage Plugins |
---|
| 7 | * |
---|
| 8 | * @copyright Olivier Meunier & Association Dotclear |
---|
| 9 | * @copyright GPL-2.0-only |
---|
| 10 | */ |
---|
| 11 | |
---|
[3730] | 12 | if (!defined('DC_CONTEXT_ADMIN')) {return;} |
---|
[1806] | 13 | |
---|
[3874] | 14 | $GLOBALS['core']->addBehavior('adminPostsActionsPage', ['dcLegacyPosts', 'adminPostsActionsPage']); |
---|
| 15 | $GLOBALS['core']->addBehavior('adminPagesActionsPage', ['dcLegacyPages', 'adminPagesActionsPage']); |
---|
| 16 | $GLOBALS['core']->addBehavior('adminCommentsActionsPage', ['dcLegacyComments', 'adminCommentsActionsPage']); |
---|
[1806] | 17 | |
---|
[2566] | 18 | /* Handle deprecated behaviors : |
---|
[3730] | 19 | * adminPostsActionsCombo |
---|
| 20 | * adminPostsActionsHeaders |
---|
| 21 | * adminPostsActionsContent |
---|
| 22 | */ |
---|
[1806] | 23 | class dcLegacyPosts |
---|
| 24 | { |
---|
[3730] | 25 | public static function adminPostsActionsPage($core, dcPostsActionsPage $as) |
---|
| 26 | { |
---|
| 27 | $stub_actions = new ArrayObject(); |
---|
[3874] | 28 | $core->callBehavior('adminPostsActionsCombo', [$stub_actions]); |
---|
[3730] | 29 | if (!empty($stub_actions)) { |
---|
[3874] | 30 | $as->addAction($stub_actions, ['dcLegacyPosts', 'onActionLegacy']); |
---|
[3730] | 31 | } |
---|
| 32 | } |
---|
[2566] | 33 | |
---|
[3730] | 34 | public static function onActionLegacy($core, dcPostsActionsPage $as, $post) |
---|
| 35 | { |
---|
| 36 | $core->callBehavior('adminPostsActions', $core, $as->getRS(), $as->getAction(), $as->getRedirection()); |
---|
| 37 | $as->beginPage('', |
---|
| 38 | dcPage::jsLoad('js/jquery/jquery.autocomplete.js') . |
---|
| 39 | dcPage::jsMetaEditor() . |
---|
| 40 | $core->callBehavior('adminPostsActionsHeaders'), ''); |
---|
| 41 | $core->callBehavior('adminPostsActionsContent', $core, $as->getAction(), $as->getHiddenFields(true)); |
---|
| 42 | $as->endPage(); |
---|
[2566] | 43 | |
---|
[3730] | 44 | } |
---|
[1806] | 45 | } |
---|
[1905] | 46 | |
---|
[2566] | 47 | /* Handle deprecated behaviors : |
---|
[3730] | 48 | * adminCommentsActionsCombo |
---|
| 49 | * adminCommentsActionsHeaders |
---|
| 50 | * adminCommentsActionsContent |
---|
| 51 | */ |
---|
[1905] | 52 | class dcLegacyComments |
---|
| 53 | { |
---|
[3730] | 54 | public static function adminCommentsActionsPage($core, dcCommentsActionsPage $as) |
---|
| 55 | { |
---|
| 56 | $stub_actions = new ArrayObject(); |
---|
[3874] | 57 | $core->callBehavior('adminCommentsActionsCombo', [$stub_actions]); |
---|
[3730] | 58 | if (!empty($stub_actions)) { |
---|
[3874] | 59 | $as->addAction($stub_actions, ['dcLegacyComments', 'onActionLegacy']); |
---|
[3730] | 60 | } |
---|
| 61 | } |
---|
[2566] | 62 | |
---|
[3730] | 63 | public static function onActionLegacy($core, dcCommentsActionsPage $as, $Comment) |
---|
| 64 | { |
---|
| 65 | $core->callBehavior('adminCommentsActions', $core, $as->getRS(), $as->getAction(), $as->getRedirection()); |
---|
| 66 | $as->beginPage('', |
---|
| 67 | dcPage::jsLoad('js/jquery/jquery.autocomplete.js') . |
---|
| 68 | dcPage::jsMetaEditor() . |
---|
| 69 | $core->callBehavior('adminCommentsActionsHeaders'), ''); |
---|
| 70 | ob_start(); |
---|
| 71 | $core->callBehavior('adminCommentsActionsContent', $core, $as->getAction(), $as->getHiddenFields(true)); |
---|
| 72 | $res = ob_get_contents(); |
---|
| 73 | ob_end_clean(); |
---|
| 74 | $res = str_replace("comments_actions.php", $as->getURI(), $res); |
---|
| 75 | echo $res; |
---|
| 76 | $as->endPage(); |
---|
[2566] | 77 | |
---|
[3730] | 78 | } |
---|
[2055] | 79 | } |
---|
[2566] | 80 | /* Handle deprecated behaviors : |
---|
[3730] | 81 | * adminPagesActionsCombo |
---|
| 82 | * adminPagesActionsHeaders |
---|
| 83 | * adminPagesActionsContent |
---|
| 84 | */ |
---|
[2055] | 85 | class dcLegacyPages |
---|
| 86 | { |
---|
[3730] | 87 | public static function adminPagesActionsPage($core, dcPagesActionsPage $as) |
---|
| 88 | { |
---|
| 89 | $stub_actions = new ArrayObject(); |
---|
[3874] | 90 | $core->callBehavior('adminPagesActionsCombo', [$stub_actions]); |
---|
[3730] | 91 | if (!empty($stub_actions)) { |
---|
[3874] | 92 | $as->addAction($stub_actions, ['dcLegacyPages', 'onActionLegacy']); |
---|
[3730] | 93 | } |
---|
| 94 | } |
---|
[2566] | 95 | |
---|
[3730] | 96 | public static function onActionLegacy($core, dcPagesActionsPage $as, $post) |
---|
| 97 | { |
---|
| 98 | $core->callBehavior('adminPostsActions', $core, $as->getRS(), $as->getAction(), $as->getRedirection()); |
---|
| 99 | $as->beginPage('', |
---|
| 100 | dcPage::jsLoad('js/jquery/jquery.autocomplete.js') . |
---|
| 101 | dcPage::jsMetaEditor() . |
---|
| 102 | $core->callBehavior('adminPostsActionsHeaders'), ''); |
---|
| 103 | ob_start(); |
---|
| 104 | $core->callBehavior('adminPostsActionsContent', $core, $as->getAction(), $as->getHiddenFields(true)); |
---|
| 105 | $res = ob_get_contents(); |
---|
| 106 | ob_end_clean(); |
---|
| 107 | $res = str_replace("posts_actions.php", "plugin.php", $res); |
---|
| 108 | echo $res; |
---|
| 109 | $as->endPage(); |
---|
| 110 | } |
---|
[2566] | 111 | } |
---|