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