aboutsummaryrefslogtreecommitdiff
path: root/app/views/helpers/stream-footer.phtml
blob: ebce4d8528332755d11d9e580875145cce403c01 (plain)
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
<?php
	/** @var FreshRSS_View $this */
	$url_next = Minz_Request::currentRequest();
	$url_next['params']['next'] = FreshRSS_Context::$next_id;
	$url_next['params']['state'] = FreshRSS_Context::$state;
	$url_next['params']['ajax'] = 1;

	$url_mark_read = array(
		'c' => 'entry',
		'a' => 'read',
		'params' => array(
			'get' => FreshRSS_Context::currentGet(),
			'nextGet' => FreshRSS_Context::$next_get,
			'idMax' => FreshRSS_Context::$id_max,
			'search' => htmlspecialchars_decode(FreshRSS_Context::$search, ENT_QUOTES),
			'state' => FreshRSS_Context::$state,
		)
	);
?>

<?php
$hasAccess = FreshRSS_Auth::hasAccess();
if ($hasAccess) { ?>
<form id="stream-footer" action="" method="post">
<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
<?php } else { ?>
<div id="stream-footer">
<?php }?>
	<div class="stream-footer-inner">
	<?php if (FreshRSS_Context::$next_id) { ?>
		<button id="load_more" type="submit" class="btn" formaction="<?= Minz_Url::display($url_next) ?>"><?= _t('gen.stream.load_more') ?></button>
	<?php } elseif ($hasAccess) { ?>
		<button id="bigMarkAsRead"
			class="as-link <?= FreshRSS_Context::$user_conf->reading_confirm ? 'confirm" disabled="disabled' : '' ?>"
			form="stream-footer"
			formaction="<?= Minz_Url::display($url_mark_read) ?>"
			type="submit">
			<?= _t('gen.stream.nothing_to_load') ?><br />
			<span class="bigTick">✓</span><br />
			<?= _t('gen.stream.mark_all_read') ?>
		</button>
	<?php } else { ?>
		<div id="bigMarkAsRead">
			<?= _t('gen.stream.nothing_to_load') ?><br />
		</div>
	<?php } ?>
	</div>
<?php if ($hasAccess) { ?>
</form>
<?php } else {?>
</div>
<?php }?>