Skip to content

Commit

Permalink
Added XMLRPC dokuwiki:appendPage
Browse files Browse the repository at this point in the history
  • Loading branch information
HakanS committed Nov 13, 2010
1 parent 1492812 commit ba9418b
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion lib/exe/xmlrpc.php
Expand Up @@ -7,7 +7,7 @@
/**
* Increased whenever the API is changed
*/
define('DOKU_XMLRPC_API_VERSION',4);
define('DOKU_XMLRPC_API_VERSION',5);

require_once(DOKU_INC.'inc/init.php');
session_write_close(); //close session
Expand Down Expand Up @@ -143,6 +143,13 @@ function dokuwiki_xmlrpc_server(){
true
);

$this->addCallback(
'dokuwiki.appendPage',
'this:appendPage',
array('int', 'string', 'string', 'struct'),
'Append text to a wiki page.'
);

/* Wiki API v2 http://www.jspwiki.org/wiki/WikiRPCInterface2 */
$this->addCallback(
'wiki.getRPCVersionSupported',
Expand Down Expand Up @@ -577,6 +584,17 @@ function putPage($id, $text, $params) {
return 0;
}

/**
* Appends text to a wiki page.
*/
function appendPage($id, $text, $params) {
$currentpage = $this->rawPage($id);
if (!is_string($currentpage)) {
return $currentpage;
}
return $this->putPage($id, $currentpage.$text, $params);
}

/**
* Uploads a file to the wiki.
*
Expand Down

0 comments on commit ba9418b

Please sign in to comment.