From 306441b323f1875b372e9de7237f64143817837d Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Mon, 25 Nov 2013 00:04:04 +0100 Subject: [PATCH] Change pagemove support into move support The new pagemove plugin has been renamed into move. --- _test/pagemove_support.test.php | 18 +++++++++--------- action.php | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/_test/pagemove_support.test.php b/_test/pagemove_support.test.php index 6966adc..2158269 100644 --- a/_test/pagemove_support.test.php +++ b/_test/pagemove_support.test.php @@ -5,31 +5,31 @@ */ class plugin_include_pagemove_support_test extends DokuWikiTest { public function setup() { - $this->pluginsEnabled[] = 'pagemove'; + $this->pluginsEnabled[] = 'move'; $this->pluginsEnabled[] = 'include'; parent::setup(); } public function test_relative_include() { global $ID; - /** @var $pagemove helper_plugin_pagemove */ - $pagemove = plugin_load('helper', 'pagemove'); - if (!$pagemove) return; // disable the test when pagemove is not installed + /** @var $move helper_plugin_move */ + $move = plugin_load('helper', 'move'); + if (!$move) return; // disable the test when move is not installed saveWikiText('editx', '{{page>start#start}} %%{{page>start}}%% {{section>wiki:syntax#tables&nofooter}} {{page>:}} {{section>test:start#test}}', 'Testcase created'); idx_addPage('editx'); $ID = 'editx'; $opts['ns'] = ''; $opts['newname'] = 'editx'; $opts['newns'] = 'test'; - $pagemove->move_page($opts); + $move->move_page($opts); $this->assertEquals('{{page>:start#start}} %%{{page>start}}%% {{section>wiki:syntax#tables&nofooter}} {{page>:}} {{section>test:start#test}}',rawWiki('test:editx')); } public function test_rename() { global $ID; - /** @var $pagemove helper_plugin_pagemove */ - $pagemove = plugin_load('helper', 'pagemove'); - if (!$pagemove) return; // disable the test when pagemove is not installed + /** @var $move helper_plugin_move */ + $move = plugin_load('helper', 'move'); + if (!$move) return; // disable the test when move is not installed saveWikiText('editx', 'Page to rename', 'Testcase create'); saveWikiText('links', '{{section>links#foo}} {{page>editx}} {{page>:eDitX&nofooter}} {{section>editx#test}} {{page>editx&nofooter}}', 'Testcase created'); idx_addPage('editx'); @@ -39,7 +39,7 @@ public function test_rename() { $opts['ns'] = ''; $opts['newname'] = 'edit'; $opts['newns'] = 'test'; - $pagemove->move_page($opts); + $move->move_page($opts); $this->assertEquals('{{section>links#foo}} {{page>test:edit}} {{page>test:edit&nofooter}} {{section>test:edit#test}} {{page>test:edit&nofooter}}', rawWiki('links')); } } \ No newline at end of file diff --git a/action.php b/action.php index b82b32e..2e57168 100644 --- a/action.php +++ b/action.php @@ -42,7 +42,7 @@ function register(&$controller) { $controller->register_hook('PARSER_HANDLER_DONE', 'BEFORE', $this, 'handle_parser'); $controller->register_hook('PARSER_METADATA_RENDER', 'AFTER', $this, 'handle_metadata'); $controller->register_hook('HTML_SECEDIT_BUTTON', 'BEFORE', $this, 'handle_secedit_button'); - $controller->register_hook('PAGEMOVE_HANDLERS_REGISTER', 'BEFORE', $this, 'handle_pagemove_register'); + $controller->register_hook('MOVE_HANDLERS_REGISTER', 'BEFORE', $this, 'handle_move_register'); } /** @@ -327,11 +327,11 @@ function handle_secedit_button(Doku_Event &$event, $params) { $event->stopPropagation(); } - public function handle_pagemove_register(Doku_Event $event, $params) { + public function handle_move_register(Doku_Event $event, $params) { $event->data['handlers']['include_include'] = array($this, 'rewrite_include'); } - public function rewrite_include($match, $pos, $state, $plugin, helper_plugin_pagemove_handler $handler) { + public function rewrite_include($match, $pos, $state, $plugin, helper_plugin_move_handler $handler) { $syntax = substr($match, 2, -2); // strip markup $replacers = explode('|', $syntax); $syntax = array_shift($replacers);