| @@ 41-53 (lines=13) @@ | ||
| 38 | $xoopsapi = $this->_getXoopsApi($this->params); |
|
| 39 | $xoopsapi->_setUser($this->user, $this->isadmin); |
|
| 40 | $ret = $xoopsapi->getCategories(false); |
|
| 41 | if (is_array($ret)) { |
|
| 42 | $arr = new XoopsXmlRpcArray(); |
|
| 43 | foreach ($ret as $id => $name) { |
|
| 44 | $struct = new XoopsXmlRpcStruct(); |
|
| 45 | $struct->add('categoryId', new XoopsXmlRpcString($id)); |
|
| 46 | $struct->add('categoryName', new XoopsXmlRpcString($name['title'])); |
|
| 47 | $arr->add($struct); |
|
| 48 | unset($struct); |
|
| 49 | } |
|
| 50 | $this->response->add($arr); |
|
| 51 | } else { |
|
| 52 | $this->response->add(new XoopsXmlRpcFault(106)); |
|
| 53 | } |
|
| 54 | } |
|
| 55 | } |
|
| 56 | ||
| @@ 372-383 (lines=12) @@ | ||
| 369 | } else { |
|
| 370 | if (count($ret) == 0) { |
|
| 371 | $this->response->add(new XoopsXmlRpcFault(106, 'Found 0 Entries')); |
|
| 372 | } else { |
|
| 373 | $arr = new XoopsXmlRpcArray(); |
|
| 374 | foreach ($ret as $topic_id => $topic_vars) { |
|
| 375 | $struct = new XoopsXmlRpcStruct(); |
|
| 376 | $struct->add('categoryId', new XoopsXmlRpcString($topic_id)); |
|
| 377 | $struct->add('categoryName', new XoopsXmlRpcString($topic_vars['title'])); |
|
| 378 | $struct->add('categoryPid', new XoopsXmlRpcString($topic_vars['pid'])); |
|
| 379 | $arr->add($struct); |
|
| 380 | unset($struct); |
|
| 381 | } |
|
| 382 | $this->response->add($arr); |
|
| 383 | } |
|
| 384 | } |
|
| 385 | } |
|
| 386 | return null; |
|