summaryrefslogtreecommitdiffstats
path: root/ajax/loadfeed.php
diff options
context:
space:
mode:
authorGregor Tätzner <gregor@freenet.de>2012-08-08 14:29:28 +0200
committerGregor Tätzner <gregor@freenet.de>2012-08-08 14:29:28 +0200
commit8dc1c6c6ea83f4ffe5fc0c290e317cd9bacb6d6f (patch)
tree28f3e946e5ba56131d7ed22b39fa6720fc7357d8 /ajax/loadfeed.php
parentdea84256ab39c1d6cd8338c2c8f6247bc817e9f6 (diff)
highlight currently shown feed and load feeds always in ajax style
Diffstat (limited to 'ajax/loadfeed.php')
-rw-r--r--ajax/loadfeed.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/ajax/loadfeed.php b/ajax/loadfeed.php
new file mode 100644
index 000000000..40c873e2b
--- /dev/null
+++ b/ajax/loadfeed.php
@@ -0,0 +1,30 @@
+<?php
+/**
+* ownCloud - News app
+*
+* @author Alessandro Cosentino
+* Copyright (c) 2012 - Alessandro Cosentino <cosenal@gmail.com>
+*
+* This file is licensed under the Affero General Public License version 3 or later.
+* See the COPYING-README file
+*
+*/
+
+// Check if we are a user
+OCP\JSON::checkLoggedIn();
+OCP\JSON::checkAppEnabled('news');
+OCP\JSON::callCheck();
+
+$userid = OCP\USER::getUser();
+
+$feedid = trim($_POST['feedid']);
+
+$l = OC_L10N::get('news');
+
+$tmpl_items = new OCP\Template("news", "part.items");
+$tmpl_items->assign('feedid', $feedid);
+$part_items = $tmpl_items->fetchPage();
+
+OCP\JSON::success(array('data' => array( 'message' => $l->t('Feed loaded!'),
+ 'part_items' => $part_items )));
+