2019-06-29 20:47:38 +02:00
<?php
2023-11-16 22:43:00 +01:00
declare(strict_types=1);
2019-06-29 20:47:38 +02:00
$actual_view = Minz_Request::actionName();
?>
2021-07-21 22:42:04 +02:00
< nav class = "nav_menu" >
2021-02-28 12:26:24 +01:00
<?php if ( $actual_view === 'normal' || $actual_view === 'reader' ) { ?>
2023-10-24 23:43:50 +02:00
< div class = "group" >
< a class = "btn toggle_aside" href = "#aside_feed" > <? = _i ( 'category' ) ?> </ a >
< / div >
2014-01-22 22:22:36 +01:00
<?php } ?>
2013-04-13 10:21:31 +02:00
2014-10-06 23:29:20 +02:00
<?php if ( FreshRSS_Auth :: hasAccess ()) { ?>
2023-10-24 23:43:50 +02:00
< div id = "nav_menu_actions" class = "group" >
2014-06-14 08:58:33 +02:00
<?php
2014-10-21 16:46:36 +02:00
$states = array(
'read' => FreshRSS_Entry::STATE_READ,
'unread' => FreshRSS_Entry::STATE_NOT_READ,
'starred' => FreshRSS_Entry::STATE_FAVORITE,
'non-starred' => FreshRSS_Entry::STATE_NOT_FAVORITE,
);
foreach ($states as $state_str => $state) {
$state_enabled = FreshRSS_Context::isStateEnabled($state);
$url_state = Minz_Request::currentRequest();
$url_state['params']['state'] = FreshRSS_Context::getRevertState($state);
2014-04-14 00:06:11 +02:00
?>
2019-10-23 11:18:20 +02:00
< a id = "toggle- <? = $state_str ?> "
2021-02-28 12:26:24 +01:00
class="btn <? = $state_enabled ? 'active' : '' ?> "
role="checkbox" aria-checked="<? = $state_enabled ? 'true' : 'false' ?> "
title="<? = _t ( 'index.menu.' . $state_str ) ?> "
href="<? = Minz_Url :: display ( $url_state ) ?> "><? = _i ( $state_str ) ?> </ a >
2014-10-21 16:46:36 +02:00
<?php } ?>
2014-06-14 08:58:33 +02:00
2023-01-30 20:32:55 +01:00
< div class = "dropdown only-mobile" id = "dropdown-search-wrapper" >
< input type = "hidden" name = "_csrf" value = " <? = FreshRSS_Auth :: csrfToken () ?> " />
< div id = "dropdown-search" class = "dropdown-target" > < / div >
2023-11-16 22:43:00 +01:00
< a id = "toggle-search" class = "dropdown-toggle btn <? = ( strlen ( FreshRSS_Context :: $search -> getRawInput ()) > 0 ) ? ' active' : '' ; ?> " title = " <? = _t ( 'gen.menu.search' ) ?> "
2023-01-30 20:32:55 +01:00
href="#dropdown-search"><? = _i ( 'search' ) ?> </ a >
< ul class = "dropdown-menu" >
< li class = "item" >
< span >
< form action = " <? = _url ( 'index' , 'index' ) ?> " method = "get" >
2024-02-26 09:01:03 +01:00
<?php if ( in_array ( Minz_Request :: actionName (), [ 'normal' , 'global' , 'reader' ], true )) { ?>
< input type = "hidden" name = "a" value = " <? = Minz_Request :: actionName () ?> " />
<?php } if ( Minz_Request :: paramString ( 'get' ) !== '' ) { ?>
< input type = "hidden" name = "get" value = " <? = FreshRSS_Context :: currentGet () ?> " />
<?php } if ( ctype_upper ( Minz_Request :: paramString ( 'order' ))) { ?>
< input type = "hidden" name = "order" value = " <? = FreshRSS_Context :: $order ?> " />
<?php } if ( Minz_Request :: paramInt ( 'state' ) !== 0 ) { ?>
< input type = "hidden" name = "state" value = " <? = FreshRSS_Context :: $state ?> " />
2023-01-30 20:32:55 +01:00
<?php } ?>
< div class = "stick search" >
2023-03-26 14:17:22 +02:00
< input type = "search" name = "search"
2023-11-16 22:43:00 +01:00
value="<? = htmlspecialchars ( htmlspecialchars_decode ( FreshRSS_Context :: $search -> getRawInput (), ENT_QUOTES ), ENT_COMPAT , 'UTF-8' ); ?> "
2023-01-30 20:32:55 +01:00
placeholder="<? = _t ( 'gen.menu.search' ) ?> " title="<? = _t ( 'gen.menu.search' ) ?> " />< button class = "btn" type = "submit" title = " <? = _t ( 'index.menu.search_short' ) ?> " > <? = _i ( 'search' ) ?> </ button >
< / div >
< p class = "help" > <? = _i ( 'help' ) ?> <? = _t ( 'gen.menu.search_help' ) ?> </ a ></ p >
< / form >
< / span >
< / li >
< / ul >
< a class = "dropdown-close" href = "#close" > ❌< / a >
< / div >
2014-06-14 08:58:33 +02:00
< div class = "dropdown" >
< div id = "dropdown-query" class = "dropdown-target" > < / div >
2023-01-30 20:32:55 +01:00
< a id = "toggle-userqueries" class = "dropdown-toggle btn" href = "#dropdown-query" title = " <? = _t ( 'index.menu.queries' ) ?> " > <? = _i ( 'bookmark-tag' ) ?> </ a >
2014-06-14 08:58:33 +02:00
< ul class = "dropdown-menu" >
2014-09-19 15:44:33 +02:00
< li class = "dropdown-header" >
2019-10-23 11:18:20 +02:00
<? = _t ( 'index.menu.queries' ) ?>
2022-01-07 00:35:58 +01:00
< a href = " <? = _url ( 'configure' , 'queries' ) ?> " > <? = _i ( 'configure' ) ?> </ a >
2014-09-19 15:44:33 +02:00
< / li >
2014-06-14 08:58:33 +02:00
2023-12-18 17:59:16 +01:00
<?php foreach ( FreshRSS_Context :: userConf () -> queries as $raw_query ) : ?>
2022-06-02 08:41:08 +02:00
< li class = "item query" >
<?php if ( ! empty ( $raw_query [ 'url' ])) : ?>
2023-04-20 09:14:58 +02:00
< a href = " <? = $raw_query [ 'url' ] ?> " > <? = $raw_query [ 'name' ] ?? $raw_query [ 'url' ] ?> </ a >
2022-06-02 08:41:08 +02:00
<?php else : ?>
2024-02-26 09:01:03 +01:00
<?php $query = new FreshRSS_UserQuery ( $raw_query , FreshRSS_Context :: categories (), FreshRSS_Context :: labels ()); ?>
2022-06-02 08:41:08 +02:00
< a href = " <? = $query -> getUrl () ?> " > <? = $query -> getName () ?> </ a >
<?php endif ; ?>
< / li >
<?php endforeach ; ?>
2014-06-14 08:58:33 +02:00
<?php
2022-10-03 21:50:40 +02:00
$classSeparator = '';
2023-12-18 17:59:16 +01:00
if (count(FreshRSS_Context::userConf()->queries) > 0) {
2022-10-03 21:50:40 +02:00
$classSeparator = ' separator';
}
$url_query = Minz_Request::currentRequest();
2014-06-14 08:58:33 +02:00
$url_query['c'] = 'configure';
2021-01-07 21:47:39 +01:00
$url_query['a'] = 'bookmarkQuery';
2014-06-14 08:58:33 +02:00
?>
2022-10-03 21:50:40 +02:00
< li class = "item <? = $classSeparator ?> " >< a href = " <? = Minz_Url :: display ( $url_query ) ?> " > <? = _i ( 'bookmark-add' ) ?> <? = _t ( 'index.menu.bookmark_query' ) ?> </ a ></ li >
2014-06-14 08:58:33 +02:00
< / ul >
2022-04-11 22:54:19 +02:00
< a class = "dropdown-close" href = "#close" > ❌< / a >
2014-06-14 08:58:33 +02:00
< / div >
2014-04-14 00:06:11 +02:00
< / div >
2014-10-21 16:46:36 +02:00
2013-03-17 00:01:40 +01:00
<?php
2014-10-21 16:46:36 +02:00
$get = FreshRSS_Context::currentGet();
2014-12-10 22:56:36 +01:00
$string_mark = _t('index.menu.mark_all_read');
2018-09-03 20:48:04 +02:00
$string_unmark = _t('index.menu.mark_selection_unread');
if ($get[0] === 'f') {
2014-12-10 22:56:36 +01:00
$string_mark = _t('index.menu.mark_feed_read');
2018-09-03 20:48:04 +02:00
} elseif ($get[0] === 'c') {
2014-12-10 22:56:36 +01:00
$string_mark = _t('index.menu.mark_cat_read');
2013-03-17 00:01:40 +01:00
}
2014-01-18 16:41:10 +01:00
2014-10-21 16:46:36 +02:00
$mark_read_url = array(
'c' => 'entry',
'a' => 'read',
'params' => array(
'get' => $get,
2014-10-22 19:19:15 +02:00
'nextGet' => FreshRSS_Context::$next_get,
'idMax' => FreshRSS_Context::$id_max,
2023-11-16 22:43:00 +01:00
'search' => htmlspecialchars_decode(FreshRSS_Context::$search->getRawInput(), ENT_QUOTES),
2016-08-18 00:00:08 +02:00
'state' => FreshRSS_Context::$state,
2018-09-03 20:48:04 +02:00
),
2014-10-21 16:46:36 +02:00
);
2018-09-03 20:48:04 +02:00
$mark_unread_url = $mark_read_url;
2023-05-02 14:37:19 +02:00
$mark_unread_url['params']['is_read'] = '0';
2018-09-03 20:48:04 +02:00
$mark_unread_url['params']['nextGet'] = $get;
2013-03-17 00:01:40 +01:00
?>
2023-10-24 23:43:50 +02:00
< div class = "group stick" id = "nav_menu_read_all" >
2016-07-31 18:25:02 +02:00
< form id = "mark-read-menu" method = "post" >
2023-12-18 17:59:16 +01:00
<?php $confirm = FreshRSS_Context :: userConf () -> reading_confirm ? 'confirm" disabled="disabled' : '' ; ?>
2019-10-23 11:18:20 +02:00
< button class = "read_all btn <? = $confirm ?> "
2021-02-28 12:26:24 +01:00
form="mark-read-menu"
formaction="<? = Minz_Url :: display ( $mark_read_url ) ?> "
type="submit"><? = _t ( 'gen.action.mark_read' ) ?> </ button >
2014-09-16 14:12:44 +02:00
2013-03-17 00:01:40 +01:00
< div class = "dropdown" >
2019-10-23 11:18:20 +02:00
< input type = "hidden" name = "_csrf" value = " <? = FreshRSS_Auth :: csrfToken () ?> " />
2013-03-17 00:01:40 +01:00
< div id = "dropdown-read" class = "dropdown-target" > < / div >
2019-10-23 11:18:20 +02:00
< a class = "dropdown-toggle btn" href = "#dropdown-read" > <? = _i ( 'down' ) ?> </ a >
2013-03-17 00:01:40 +01:00
< ul class = "dropdown-menu" >
2014-09-16 14:12:44 +02:00
< li class = "item" >
2019-10-23 11:18:20 +02:00
< button class = "as-link <? = $confirm ?> "
2021-02-28 12:26:24 +01:00
form="mark-read-menu"
formaction="<? = Minz_Url :: display ( $mark_read_url ) ?> "
type="submit"><? = $string_mark ?> </ button >
2014-09-16 14:12:44 +02:00
< / li >
2013-03-17 00:01:40 +01:00
<?php
2014-10-21 16:46:36 +02:00
$today = @strtotime('today');
$mark_before_today = $mark_read_url;
$mark_before_today['params']['idMax'] = $today . '000000';
$mark_before_one_week = $mark_read_url;
$mark_before_one_week['params']['idMax'] = ($today - 604800) . '000000';
2018-09-03 20:48:04 +02:00
$mark_unread_enabled = FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_READ) or !FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_NOT_READ);
2013-03-17 00:01:40 +01:00
?>
2022-10-03 21:50:40 +02:00
< li class = "item separator" >
2019-10-23 11:18:20 +02:00
< button class = "as-link <? = $confirm ?> "
2021-02-28 12:26:24 +01:00
form="mark-read-menu"
formaction="<? = Minz_Url :: display ( $mark_before_today ) ?> "
type="submit"><? = _t ( 'index.menu.before_one_day' ) ?> </ button >
2014-09-16 14:12:44 +02:00
< / li >
< li class = "item" >
2019-10-23 11:18:20 +02:00
< button class = "as-link <? = $confirm ?> "
2021-02-28 12:26:24 +01:00
form="mark-read-menu"
formaction="<? = Minz_Url :: display ( $mark_before_one_week ) ?> "
type="submit"><? = _t ( 'index.menu.before_one_week' ) ?> </ button >
2014-09-16 14:12:44 +02:00
< / li >
2022-10-03 21:50:40 +02:00
< li class = "item separator" >
2019-10-23 11:18:20 +02:00
< button class = "as-link <? = $mark_unread_enabled ? $confirm : '" disabled="disabled' ?> "
2021-02-28 12:26:24 +01:00
form="mark-read-menu"
formaction="<? = Minz_Url :: display ( $mark_unread_url ) ?> "
type="submit"><? = $string_unmark ?> </ button >
2018-09-03 20:48:04 +02:00
< / li >
2013-03-17 00:01:40 +01:00
< / ul >
2022-04-11 22:54:19 +02:00
< a class = "dropdown-close" href = "#close" > ❌< / a >
2013-03-17 00:01:40 +01:00
< / div >
2016-07-31 18:25:02 +02:00
< / form >
2013-03-17 00:01:40 +01:00
< / div >
<?php } ?>
2014-10-21 16:46:36 +02:00
<?php $url_output = Minz_Request :: currentRequest (); ?>
2023-10-24 23:43:50 +02:00
< div class = "group" id = "nav_menu_views" >
2017-12-10 11:31:19 +01:00
<?php
2017-12-10 15:04:01 +01:00
$readingModes = FreshRSS_ReadingMode::getReadingModes();
2017-12-10 11:31:19 +01:00
$readingModes = Minz_ExtensionManager::callHook('nav_reading_modes', $readingModes);
2023-12-18 17:59:16 +01:00
if (!is_iterable($readingModes)) {
$readingModes = FreshRSS_ReadingMode::getReadingModes();
}
2017-12-10 11:31:19 +01:00
2017-12-10 15:04:01 +01:00
/** @var FreshRSS_ReadingMode $mode */
2018-01-01 20:48:33 +01:00
foreach ($readingModes as $mode) {
2017-12-10 15:04:01 +01:00
?>
2021-02-28 12:26:24 +01:00
< a class = " <? = $mode -> getId () ?> btn <?php if ( $mode -> isActive ()) { echo 'active' ; } ?> " title = " <? =
$mode->getTitle() ?>" href="<? = Minz_Url :: display ( $mode -> getUrlParams ()) ?> ">
2019-10-23 11:18:20 +02:00
<? = $mode -> getName () ?>
2017-12-10 15:04:01 +01:00
< / a >
<?php
}
2017-12-10 11:31:19 +01:00
?>
2013-03-17 00:01:40 +01:00
< / div >
2013-12-05 18:06:58 +01:00
2023-12-18 17:59:16 +01:00
<?php $nav_menu_hooks = Minz_ExtensionManager :: callHookString ( 'nav_menu' ); ?>
2021-01-12 20:30:32 +01:00
<?php if ( $nav_menu_hooks != '' ) { ?>
2023-10-24 23:43:50 +02:00
< div class = "group" id = "nav_menu_hooks" >
2021-02-28 12:26:24 +01:00
<? = $nav_menu_hooks ?>
2021-01-07 21:45:48 +01:00
< / div >
2021-01-12 20:30:32 +01:00
<?php } ?>
2021-01-07 21:45:48 +01:00
2014-04-13 23:05:16 +02:00
<?php
2014-10-21 16:46:36 +02:00
if (FreshRSS_Context::$order === 'DESC') {
2014-04-13 23:05:16 +02:00
$order = 'ASC';
2022-01-12 23:04:59 +01:00
$icon = 'sort-up';
2017-10-08 19:05:19 +02:00
$title = _t('index.menu.older_first');
2014-04-13 23:05:16 +02:00
} else {
$order = 'DESC';
2022-01-12 23:04:59 +01:00
$icon = 'sort-down';
2017-10-08 19:05:19 +02:00
$title = _t('index.menu.newer_first');
2014-04-13 23:05:16 +02:00
}
2014-10-21 16:46:36 +02:00
$url_order = Minz_Request::currentRequest();
2014-04-13 23:05:16 +02:00
$url_order['params']['order'] = $order;
?>
2023-10-24 23:43:50 +02:00
< div class = "group" >
< a id = "toggle-order" class = "btn" href = " <? = Minz_Url :: display ( $url_order ) ?> " title = " <? = $title ?> " >
<? = _i ( $icon ) ?>
< / a >
< / div >
2020-03-28 12:33:57 +01:00
2023-12-18 17:59:16 +01:00
<?php if ( FreshRSS_Auth :: hasAccess () || FreshRSS_Context :: systemConf () -> allow_anonymous_refresh ) { ?>
2023-10-24 23:43:50 +02:00
< div class = "group" >
< a id = "actualize" class = "btn" href = " <? = _url ( 'feed' , 'actualize' ) ?> " title = " <? = _t ( 'gen.action.actualize' ) ?> " > <? = _i ( 'refresh' ) ?> </ a >
< / div >
2014-04-13 04:46:35 +02:00
<?php } ?>
2021-07-21 22:42:04 +02:00
< / nav >
2020-03-28 12:33:57 +01:00
<?php flush (); ?>