1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
|
<?php $actual_view = Minz_Request::actionName(); ?>
<div class="nav_menu">
<?php if ($actual_view === 'normal') { ?>
<a class="btn toggle_aside" href="#aside_feed"><?php echo _i('category'); ?></a>
<?php } ?>
<?php if (FreshRSS_Auth::hasAccess()) { ?>
<div id="nav_menu_actions" class="stick">
<?php
$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);
?>
<a id="toggle-<?php echo $state_str; ?>"
class="btn <?php echo $state_enabled ? 'active' : ''; ?>"
aria-checked="<?php echo $state_enabled ? 'true' : 'false'; ?>"
title="<?php echo _t('index.menu.' . $state_str); ?>"
href="<?php echo Minz_Url::display($url_state); ?>"><?php echo _i($state_str); ?></a>
<?php } ?>
<div class="dropdown">
<div id="dropdown-query" class="dropdown-target"></div>
<a class="dropdown-toggle btn" href="#dropdown-query"><?php echo _i('down'); ?></a>
<ul class="dropdown-menu">
<li class="dropdown-close"><a href="#close">❌</a></li>
<li class="dropdown-header">
<?php echo _t('index.menu.queries'); ?>
<a class="no-mobile" href="<?php echo _url('configure', 'queries'); ?>"><?php echo _i('configure'); ?></a>
</li>
<?php foreach (FreshRSS_Context::$user_conf->queries as $query) { ?>
<li class="item query">
<a href="<?php echo $query['url']; ?>"><?php echo $query['name']; ?></a>
</li>
<?php } ?>
<?php if (count(FreshRSS_Context::$user_conf->queries) > 0) { ?>
<li class="separator no-mobile"></li>
<?php } ?>
<?php
$url_query = Minz_Request::currentRequest();;
$url_query['c'] = 'configure';
$url_query['a'] = 'addQuery';
?>
<li class="item no-mobile"><a href="<?php echo Minz_Url::display($url_query); ?>"><?php echo _i('bookmark-add'); ?> <?php echo _t('index.menu.add_query'); ?></a></li>
</ul>
</div>
</div>
<?php
$get = FreshRSS_Context::currentGet();
$string_mark = _t('index.menu.mark_all_read');
if ($get[0] == 'f') {
$string_mark = _t('index.menu.mark_feed_read');
} elseif ($get[0] == 'c') {
$string_mark = _t('index.menu.mark_cat_read');
}
$mark_read_url = array(
'c' => 'entry',
'a' => 'read',
'params' => array(
'get' => $get,
'nextGet' => FreshRSS_Context::$next_get,
'idMax' => FreshRSS_Context::$id_max,
)
);
?>
<form id="mark-read-menu" method="post" style="display: none"></form>
<div class="stick" id="nav_menu_read_all">
<?php $confirm = FreshRSS_Context::$user_conf->reading_confirm ? 'confirm' : ''; ?>
<button class="read_all btn <?php echo $confirm; ?>"
form="mark-read-menu"
formaction="<?php echo Minz_Url::display($mark_read_url); ?>"
type="submit"><?php echo _t('gen.action.mark_read'); ?></button>
<div class="dropdown">
<div id="dropdown-read" class="dropdown-target"></div>
<a class="dropdown-toggle btn" href="#dropdown-read"><?php echo _i('down'); ?></a>
<ul class="dropdown-menu">
<li class="dropdown-close"><a href="#close">❌</a></li>
<li class="item">
<button class="as-link <?php echo $confirm; ?>"
form="mark-read-menu"
formaction="<?php echo Minz_Url::display($mark_read_url); ?>"
type="submit"><?php echo $string_mark; ?></button>
</li>
<li class="separator"></li>
<?php
$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';
?>
<li class="item">
<button class="as-link <?php echo $confirm; ?>"
form="mark-read-menu"
formaction="<?php echo Minz_Url::display($mark_before_today); ?>"
type="submit"><?php echo _t('index.menu.before_one_day'); ?></button>
</li>
<li class="item">
<button class="as-link <?php echo $confirm; ?>"
form="mark-read-menu"
formaction="<?php echo Minz_Url::display($mark_before_one_week); ?>"
type="submit"><?php echo _t('index.menu.before_one_week'); ?></button>
</li>
</ul>
</div>
</div>
<?php } ?>
<?php $url_output = Minz_Request::currentRequest(); ?>
<div class="stick" id="nav_menu_views">
<?php $url_output['a'] = 'normal'; ?>
<a class="view_normal btn <?php echo $actual_view == 'normal'? 'active' : ''; ?>" title="<?php echo _t('index.menu.normal_view'); ?>" href="<?php echo Minz_Url::display($url_output); ?>">
<?php echo _i("view-normal"); ?>
</a>
<?php $url_output['a'] = 'global'; ?>
<a class="view_global btn <?php echo $actual_view == 'global'? 'active' : ''; ?>" title="<?php echo _t('index.menu.global_view'); ?>" href="<?php echo Minz_Url::display($url_output); ?>">
<?php echo _i("view-global"); ?>
</a>
<?php $url_output['a'] = 'reader'; ?>
<a class="view_reader btn <?php echo $actual_view == 'reader'? 'active' : ''; ?>" title="<?php echo _t('index.menu.reader_view'); ?>" href="<?php echo Minz_Url::display($url_output); ?>">
<?php echo _i("view-reader"); ?>
</a>
<?php
$url_output['a'] = 'rss';
if (FreshRSS_Context::$user_conf->token) {
$url_output['params']['token'] = FreshRSS_Context::$user_conf->token;
}
?>
<a class="view_rss btn" target="_blank" title="<?php echo _t('index.menu.rss_view'); ?>" href="<?php echo Minz_Url::display($url_output); ?>">
<?php echo _i('rss'); ?>
</a>
</div>
<div class="item search">
<form action="<?php echo _url('index', 'index'); ?>" method="get">
<input type="search" name="search" class="extend" value="<?php echo FreshRSS_Context::$search; ?>" placeholder="<?php echo _t('index.menu.search_short'); ?>" />
<?php $get = Minz_Request::param('get', ''); ?>
<?php if($get != '') { ?>
<input type="hidden" name="get" value="<?php echo $get; ?>" />
<?php } ?>
<?php $order = Minz_Request::param('order', ''); ?>
<?php if($order != '') { ?>
<input type="hidden" name="order" value="<?php echo $order; ?>" />
<?php } ?>
<?php $state = Minz_Request::param('state', ''); ?>
<?php if($state != '') { ?>
<input type="hidden" name="state" value="<?php echo $state; ?>" />
<?php } ?>
</form>
</div>
<?php
if (FreshRSS_Context::$order === 'DESC') {
$order = 'ASC';
$icon = 'up';
$title = 'index.menu.older_first';
} else {
$order = 'DESC';
$icon = 'down';
$title = 'index.menu.newer_first';
}
$url_order = Minz_Request::currentRequest();
$url_order['params']['order'] = $order;
?>
<a id="toggle-order" class="btn" href="<?php echo Minz_Url::display($url_order); ?>" title="<?php echo _t($title); ?>">
<?php echo _i($icon); ?>
</a>
<?php if (FreshRSS_Auth::hasAccess() || FreshRSS_Context::$system_conf->allow_anonymous_refresh) { ?>
<a id="actualize" class="btn" href="<?php echo _url('feed', 'actualize'); ?>" title="<?php echo _t('gen.action.actualize'); ?>"><?php echo _i('refresh'); ?></a>
<?php } ?>
</div>
|