mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-06-16 11:30:39 -04:00
* Add PHPStan #fix https://github.com/FreshRSS/FreshRSS/issues/4016 https://phpstan.org/ ```sh composer run-script phpstan ``` * More fixes * Fix global variables * Add .phtml * Fix merge https://github.com/FreshRSS/FreshRSS/pull/4090 * Fix more warnings * Fix view errors and enable in CI * ReturnTypeWillChange * Dynamic view type * Fix Minz static/self bug
73 lines
2.2 KiB
PHTML
73 lines
2.2 KiB
PHTML
<?php
|
|
/** @var FreshRSS_View $this */
|
|
$this->partial('nav_menu');
|
|
|
|
$class = '';
|
|
if (FreshRSS_Context::$user_conf->hide_read_feeds &&
|
|
FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_NOT_READ) &&
|
|
!FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_READ)) {
|
|
$class = ' state_unread';
|
|
}
|
|
?>
|
|
|
|
<main id="stream" class="global<?= $class ?>">
|
|
<?php
|
|
$params = $_GET;
|
|
unset($params['c']);
|
|
unset($params['a']);
|
|
$url_base = array(
|
|
'c' => 'index',
|
|
'a' => 'normal',
|
|
'params' => $params,
|
|
);
|
|
|
|
$unreadArticles = 0;
|
|
|
|
foreach ($this->categories as $cat) {
|
|
$feeds = $cat->feeds();
|
|
$url_base['params']['get'] = 'c_' . $cat->id();
|
|
|
|
if (!empty($feeds)) {
|
|
$unreadArticles += $cat->nbNotRead();
|
|
?>
|
|
<div class="box category" data-unread="<?= $cat->nbNotRead() ?>">
|
|
<div class="box-title"><a class="title" data-unread="<?= format_number($cat->nbNotRead()) ?>"
|
|
href="<?= Minz_Url::display($url_base) ?>"><?= $cat->name() ?></a></div>
|
|
|
|
<ul class="box-content">
|
|
<?php
|
|
foreach ($feeds as $feed) {
|
|
$nb_not_read = $feed->nbNotRead();
|
|
$error = $feed->inError() ? ' error' : '';
|
|
$empty = $feed->nbEntries() === 0 ? ' empty' : '';
|
|
$url_base['params']['get'] = 'f_' . $feed->id();
|
|
?>
|
|
<li id="f_<?= $feed->id() ?>" class="item feed<?= $error, $empty, $feed->mute() ? ' mute' : '' ?>"
|
|
data-unread="<?= $feed->nbNotRead() ?>" data-priority="<?= $feed->priority() ?>">
|
|
<?php if (FreshRSS_Context::$user_conf->show_favicons): ?><img class="favicon" src="<?= $feed->favicon() ?>" alt="✇" loading="lazy" /><?php endif; ?>
|
|
<a class="item-title" data-unread="<?= format_number($feed->nbNotRead()) ?>" href="<?= Minz_Url::display($url_base) ?>"><?= $feed->name() ?></a>
|
|
</li>
|
|
<?php } ?>
|
|
</ul>
|
|
</div>
|
|
<?php
|
|
}
|
|
}
|
|
|
|
if ($unreadArticles < 1) {
|
|
?>
|
|
<div id="noArticlesToShow" class="prompt alert alert-warn">
|
|
<h2 class="alert-head"><?= _t('index.feed.empty') ?></h2>
|
|
<?php if (FreshRSS_Auth::hasAccess()) { ?>
|
|
<p><a href="<?= _url('subscription', 'add') ?>"><?= _t('index.feed.add') ?></a></p>
|
|
<?php } ?>
|
|
</div>
|
|
<?php } ?>
|
|
</main>
|
|
|
|
<div id="overlay">
|
|
<a class="close" href="#"><?= _i('close') ?></a>
|
|
</div>
|
|
<div id="panel"<?= FreshRSS_Context::$user_conf->display_posts ? '' : ' class="hide_posts"' ?>>
|
|
</div>
|