1: <?php
2: /*
3: * You may not change or alter any portion of this comment or credits
4: * of supporting developers from this source code or any supporting source code
5: * which is considered copyrighted (c) material of the original comment or credit authors.
6: *
7: * This program is distributed in the hope that it will be useful,
8: * but WITHOUT ANY WARRANTY; without even the implied warranty of
9: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10: */
11:
12: /**
13: * @copyright XOOPS Project https://xoops.org/
14: * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html)
15: * @package
16: * @since
17: * @author XOOPS Development Team, Kazumi Ono (AKA onokazu)
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: * Class MovableTypeApi
25: */
26: class MovableTypeApi extends XoopsXmlRpcApi
27: {
28: /**
29: * @param $params
30: * @param $response
31: * @param $module
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: