From f528d2c3152e35dcfe66b3bf87322decd847d49d Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sun, 10 Feb 2013 13:52:39 +0100 Subject: ajout export au format Uniflux --- app/controllers/apiController.php | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 app/controllers/apiController.php (limited to 'app/controllers') diff --git a/app/controllers/apiController.php b/app/controllers/apiController.php new file mode 100755 index 000000000..88b968cb9 --- /dev/null +++ b/app/controllers/apiController.php @@ -0,0 +1,38 @@ +view->_useLayout (false); + + $entryDAO = new EntryDAO (); + $entryDAO->_nbItemsPerPage (-1); + + $entries_tmp = $entryDAO->listFavorites ('all', 'low_to_high'); + + $entries = array (); + + foreach ($entries_tmp as $e) { + $author = $e->author (); + $feed = $e->feed (true); + $content = 'Article publiƩ initialement sur ' . $feed->name () . ''; + if($author != '') { + $content .= ' par ' . $author; + } + $content .= ', mis en favoris dans FreshRSS'; + + $id = $e->id (); + $entries[$id] = array (); + $entries[$id]['title'] = $e->title (); + $entries[$id]['content'] = $content; + $entries[$id]['date'] = $e->date (true); + $entries[$id]['lastUpdate'] = $e->date (true); + $entries[$id]['tags'] = array (); + $entries[$id]['url'] = $e->link (); + $entries[$id]['type'] = 'url'; + } + + $this->view->entries = $entries; + } +} -- cgit v1.2.3