Skip to content

Commit

Permalink
Renamed the pagemove plugin to "move"
Browse files Browse the repository at this point in the history
Note that all class and event names that contained the name "pagemove"
have been renamed to the same name without "page".
  • Loading branch information
michitux committed Nov 20, 2013
1 parent 6d7bd5c commit bcaa37b
Show file tree
Hide file tree
Showing 22 changed files with 110 additions and 110 deletions.
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
@@ -1 +1 @@
A DokuWiki pagemove plugin
A DokuWiki move plugin
4 changes: 2 additions & 2 deletions _test/mediaindex.test.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
*
* @author Michael Hamann <[email protected]>
*/
class plugin_pagemove_mediaindex_test extends DokuWikiTest {
class plugin_move_mediaindex_test extends DokuWikiTest {

public function setUp() {
$this->pluginsEnabled[] = 'pagemove';
$this->pluginsEnabled[] = 'move';
parent::setUp();
}

Expand Down
18 changes: 9 additions & 9 deletions _test/mediamove.test.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
if (!defined('DOKU_INC')) die();

/**
* Test cases for the pagemove plugin
* Test cases for the move plugin
*/
class plugin_pagemove_mediamove_test extends DokuWikiTest {
class plugin_move_mediamove_test extends DokuWikiTest {

public function setUp() {
$this->pluginsEnabled[] = 'pagemove';
$this->pluginsEnabled[] = 'move';
parent::setUp();
}

Expand All @@ -28,9 +28,9 @@ public function test_movePageWithRelativeMedia() {
$opts['name'] = noNS($ID);
$opts['newns'] = '';
$opts['newname'] = 'foo';
/** @var helper_plugin_pagemove $pagemove */
$pagemove = plugin_load('helper', 'pagemove');
$this->assertTrue($pagemove->move_page($opts));
/** @var helper_plugin_move $move */
$move = plugin_load('helper', 'move');
$this->assertTrue($move->move_page($opts));

$this->assertEquals('{{ mediareltest:myimage.png}} [[:start|{{ mediareltest:testimage.png?200x800 }}]] [[mediareltest:bar|{{mediareltest:testimage.gif?400x200}}]]
[[doku>wiki:dokuwiki|{{wiki:logo.png}}]] [[http://www.example.com|{{mediareltest:testimage.jpg}}]]
Expand All @@ -52,9 +52,9 @@ public function test_moveSingleMedia() {
$opts['newns'] = 'foobar';
$opts['newname'] = 'logo.png';

/** @var helper_plugin_pagemove $pagemove */
$pagemove = plugin_load('helper', 'pagemove');
$this->assertTrue($pagemove->move_media($opts));
/** @var helper_plugin_move $move */
$move = plugin_load('helper', 'move');
$this->assertTrue($move->move_media($opts));

$this->assertTrue(@file_exists(mediaFn('foobar:logo.png')));

Expand Down
16 changes: 8 additions & 8 deletions _test/namespace_move.test.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
if (!defined('DOKU_INC')) die();

/**
* Test cases for namespace move functionality of the pagemove plugin
* Test cases for namespace move functionality of the move plugin
*/
class plugin_pagemove_namespace_move_test extends DokuWikiTest {
class plugin_move_namespace_move_test extends DokuWikiTest {

public function setUp() {
$this->pluginsEnabled[] = 'pagemove';
$this->pluginsEnabled[] = 'move';
parent::setUp();
}

Expand All @@ -21,17 +21,17 @@ public function test_move_wiki_namespace() {
idx_addPage('wiki:dokuwiki');
idx_addPage('wiki:syntax');

/** @var helper_plugin_pagemove $pagemove */
$pagemove = plugin_load('helper', 'pagemove');
/** @var helper_plugin_move $move */
$move = plugin_load('helper', 'move');
$opts = array(
'ns' => 'wiki',
'newns' => 'foo',
'contenttomove' => 'both'
);

$this->assertSame(3, $pagemove->start_namespace_move($opts));
$this->assertSame(1, $pagemove->continue_namespace_move());
$this->assertSame(0, $pagemove->continue_namespace_move());
$this->assertSame(3, $move->start_namespace_move($opts));
$this->assertSame(1, $move->continue_namespace_move());
$this->assertSame(0, $move->continue_namespace_move());

$this->assertFileExists(wikiFN('foo:dokuwiki'));
$this->assertFileNotExists(wikiFN('wiki:syntax'));
Expand Down
22 changes: 11 additions & 11 deletions _test/pagemove.test.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@
if (!defined('DOKU_INC')) die();

/**
* Test cases for the pagemove plugin
* Test cases for the move plugin
*/
class PagemovePageTest extends DokuWikiTest {
class plugin_move_pagemove_test extends DokuWikiTest {

var $movedToId = '';
var $movedId = 'parent_ns:current_ns:test_page';
var $parentBacklinkingId = 'parent_ns:some_page';
var $currentNsBacklinkingId = 'parent_ns:current_ns:some_page';
var $otherBacklinkingId = 'level0:level1:other_backlinking_page';
var $subNsPage = 'parent_ns:current_ns:sub_ns:some_page';
/** @var helper_plugin_pagemove $pagemove */
private $pagemove = NULL;
/** @var helper_plugin_move $move */
private $move = NULL;

// @todo Move page to an ID which already exists
// @todo Check backlinks of a sub-namespace page (moving same, up, down, different)

function setUp() {
$this->pluginsEnabled[] = 'pagemove';
$this->pluginsEnabled[] = 'move';
global $ID;
global $INFO;

Expand Down Expand Up @@ -166,7 +166,7 @@ function setUp() {
$references = array_keys(p_get_metadata($this->subNsPage, 'relation references', METADATA_RENDER_UNLIMITED));
idx_get_indexer()->addMetaKeys($this->subNsPage, 'relation_references', $references);

$this->pagemove = new helper_plugin_pagemove();
$this->move = new helper_plugin_move();
parent::setUp();
}

Expand All @@ -175,7 +175,7 @@ function setUp() {
# }

// function test_pm_getforwardlinks() {
// $origLinkAbsLinkArray = $this->pagemove->_pm_getforwardlinks($this->movedId);
// $origLinkAbsLinkArray = $this->move->_pm_getforwardlinks($this->movedId);
// }

function test_move_page_in_same_ns() {
Expand All @@ -190,7 +190,7 @@ function test_move_page_in_same_ns() {
$opts['newns'] = $opts['ns'];
$opts['newname'] = $newPagename;
$this->movedToId = $opts['newns'].':'.$newPagename;
$this->pagemove->move_page($opts);
$this->move->move_page($opts);

$newId = $opts['newns'].':'.$opts['newname'];
$newContent = rawWiki($newId);
Expand Down Expand Up @@ -308,7 +308,7 @@ function test_move_page_to_parallel_ns() {
$opts['newns'] = 'parent_ns:parallel_ns';
$opts['newname'] = $newPagename;
$this->movedToId = $opts['newns'].':'.$newPagename;
$this->pagemove->move_page($opts);
$this->move->move_page($opts);

$newId = $opts['newns'].':'.$opts['newname'];
$newContent = rawWiki($newId);
Expand Down Expand Up @@ -428,7 +428,7 @@ function test_move_page_to_parent_ns() {
$newId = $opts['newns'].':'.$opts['newname'];
$this->movedToId = $opts['newns'].':'.$newPagename;

$this->pagemove->move_page($opts);
$this->move->move_page($opts);

$newContent = rawWiki($newId);
$expectedContent = <<<EOT
Expand Down Expand Up @@ -545,7 +545,7 @@ function test_move_ns_in_same_ns() {
$opts['newname'] = $newPagename;
$this->movedToId = $opts['newns'].':'.$newPagename;

//$this->pagemove->_pm_move_recursive($opts);
//$this->move->_pm_move_recursive($opts);

}

Expand Down
22 changes: 11 additions & 11 deletions action.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Plugin : Pagemove
* Plugin : Move
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author Michael Hamann <[email protected]>
Expand All @@ -9,9 +9,9 @@
if (!defined('DOKU_INC')) die();

/**
* Action part of the pagemove plugin
* Action part of the move plugin
*/
class action_plugin_pagemove extends DokuWiki_Action_Plugin {
class action_plugin_move extends DokuWiki_Action_Plugin {
/**
* Register event handlers.
*
Expand Down Expand Up @@ -61,7 +61,7 @@ function handle_read(Doku_Event $event, $param) {
// the page is locked by the current user
|| checklock($id) !== false || @file_exists(wikiLockFN($id))) return;

$helper = $this->loadHelper('pagemove', true);
$helper = $this->loadHelper('move', true);
if(!is_null($helper)) {
$stack[$id] = true;
$event->result = $helper->execute_rewrites($id, $event->result);
Expand Down Expand Up @@ -89,7 +89,7 @@ function handle_cache(Doku_Event $event, $param) {
}
}
if ($id) {
$meta = p_get_metadata($id, 'plugin_pagemove', METADATA_DONT_RENDER);
$meta = p_get_metadata($id, 'plugin_move', METADATA_DONT_RENDER);
if ($meta && (isset($meta['moves']) || isset($meta['media_moves']))) {
$file = wikiFN($id, '', false);
if (is_writable($file))
Expand All @@ -101,15 +101,15 @@ function handle_cache(Doku_Event $event, $param) {
}

/**
* Add the pagemove version to theindex version
* Add the move version to theindex version
*
* @param Doku_Event $event The event object
* @param array $param Optional parameters (unused)
*/
public function handle_index_version(Doku_Event $event, $param) {
// From indexer version 6 on the media references are indexed by DokuWiki itself
if ($event->data['dokuwiki'] < 6)
$event->data['plugin_pagemove'] = 0.2;
$event->data['plugin_move'] = 0.2;
}

/**
Expand Down Expand Up @@ -164,18 +164,18 @@ private function get_media_references_from_instructions($instructions, &$media_r
}

/**
* Handle the plugin_pagemove_ns_continue ajax call
* Handle the plugin_move_ns_continue ajax call
*
* @param Doku_Event $event The event that is handled
* @param array $params Optional parameters (unused)
*/
public function handle_ajax_call(Doku_Event $event, $params) {
if ($event->data == 'plugin_pagemove_ns_continue') {
if ($event->data == 'plugin_move_ns_continue') {
$event->preventDefault();
$event->stopPropagation();

/** @var helper_plugin_pagemove $helper */
$helper = $this->loadHelper('pagemove', false);
/** @var helper_plugin_move $helper */
$helper = $this->loadHelper('move', false);
$opts = $helper->get_namespace_move_opts();
$id = cleanID((string)$_POST['id']);
$skip = (string)$_POST['skip'];
Expand Down
22 changes: 11 additions & 11 deletions admin.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Plugin : Pagemove
* Plugin : Move
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author Michael Hamann <[email protected]>
Expand All @@ -11,13 +11,13 @@
if (!defined('DOKU_INC')) die();

/**
* Admin component of the pagemove plugin. Provides the user interface.
* Admin component of the move plugin. Provides the user interface.
*/
class admin_plugin_pagemove extends DokuWiki_Admin_Plugin {
class admin_plugin_move extends DokuWiki_Admin_Plugin {

var $opts = array();
private $ns_opts = false;
/** @var helper_plugin_pagemove $helper */
/** @var helper_plugin_move $helper */
private $helper = null;
/** @var string $ns_move_state The state of the current namespace move (none, started, continued, error) */
private $ns_move_state = 'none';
Expand Down Expand Up @@ -68,9 +68,9 @@ function getMenuText() {
*/
function html() {
if (!$this->helper) return;
ptln('<!-- Pagemove Plugin start -->');
ptln( $this->locale_xhtml('pagemove') );
ptln('<div class="plugin__pagemove_forms">');
ptln('<!-- Mmove Plugin start -->');
ptln( $this->locale_xhtml('move') );
ptln('<div class="plugin__move_forms">');

switch ($this->ns_move_state) {
case 'started':
Expand Down Expand Up @@ -100,7 +100,7 @@ function html() {
$this->printForm();
}
ptln('</div>');
ptln('<!-- Pagemove Plugin end -->');
ptln('<!-- Move Plugin end -->');
}

/**
Expand All @@ -116,7 +116,7 @@ function printForm() {

$ns_select_data = $this->build_namespace_select_content($ns);

$form = new Doku_Form(array('action' => wl($ID), 'method' => 'post', 'class' => 'pagemove__form'));
$form = new Doku_Form(array('action' => wl($ID), 'method' => 'post', 'class' => 'move__form'));
$form->addHidden('page', $this->getPluginName());
$form->addHidden('id', $ID);
$form->addHidden('move_type', 'page');
Expand All @@ -140,7 +140,7 @@ function printForm() {
ptln($this->helper->getNSMoveButton('abort'));
ptln('</fieldset>');
} else {
$form = new Doku_Form(array('action' => wl($ID), 'method' => 'post', 'class' => 'pagemove__form'));
$form = new Doku_Form(array('action' => wl($ID), 'method' => 'post', 'class' => 'move__form'));
$form->addHidden('page', $this->getPluginName());
$form->addHidden('id', $ID);
$form->addHidden('move_type', 'namespace');
Expand Down Expand Up @@ -203,7 +203,7 @@ function handle() {
$this->opts['move_type'] = 'page';
$this->opts['contenttomove'] = 'pages';

$this->helper = $this->loadHelper('pagemove', true);
$this->helper = $this->loadHelper('move', true);
if (!$this->helper) return;

$this->ns_opts = $this->helper->get_namespace_move_opts();
Expand Down
Loading

0 comments on commit bcaa37b

Please sign in to comment.