miniflux-legacy/controllers/history.php
Kordian Bruck dd47b3f82e Add feed group feature
- each feed can have multiple groups assigned
- group assignments are done on the add or edit feed page
- groups are only visible on the unread page
- groups are exported via the fever api
- it's not possible do delete a group manually from the database (the group will be removed automatically, as soon as the last association of a group to a feed is removed)
- if you try to create an already existing group, the existing group is used to prevent duplicates
2015-08-05 01:01:21 +02:00

55 lines
1.6 KiB
PHP

<?php
use PicoFarad\Router;
use PicoFarad\Response;
use PicoFarad\Request;
use PicoFarad\Template;
// Display history page
Router\get_action('history', function() {
$offset = Request\int_param('offset', 0);
$nb_items = Model\Item\count_by_status('read');
$items = Model\Item\get_all_by_status(
'read',
null,
$offset,
Model\Config\get('items_per_page'),
'updated',
Model\Config\get('items_sorting_direction')
);
Response\html(Template\layout('history', array(
'favicons' => Model\Feed\get_item_favicons($items),
'original_marks_read' => Model\Config\get('original_marks_read'),
'items' => $items,
'order' => '',
'direction' => '',
'display_mode' => Model\Config\get('items_display_mode'),
'nb_items' => $nb_items,
'nb_unread_items' => Model\Item\count_by_status('unread'),
'offset' => $offset,
'items_per_page' => Model\Config\get('items_per_page'),
'nothing_to_read' => Request\int_param('nothing_to_read'),
'menu' => 'history',
'title' => t('History').' ('.$nb_items.')'
)));
});
// Confirmation box to flush history
Router\get_action('confirm-flush-history', function() {
Response\html(Template\layout('confirm_flush_items', array(
'nb_unread_items' => Model\Item\count_by_status('unread'),
'menu' => 'history',
'title' => t('Confirmation')
)));
});
// Flush history
Router\get_action('flush-history', function() {
Model\Item\mark_all_as_removed();
Response\redirect('?action=history');
});