Skip to content

Commit 4cb46b0

Browse files
author
Christian Putzke
committed
Updated entry bottom and header views to latest version
1 parent 8124ee8 commit 4cb46b0

File tree

2 files changed

+55
-49
lines changed

2 files changed

+55
-49
lines changed

views/helpers/index/normal/entry_bottom.phtml

100644100755
Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
<?php
2+
declare(strict_types=1);
23
/** @var FreshRSS_View $this */
3-
$sharing = array();
4-
if (FreshRSS_Auth::hasAccess()) {
5-
$sharing = FreshRSS_Context::$user_conf->sharing;
6-
}
7-
8-
$bottomline_read = FreshRSS_Context::$user_conf->bottomline_read;
9-
$bottomline_favorite = FreshRSS_Context::$user_conf->bottomline_favorite;
10-
$bottomline_sharing = FreshRSS_Context::$user_conf->bottomline_sharing && (count($sharing) > 0);
11-
$bottomline_labels = true; //TODO
12-
$bottomline_tags = FreshRSS_Context::$user_conf->bottomline_tags;
13-
$bottomline_date = FreshRSS_Context::$user_conf->bottomline_date;
14-
$bottomline_link = FreshRSS_Context::$user_conf->bottomline_link;
4+
$bottomline_read = FreshRSS_Context::userConf()->bottomline_read;
5+
$bottomline_favorite = FreshRSS_Context::userConf()->bottomline_favorite;
6+
$bottomline_sharing = FreshRSS_Context::userConf()->bottomline_sharing && (count(FreshRSS_Context::userConf()->sharing) > 0);
7+
$bottomline_myLabels = FreshRSS_Context::userConf()->bottomline_myLabels;
8+
$bottomline_tags = FreshRSS_Context::userConf()->bottomline_tags;
9+
$bottomline_date = FreshRSS_Context::userConf()->bottomline_date;
10+
$bottomline_link = FreshRSS_Context::userConf()->bottomline_link;
1511
?><ul class="horizontal-list bottom"><?php
1612
if (FreshRSS_Auth::hasAccess()) {
13+
1714
if ($bottomline_read) {
1815
?><li class="item manage"><?php
1916
$arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $this->entry->id()));
@@ -24,6 +21,16 @@
2421
echo _i($this->entry->isRead() ? 'read' : 'unread'); ?></a><?php
2522
?></li><?php
2623
}
24+
25+
$extension = Minz_ExtensionManager::findExtension('Pocket Button');
26+
$pocket_button_icon = $extension->getFileUrl('add_to_pocket.svg', 'svg');
27+
?>
28+
<li class="item manage"><?php
29+
$arUrl = array('c' => 'pocketButton', 'a' => 'add', 'params' => array('id' => $this->entry->id()));
30+
?><a class="item-element pocketButton" href="<?php echo Minz_Url::display($arUrl); ?>"><div class="lds-dual-ring disabled"></div><img class="icon" src="<?= $pocket_button_icon ?>" /></a><?php
31+
?></li>
32+
<?php
33+
2734
if ($bottomline_favorite) {
2835
?><li class="item manage"><?php
2936
$arUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $this->entry->id()));
@@ -34,17 +41,8 @@
3441
echo _i($this->entry->isFavorite() ? 'starred' : 'non-starred'); ?></a><?php
3542
?></li><?php
3643
}
37-
$extension = Minz_ExtensionManager::findExtension('Pocket Button');
38-
$pocket_button_icon = $extension->getFileUrl('add_to_pocket.svg', 'svg');
39-
?>
40-
<li class="item manage"><?php
41-
$arUrl = array('c' => 'pocketButton', 'a' => 'add', 'params' => array('id' => $this->entry->id()));
42-
?><a class="pocketButton" href="<?php echo Minz_Url::display($arUrl); ?>"><div class="lds-dual-ring disabled"></div><img class="icon" src="<?= $pocket_button_icon ?>" /></a><?php
43-
?></li>
44-
<?php
4544
}
46-
// @phpstan-ignore-next-line
47-
if ($bottomline_labels) {
45+
if ($bottomline_myLabels) {
4846
?><li class="item labels">
4947
<div class="item-element dropdown dynamictags">
5048
<div id="dropdown-labels-<?= $this->entry->id() ?>" class="dropdown-target"></div>
@@ -83,7 +81,7 @@
8381
</li><?php
8482
}
8583
?><li class="item share"><?php
86-
if ($bottomline_sharing) {
84+
if ($bottomline_sharing) {
8785
?><div class="item-element dropdown">
8886
<div id="dropdown-share-<?= $this->entry->id() ?>" class="dropdown-target"></div>
8987
<a class="dropdown-toggle" href="#dropdown-share-<?= $this->entry->id() ?>">
@@ -94,8 +92,8 @@
9492
<li class="dropdown-header"><?= _t('index.share') ?> <a href="<?= _url('configure', 'integration') ?>"><?= _i('configure') ?></a></li><?php
9593
$id = $this->entry->id();
9694
$link = $this->entry->link();
97-
$title = $this->entry->title() . ' · ' . $this->feed->name();
98-
foreach (FreshRSS_Context::$user_conf->sharing as $share_options) {
95+
$title = $this->entry->title() . ' · ' . ($this->feed === null ? '' : $this->feed->name());
96+
foreach (FreshRSS_Context::userConf()->sharing as $share_options) {
9997
$share = FreshRSS_Share::get($share_options['type']);
10098
if ($share === null) {
10199
continue;

views/helpers/index/normal/entry_header.phtml

100644100755
Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
<?php
2+
declare(strict_types=1);
23
/** @var FreshRSS_View $this */
3-
$topline_read = FreshRSS_Context::$user_conf->topline_read;
4-
$topline_favorite = FreshRSS_Context::$user_conf->topline_favorite;
5-
$topline_thumbnail = FreshRSS_Context::$user_conf->topline_thumbnail;
6-
$topline_summary = FreshRSS_Context::$user_conf->topline_summary;
7-
$topline_display_authors = FreshRSS_Context::$user_conf->topline_display_authors;
8-
$topline_date = FreshRSS_Context::$user_conf->topline_date;
9-
$topline_link = FreshRSS_Context::$user_conf->topline_link;
10-
$lazyload = FreshRSS_Context::$user_conf->lazyload;
11-
?><ul class="horizontal-list flux_header"><?php
4+
if ($this->feed === null) {
5+
throw new FreshRSS_Context_Exception('Feed not initialised!');
6+
}
7+
$topline_read = FreshRSS_Context::userConf()->topline_read;
8+
$topline_favorite = FreshRSS_Context::userConf()->topline_favorite;
9+
$topline_website = FreshRSS_Context::userConf()->topline_website;
10+
$topline_thumbnail = FreshRSS_Context::userConf()->topline_thumbnail;
11+
$topline_summary = FreshRSS_Context::userConf()->topline_summary;
12+
$topline_display_authors = FreshRSS_Context::userConf()->topline_display_authors;
13+
$topline_date = FreshRSS_Context::userConf()->topline_date;
14+
$topline_link = FreshRSS_Context::userConf()->topline_link;
15+
$lazyload = FreshRSS_Context::userConf()->lazyload;
16+
?><ul class="horizontal-list flux_header website<?= $topline_website ?>"><?php
1217
if (FreshRSS_Auth::hasAccess()) {
1318
if ($topline_read) {
1419
?><li class="item manage"><?php
@@ -20,6 +25,16 @@
2025
echo _i($this->entry->isRead() ? 'read' : 'unread'); ?></a><?php
2126
?></li><?php
2227
}
28+
29+
$extension = Minz_ExtensionManager::findExtension('Pocket Button');
30+
$pocket_button_icon = $extension->getFileUrl('add_to_pocket.svg', 'svg');
31+
?>
32+
<li class="item manage"><?php
33+
$arUrl = array('c' => 'pocketButton', 'a' => 'add', 'params' => array('id' => $this->entry->id()));
34+
?><a class="item-element pocketButton" href="<?php echo Minz_Url::display($arUrl); ?>"><div class="lds-dual-ring disabled"></div><img class="icon" src="<?= $pocket_button_icon ?>" /></a><?php
35+
?></li>
36+
<?php
37+
2338
if ($topline_favorite) {
2439
?><li class="item manage"><?php
2540
$arUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $this->entry->id()));
@@ -30,29 +45,22 @@
3045
echo _i($this->entry->isFavorite() ? 'starred' : 'non-starred'); ?></a><?php
3146
?></li><?php
3247
}
33-
34-
$extension = Minz_ExtensionManager::findExtension('Pocket Button');
35-
$pocket_button_icon = $extension->getFileUrl('add_to_pocket.svg', 'svg');
36-
?>
37-
<li class="item manage"><?php
38-
$arUrl = array('c' => 'pocketButton', 'a' => 'add', 'params' => array('id' => $this->entry->id()));
39-
?><a class="pocketButton" href="<?php echo Minz_Url::display($arUrl); ?>"><div class="lds-dual-ring disabled"></div><img class="icon" src="<?= $pocket_button_icon ?>" /></a><?php
40-
?></li>
41-
<?php
4248
}
43-
?><li class="item website">
49+
50+
if ($topline_website !== 'none'):
51+
?><li class="item website <?= $topline_website ?>">
4452
<a href="<?= _url('index', 'index', 'get', 'f_' . $this->feed->id()) ?>" class="item-element" title="<?= _t('gen.action.filter') ?>: <?= $this->feed->name() ?>">
45-
<?php if (FreshRSS_Context::$user_conf->show_favicons): ?><img class="favicon" src="<?= $this->feed->favicon() ?>" alt="✇" loading="lazy" /><?php endif; ?><span><?= $this->feed->name() ?></span>
53+
<?php if (FreshRSS_Context::userConf()->show_favicons && 'name' !== $topline_website): ?><img class="favicon" src="<?= $this->feed->favicon() ?>" alt="✇" loading="lazy" /><?php endif; ?><?php if ('icon' !== $topline_website): ?><span class="websiteName"><?= $this->feed->name() ?></span><?php endif; ?>
4654
</a>
47-
</li>
55+
</li><?php
56+
endif; ?>
4857

4958
<?php
5059
if ($topline_thumbnail !== 'none'):
5160
?><li class="item thumbnail <?= $topline_thumbnail ?> <?= $topline_summary ? '' : 'small' ?>"><?php
5261
$thumbnail = $this->entry->thumbnail();
5362
if ($thumbnail != null):
54-
?><img src="<?= htmlspecialchars($thumbnail['url'], ENT_COMPAT, 'UTF-8') ?>" class="item-element "<?= $lazyload ? ' loading="lazy"' : '' ?><?=
55-
empty($thumbnail['alt']) ? '' : ' alt="' . htmlspecialchars(strip_tags($thumbnail['alt']), ENT_COMPAT, 'UTF-8') . '"' ?> /><?php
63+
?><img src="<?= $thumbnail['url'] ?>" class="item-element "<?= $lazyload ? ' loading="lazy"' : '' ?> alt="" /><?php
5664
endif;
5765
?></li><?php
5866
endif; ?>
@@ -71,7 +79,7 @@
7179
?></span><?php
7280
endif;
7381
if ($topline_summary):
74-
?><div class="summary"><?= trim(mb_substr(strip_tags($this->entry->content()), 0, 500, 'UTF-8')) ?></div><?php
82+
?><div class="summary"><?= trim(mb_substr(strip_tags($this->entry->content(false)), 0, 500, 'UTF-8')) ?></div><?php
7583
endif;
7684
?></a></li>
7785
<?php if ($topline_date) { ?><li class="item date"><time datetime="<?= $this->entry->machineReadableDate() ?>" class="item-element"><?= $this->entry->date() ?></time>&nbsp;</li><?php } ?>

0 commit comments

Comments
 (0)