1<?php 2/** 3 * Defines callback functions 4 * 5 * @author Magnus Wolf mwolf2706@googlemail.com 6 */ 7 8 9class IJR_CallbackDefines { 10 11 private $methods = array(); 12 private $obj = array(); 13 14 private function defineWikiMethods() 15 { 16 $this->obj['method'] = 'dokuwiki.getVersion'; 17 $this->obj['callback'] = 'getVersion'; 18 $this->obj['args'] = array('string'); 19 $this->obj['help'] = 'Returns the running DokuWiki version.'; 20 $this->methods[] = $this->obj; 21 22 $this->obj['method'] = 'dokuwiki.login'; 23 $this->obj['callback'] = 'this:login'; 24 $this->obj['args'] = array('integer','string','string'); 25 $this->obj['help'] = 'Tries to login with the given credentials and sets auth cookies.'; 26 $this->methods[] = $this->obj; 27 28 $this->obj['method'] = 'dokuwiki.getPagelist'; 29 $this->obj['callback'] = 'this:readNamespace'; 30 $this->obj['args'] = array('string','struct'); 31 $this->obj['help'] = 'List all pages within the given namespace.'; 32 $this->methods[] = $this->obj; 33 34 $this->obj['method'] = 'dokuwiki.getTime'; 35 $this->obj['callback'] = 'time'; 36 $this->obj['args'] = array('int'); 37 $this->obj['help'] = 'Return the current time at the wiki server.'; 38 $this->methods[] = $this->obj; 39 40 $this->obj['method'] = 'dokuwiki.getTitle'; 41 $this->obj['callback'] = 'this:getTitle'; 42 $this->obj['args'] = array('string'); 43 $this->obj['help'] = 'Get wiki title.'; 44 $this->methods[] = $this->obj; 45 46 $this->obj['method'] = 'dokuwiki.appendPage'; 47 $this->obj['callback'] = 'this:appendPage'; 48 $this->obj['args'] = array('string', 'string', 'struct'); 49 $this->obj['help'] = 'Appends text to a Wiki Page.'; 50 $this->methods[] = $this->obj; 51 52 $this->obj['method'] = 'dokuwiki.setLocks'; 53 $this->obj['callback'] = 'this:setLocks'; 54 $this->obj['args'] = array('struct'); 55 $this->obj['help'] = 'Lock or unlock pages.'; 56 $this->methods[] = $this->obj; 57 58 $this->obj['method'] = 'wiki.getPage'; 59 $this->obj['callback'] = 'this:rawPage'; 60 $this->obj['args'] = array('string','string'); 61 $this->obj['help'] = 'Get the raw Wiki text of page, latest version.'; 62 $this->methods[] = $this->obj; 63 64 $this->obj['method'] = 'wiki.getPageVersion'; 65 $this->obj['callback'] = 'this:rawPage'; 66 $this->obj['args'] = array('string', 'string'); 67 $this->obj['help'] = 'Get the raw Wiki text of page.'; 68 $this->methods[] = $this->obj; 69 70 $this->obj['method'] = 'wiki.getPageHTML'; 71 $this->obj['callback'] = 'this:htmlPage'; 72 $this->obj['args'] = array('string','string'); 73 $this->obj['help'] = 'Return page in rendered HTML, latest version.'; 74 $this->methods[] = $this->obj; 75 76 $this->obj['method'] = 'wiki.getPageHTMLVersion'; 77 $this->obj['callback'] = 'this:htmlPage'; 78 $this->obj['args'] = array('string','string'); 79 $this->obj['help'] = 'Return page in rendered HTML.'; 80 $this->methods[] = $this->obj; 81 82 $this->obj['method'] = 'wiki.getAllPages'; 83 $this->obj['callback'] = 'this:listPages'; 84 $this->obj['args'] = array('struct'); 85 $this->obj['help'] = 'Returns a list of all pages. The result is an array of utf8 pagenames.'; 86 $this->methods[] = $this->obj; 87 88 $this->obj['method'] = 'wiki.getAttachments'; 89 $this->obj['callback'] = 'this:listAttachments'; 90 $this->obj['args'] = array('string', 'struct'); 91 $this->obj['help'] = 'Returns a list of all media files.'; 92 $this->methods[] = $this->obj; 93 94 $this->obj['method'] = 'wiki.getBackLinks'; 95 $this->obj['callback'] = 'this:listBackLinks'; 96 $this->obj['args'] = array('struct','string'); 97 $this->obj['help'] = 'Returns the pages that link to this page.'; 98 $this->methods[] = $this->obj; 99 100 $this->obj['method'] = 'wiki.getPageInfo'; 101 $this->obj['callback'] = 'this:pageInfo'; 102 $this->obj['args'] = array('struct','string'); 103 $this->obj['help'] = 'Returns a struct with infos about the page.'; 104 $this->methods[] = $this->obj; 105 106 $this->obj['method'] = 'wiki.getPageInfoVersion'; 107 $this->obj['callback'] = 'this:pageInfo'; 108 $this->obj['args'] = array('string','string'); 109 $this->obj['help'] = 'Returns a struct with infos about the page.'; 110 $this->methods[] = $this->obj; 111 112 $this->obj['method'] = 'wiki.getPageVersions'; 113 $this->obj['callback'] = 'this:pageVersions'; 114 $this->obj['args'] = array('string','string','string'); 115 $this->obj['help'] = 'Returns the available revisions of the page.'; 116 $this->methods[] = $this->obj; 117 118 $this->obj['method'] = 'wiki.putPage'; 119 $this->obj['callback'] = 'this:putPage'; 120 $this->obj['args'] = array('string', 'string', 'struct'); 121 $this->obj['help'] = 'Saves a wiki page.'; 122 $this->methods[] = $this->obj; 123 124 $this->obj['method'] = 'wiki.search'; 125 $this->obj['callback'] = 'this:search'; 126 $this->obj['args'] = array('string'); 127 $this->obj['help'] = 'Serches for a string in wiki pages.'; 128 $this->methods[] = $this->obj; 129 130 $this->obj['method'] = 'wiki.listLinks'; 131 $this->obj['callback'] = 'this:listLinks'; 132 $this->obj['args'] = array('struct','string'); 133 $this->obj['help'] = 'Lists all links contained in a wiki page.'; 134 $this->methods[] = $this->obj; 135 136 $this->obj['method'] = 'wiki.getRecentChanges'; 137 $this->obj['callback'] = 'this:getRecentChanges'; 138 $this->obj['args'] = array('string'); 139 $this->obj['help'] = 'Returns a struct about all recent changes since given timestamp.'; 140 $this->methods[] = $this->obj; 141 142 $this->obj['method'] = 'wiki.getRecentMediaChanges'; 143 $this->obj['callback'] = 'this:getRecentMediaChanges'; 144 $this->obj['args'] = array('struct'); 145 $this->obj['help'] = 'Returns a struct about all recent media changes since given timestamp.'; 146 $this->methods[] = $this->obj; 147 148 $this->obj['method'] = 'wiki.aclCheck'; 149 $this->obj['callback'] = 'this:aclCheck'; 150 $this->obj['args'] = array('int', 'string'); 151 $this->obj['help'] = 'Returns the permissions of a given wiki page.'; 152 $this->methods[] = $this->obj; 153 154 $this->obj['method'] = 'wiki.putAttachment'; 155 $this->obj['callback'] = 'this:putAttachment'; 156 $this->obj['args'] = array('string', 'base64', 'struct'); 157 $this->obj['help'] = 'Upload a file to the wiki.'; 158 $this->methods[] = $this->obj; 159 160 $this->obj['method'] = 'wiki.deleteAttachment'; 161 $this->obj['callback'] = 'this:deleteAttachment'; 162 $this->obj['args'] = array('int', 'string'); 163 $this->obj['help'] = 'Delete a file from the wiki.'; 164 $this->methods[] = $this->obj; 165 166 $this->obj['method'] = 'wiki.getAttachment'; 167 $this->obj['callback'] = 'this:getAttachment'; 168 $this->obj['args'] = array('base64', 'string'); 169 $this->obj['help'] = 'Download a file from the wiki.'; 170 $this->methods[] = $this->obj; 171 172 $this->obj['method'] = 'wiki.getAttachmentInfo'; 173 $this->obj['callback'] = 'this:getAttachmentInfo'; 174 $this->obj['args'] = array('struct', 'string'); 175 $this->obj['help'] = 'Returns a struct with infos about the attachment.'; 176 $this->methods[] = $this->obj; 177 178 $this->obj['method'] = 'wiki.getPageHTMLPart'; 179 $this->obj['callback'] = 'this:htmlPagePart'; 180 $this->obj['args'] = array('string','string','string','int','int'); 181 $this->obj['help'] = 'Return parts of a page in rendered HTML, latest version.'; 182 $this->methods[] = $this->obj; 183 } 184 185 private function defineSystemMethods() 186 { 187 $this->obj['method'] = 'system.methodSignature'; 188 $this->obj['callback'] = 'this:methodSignature'; 189 $this->obj['args'] = array('array', 'string'); 190 $this->obj['help'] = 'Returns an array describing the return type and required parameters of a method'; 191 $this->methods[] = $this->obj; 192 193 $this->obj['method'] = 'system.getCapabilities'; 194 $this->obj['callback'] = 'this:getCapabilities'; 195 $this->obj['args'] = array('struct'); 196 $this->obj['help'] = 'Returns a struct describing the XML-RPC specifications supported by this server'; 197 $this->methods[] = $this->obj; 198 199 $this->obj['method'] = 'system.listMethods'; 200 $this->obj['callback'] = 'this:listMethods'; 201 $this->obj['args'] = array('array'); 202 $this->obj['help'] = 'Returns an array of available methods on this server'; 203 $this->methods[] = $this->obj; 204 205 $this->obj['method'] = 'system.methodHelp'; 206 $this->obj['callback'] = 'this:methodHelp'; 207 $this->obj['args'] = array('string', 'string'); 208 $this->obj['help'] = 'Returns a documentation string for the specified method'; 209 $this->methods[] = $this->obj; 210 } 211 212 public function getWikiMethods() 213 { 214 $this->defineWikiMethods(); 215 return $this->methods; 216 } 217 218 public function getSystemMethods() 219 { 220 $this->defineSystemMethods(); 221 return $this->methods; 222 } 223} 224?> 225