Ajout nombre d'articles non lus à l'API

pull/136/head
Marien Fressinaud 12 years ago
parent 61aa1e2b22
commit 57c0a448f5
  1. 5
      app/configuration/routes.php
  2. 10
      app/controllers/apiController.php
  3. 3
      app/views/api/getNbNotRead.phtml

@ -50,6 +50,11 @@ return array (
'controller' => 'api',
'action' => 'getFavorites'
),
array (
'route' => '/api/get_nb_not_read',
'controller' => 'api',
'action' => 'getNbNotRead'
),
// Entry
array (

@ -1,18 +1,19 @@
<?php
class apiController extends ActionController {
public function getFavoritesAction () {
public function firstAction() {
header('Content-type: application/json');
$this->view->_useLayout (false);
}
public function getFavoritesAction () {
$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);
@ -32,7 +33,10 @@ class apiController extends ActionController {
$entries[$id]['url'] = $e->link ();
$entries[$id]['type'] = 'url';
}
$this->view->entries = $entries;
}
public function getNbNotReadAction() {
}
}

@ -0,0 +1,3 @@
<?php
echo json_encode($this->nb_not_read);
Loading…
Cancel
Save