From: Arnaud F. <ar...@cr...> - 2005-01-10 16:57:38
|
Le 10 janv. 05, =E0 13:54, Reini Urban a =E9crit : > > $LANG should be solved. Just docs update is missing. The current logic=20= > is rather crude. > I also added xmlrpc tests to CVS last month. $LANG is a major problem ... as is the auth problem with XmlRpc (how to=20= ?) and HttpAuth (can be a solution for XmlRpc auth). > BTW, here is the putPage xmlrpc method .. to be completed :) It should=20= be a bit simplier for the current version .. not tested yet. /** Int putPage(String pagename, String content, String author) * */ $wiki_dmap['putPage'] =3D array('signature' =3D>=20 array(array($xmlrpcString,$xmlrpcString,$xmlrpcString,$xmlrpcString)), 'documentation' =3D> 'put the raw Wiki text of a new version of = a=20 page', 'function' =3D> 'putPage'); function putPage($params) { global $request; $ParamPageName =3D $params->getParam(0); $ParamContent =3D $params->getParam(1); $ParamAuthor =3D $params->getParam(2); $pagename =3D short_string_decode($ParamPageName->scalarval()); $content =3D short_string_decode($ParamContent->scalarval()); $author =3D short_string_decode($ParamAuthor->scalarval()); $dbh =3D $request->getDbh(); $now =3D time(); $init_meta =3D array('ctime' =3D> $now, 'creator' =3D> $author, 'creator_id' =3D> $author, ); $version_meta =3D array('author' =3D> $author, 'author_id' =3D> $author, 'markup' =3D> 2.0, 'summary' =3D> $summary ? $summary : _("New=20= contribution"), //Yes, I could add summary to the args 'mtime' =3D> $now, 'pagetype' =3D> 'wikitext', 'wikitext' =3D> $init_meta, ); $page =3D $dbh->getPage($pagename); $current =3D $page->getCurrentRevision(); $version =3D $current->getVersion() + 1; $content =3D trim($content); $res =3D$page->save($content, $version, $version_meta); if ($res) //To be modified : return an INT value ... $message =3D "Page $pagename version $version created"; else $message =3D "Problem creating version $version of page=20 $pagename"; return new xmlrpcresp(short_string($message)); } -- Arnaud Fontaine CRAO Jabber: sh...@ra... |