]> git.wh0rd.org Git - tt-rss.git/commitdiff
api: add getConfig
authorAndrew Dolgov <fox@bah.org.ru>
Wed, 16 Dec 2009 12:04:24 +0000 (15:04 +0300)
committerAndrew Dolgov <fox@bah.org.ru>
Wed, 16 Dec 2009 12:04:24 +0000 (15:04 +0300)
api/index.php

index 8d7e1db960d65cb34c817f963c1f27f0fe2e2b51..be266128594ad66d2bf7dc22c7b5ba8eacc2ed30 100644 (file)
 
                        print json_encode($article);
 
+                       break;
+               case "getConfig":
+                       $config = array(
+                               "icons_dir" => ICONS_DIR,
+                               "icons_url" => ICONS_URL);
+
+                       if (ENABLE_UPDATE_DAEMON) {
+                               $config["daemon_is_running"] = file_is_locked("update_daemon.lock");
+                       }
+
+                       $result = db_query($link, "SELECT COUNT(*) AS cf FROM
+                               ttrss_feeds WHERE owner_uid = " . $_SESSION["uid"]);
+
+                       $num_feeds = db_fetch_result($result, 0, "cf");
+
+                       $config["num_feeds"] = (int)$num_feeds;
+       
+                       print json_encode($config);
+
+
                        break;
        }