aboutsummaryrefslogtreecommitdiff
path: root/p/api/greader.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-09-25 01:11:52 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-09-25 01:11:52 +0200
commit86a470b1483a8a0cb77ed00da53813f1777a1895 (patch)
treeafa1a24feaee795ee38f1c3bf3bae52433b3ee7a /p/api/greader.php
parent36e6c10f21aa682a737aa3754750f8ee8820598e (diff)
API delete category
Diffstat (limited to 'p/api/greader.php')
-rw-r--r--p/api/greader.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/p/api/greader.php b/p/api/greader.php
index 96c2b2ee3..e77ef3726 100644
--- a/p/api/greader.php
+++ b/p/api/greader.php
@@ -616,6 +616,21 @@ function renameTag($s, $dest) {
badRequest();
}
+function disableTag($s, $dest) {
+ //logMe("renameTag()");
+ if ($s != '' && strpos($s, 'user/-/label/') === 0) {
+ $s = substr($s, 13);
+ $categoryDAO = new FreshRSS_CategoryDAO();
+ $cat = $categoryDAO->searchByName($s);
+ if ($cat != null) {
+ $feedDAO = FreshRSS_Factory::createFeedDao();
+ $feedDAO->changeCategory($cat->id(), 0);
+ exit('OK');
+ }
+ }
+ badRequest();
+}
+
function markAllAsRead($streamId, $olderThanId) {
//logMe("markAllAsRead($streamId, $olderThanId)");
$entryDAO = FreshRSS_Factory::createEntryDao();
@@ -758,6 +773,12 @@ elseif ($pathInfos[1] === 'reader' && $pathInfos[2] === 'api' && isset($pathInfo
$dest = isset($_POST['dest']) ? $_POST['dest'] : ''; //user/-/label/NewFolder
renameTag($s, $dest);
break;
+ case 'disable-tag': //https://github.com/theoldreader/api
+ $token = isset($_POST['T']) ? trim($_POST['T']) : '';
+ checkToken(FreshRSS_Context::$user_conf, $token);
+ $s = isset($_POST['s']) ? $_POST['s'] : ''; //user/-/label/Folder
+ disableTag($s);
+ break;
case 'mark-all-as-read':
$token = isset($_POST['T']) ? trim($_POST['T']) : '';
checkToken(FreshRSS_Context::$user_conf, $token);