1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10:
11:
12: 13: 14: 15: 16: 17: 18:
19:
20: defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
21: require_once XOOPS_ROOT_PATH . '/class/xml/rpc/xmlrpcapi.php';
22:
23: 24: 25:
26: class MovableTypeApi extends XoopsXmlRpcApi
27: {
28: 29: 30: 31: 32:
33: public function __construct(&$params, &$response, &$module)
34: {
35: parent::__construct($params, $response, $module);
36: }
37:
38: public function getCategoryList()
39: {
40: if (!$this->_checkUser($this->params[1], $this->params[2])) {
41: $this->response->add(new XoopsXmlRpcFault(104));
42: } else {
43: $xoopsapi =& $this->_getXoopsApi($this->params);
44: $xoopsapi->_setUser($this->user, $this->isadmin);
45: $ret =& $xoopsapi->getCategories(false);
46: if (is_array($ret)) {
47: $arr = new XoopsXmlRpcArray();
48: foreach ($ret as $id => $name) {
49: $struct = new XoopsXmlRpcStruct();
50: $struct->add('categoryId', new XoopsXmlRpcString($id));
51: $struct->add('categoryName', new XoopsXmlRpcString($name['title']));
52: $arr->add($struct);
53: unset($struct);
54: }
55: $this->response->add($arr);
56: } else {
57: $this->response->add(new XoopsXmlRpcFault(106));
58: }
59: }
60: }
61:
62: public function getPostCategories()
63: {
64: $this->response->add(new XoopsXmlRpcFault(107));
65: }
66:
67: public function setPostCategories()
68: {
69: $this->response->add(new XoopsXmlRpcFault(107));
70: }
71:
72: public function supportedMethods()
73: {
74: $this->response->add(new XoopsXmlRpcFault(107));
75: }
76: }
77: