|
1 | 1 | <?php |
| 2 | + declare(strict_types=1); |
2 | 3 | /** @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 |
12 | 17 | if (FreshRSS_Auth::hasAccess()) { |
13 | 18 | if ($topline_read) { |
14 | 19 | ?><li class="item manage"><?php |
|
20 | 25 | echo _i($this->entry->isRead() ? 'read' : 'unread'); ?></a><?php |
21 | 26 | ?></li><?php |
22 | 27 | } |
| 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 | + |
23 | 38 | if ($topline_favorite) { |
24 | 39 | ?><li class="item manage"><?php |
25 | 40 | $arUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $this->entry->id())); |
|
30 | 45 | echo _i($this->entry->isFavorite() ? 'starred' : 'non-starred'); ?></a><?php |
31 | 46 | ?></li><?php |
32 | 47 | } |
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 |
42 | 48 | } |
43 | | - ?><li class="item website"> |
| 49 | + |
| 50 | + if ($topline_website !== 'none'): |
| 51 | + ?><li class="item website <?= $topline_website ?>"> |
44 | 52 | <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; ?> |
46 | 54 | </a> |
47 | | - </li> |
| 55 | + </li><?php |
| 56 | + endif; ?> |
48 | 57 |
|
49 | 58 | <?php |
50 | 59 | if ($topline_thumbnail !== 'none'): |
51 | 60 | ?><li class="item thumbnail <?= $topline_thumbnail ?> <?= $topline_summary ? '' : 'small' ?>"><?php |
52 | 61 | $thumbnail = $this->entry->thumbnail(); |
53 | 62 | 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 |
56 | 64 | endif; |
57 | 65 | ?></li><?php |
58 | 66 | endif; ?> |
|
71 | 79 | ?></span><?php |
72 | 80 | endif; |
73 | 81 | 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 |
75 | 83 | endif; |
76 | 84 | ?></a></li> |
77 | 85 | <?php if ($topline_date) { ?><li class="item date"><time datetime="<?= $this->entry->machineReadableDate() ?>" class="item-element"><?= $this->entry->date() ?></time> </li><?php } ?> |
|
0 commit comments