]>
git.immae.eu Git - github/wallabag/wallabag.git/blob - index.php
3 * wallabag, self hostable application allowing you to not miss any content anymore
6 * @author Nicolas LÅ“uillet <nicolas@loeuillet.org>
8 * @license http://opensource.org/licenses/MIT see COPYING file
11 define ('POCHE', '1.8.0');
12 require 'check_setup.php';
13 require_once 'inc/poche/global.inc.php';
17 use PicoFarad\Response
;
18 use PicoFarad\Request
;
19 use PicoFarad\Session
;
21 // Called before each action
22 Router\before
(function($action) {
24 // Open a session only for the specified directory
25 Session\
open(dirname($_SERVER['PHP_SELF']));
27 // HTTP secure headers
35 Router\
get_action('unread', function() use ($wallabag) {
40 'referer' => $wallabag->routing
->referer
,
41 'view' => $wallabag->routing
->view
,
42 'poche_url' => Tools
::getPocheUrl(),
43 'title' => _('wallabag, a read it later open source system'),
44 'token' => \Session
::getToken(),
45 'theme' => $wallabag->tpl
->getTheme(),
49 'listmode' => (isset($_COOKIE['listmode']) ? true : false),
52 $count = $wallabag->store
->getEntriesByViewCount($view, $wallabag->user
->getId(), $id);
55 $wallabag->pagination
->set_total($count);
56 $page_links = str_replace(array('previous', 'next'), array(_('previous'), _('next')),
57 $wallabag->pagination
->page_links('?view=' . $view . '&sort=' . $_SESSION['sort'] . (($id)?'&id='.$id:'') . '&' ));
58 $tpl_vars['entries'] = $wallabag->store
->getEntriesByView($view, $wallabag->user
->getId(), $wallabag->pagination
->get_limit(), $id);
59 $tpl_vars['page_links'] = $page_links;
60 $tpl_vars['nb_results'] = $count;
63 $wallabag->routing
->render('home.twig', $tpl_vars);
65 Tools
::logm('display ' . $view . ' view');