]> git.wh0rd.org - tt-rss.git/blobdiff - classes/api.php
api: add getFeedTree
[tt-rss.git] / classes / api.php
index 2b9c3a148c8620be561c5bd304571977799742c9..1efa3865f5d3ae96b4b787818cd9d2e7f8f4b8b5 100644 (file)
@@ -704,6 +704,20 @@ class API extends Handler {
                }
        }
 
+       function getFeedTree() {
+               $pf = new Pref_Feeds($this->link, $_REQUEST);
+
+               $_REQUEST['mode'] = 2;
+
+               if ($pf){
+                       $data = $pf->makefeedtree();
+                       print $this->wrap(self::STATUS_OK, array("categories" => $data));
+               } else {
+                       print $this->wrap(self::STATUS_ERR, array("error" =>
+                               'UNABLE_TO_INSTANTIATE_OBJECT'));
+               }
+
+       }
 }
 
 ?>