Skip to content

Commit

Permalink
controllers\Items\Sync: drop extra stats method
Browse files Browse the repository at this point in the history
This was accidentally left here in 900236e.
  • Loading branch information
jtojnar committed May 2, 2020
1 parent 92e9dc2 commit 40ea713
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions src/controllers/Items/Sync.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,36 +41,6 @@ public function __construct(Authentication $authentication, \daos\Items $itemsDa
$this->view = $view;
}

/**
* returns current basic stats
* json
*
* @return void
*/
public function stats() {
$this->authentication->needsLoggedInOrPublicMode();

$stats = $this->itemsDao->stats();

$tags = $this->tagsDao->getWithUnread();

foreach ($tags as $tag) {
if (strpos($tag['tag'], '#') !== 0) {
continue;
}
$stats['unread'] -= $tag['unread'];
}

if (array_key_exists('tags', $_GET) && $_GET['tags'] == 'true') {
$stats['tagshtml'] = $this->tagsController->renderTags($tags);
}
if (array_key_exists('sources', $_GET) && $_GET['sources'] == 'true') {
$stats['sourceshtml'] = $this->sourcesController->renderSources($this->sourcesDao->getWithUnread());
}

$this->view->jsonSuccess($stats);
}

/**
* returns updated database info (stats, item statuses)
* json
Expand Down

0 comments on commit 40ea713

Please sign in to comment.