Skip to content

Commit 9052884

Browse files
author
Christian Putzke
committed
Fixed #4: Updated entry bottom and header views to latest version
1 parent 4cb46b0 commit 9052884

File tree

3 files changed

+30
-51
lines changed

3 files changed

+30
-51
lines changed

metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "Pocket Button",
33
"author": "Christian Putzke",
44
"description": "Add articles to Pocket with one simple button click or a keyboard shortcut.",
5-
"version": 0.4,
5+
"version": 0.5,
66
"entrypoint": "PocketButton",
77
"type": "user"
88
}

views/helpers/index/normal/entry_bottom.phtml

100755100644
Lines changed: 5 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@
1010
$bottomline_link = FreshRSS_Context::userConf()->bottomline_link;
1111
?><ul class="horizontal-list bottom"><?php
1212
if (FreshRSS_Auth::hasAccess()) {
13-
1413
if ($bottomline_read) {
1514
?><li class="item manage"><?php
16-
$arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $this->entry->id()));
15+
$arUrl = ['c' => 'entry', 'a' => 'read', 'params' => ['id' => $this->entry->id()]];
1716
if ($this->entry->isRead()) {
18-
$arUrl['params']['is_read'] = 0;
17+
$arUrl['params']['is_read'] = '0';
1918
}
2019
?><a class="item-element read" href="<?= Minz_Url::display($arUrl) ?>" title="<?= _t('conf.shortcut.mark_read') ?>"><?php
2120
echo _i($this->entry->isRead() ? 'read' : 'unread'); ?></a><?php
@@ -33,9 +32,9 @@
3332

3433
if ($bottomline_favorite) {
3534
?><li class="item manage"><?php
36-
$arUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $this->entry->id()));
35+
$arUrl = ['c' => 'entry', 'a' => 'bookmark', 'params' => ['id' => $this->entry->id()]];
3736
if ($this->entry->isFavorite()) {
38-
$arUrl['params']['is_favorite'] = 0;
37+
$arUrl['params']['is_favorite'] = '0';
3938
}
4039
?><a class="item-element bookmark" href="<?= Minz_Url::display($arUrl) ?>" title="<?= _t('conf.shortcut.mark_favorite') ?>"><?php
4140
echo _i($this->entry->isFavorite() ? 'starred' : 'non-starred'); ?></a><?php
@@ -87,39 +86,7 @@
8786
<a class="dropdown-toggle" href="#dropdown-share-<?= $this->entry->id() ?>">
8887
<?= _i('share') ?><?= _t('index.share') ?>
8988
</a>
90-
91-
<ul class="dropdown-menu">
92-
<li class="dropdown-header"><?= _t('index.share') ?> <a href="<?= _url('configure', 'integration') ?>"><?= _i('configure') ?></a></li><?php
93-
$id = $this->entry->id();
94-
$link = $this->entry->link();
95-
$title = $this->entry->title() . ' · ' . ($this->feed === null ? '' : $this->feed->name());
96-
foreach (FreshRSS_Context::userConf()->sharing as $share_options) {
97-
$share = FreshRSS_Share::get($share_options['type']);
98-
if ($share === null) {
99-
continue;
100-
}
101-
$cssClass = $share->isDeprecated() ? ' error' : '';
102-
$share_options['id'] = $id;
103-
$share_options['link'] = $link;
104-
$share_options['title'] = $title;
105-
$share->update($share_options);
106-
?><li class="item share<?= $cssClass ?>">
107-
<?php if ('GET' === $share->method()) {
108-
if ($share->HTMLtag() !== 'button') {?>
109-
<a target="_blank" rel="noreferrer" href="<?= $share->url() ?>" data-type="<?= $share->type() ?>"><?= $share->name() ?></a>
110-
<?php } else { ?>
111-
<button type="button" class="as-link" data-url="<?= $share->url() ?>" data-type="<?= $share->type() ?>" data-title="<?= htmlspecialchars($title) ?>"><?= $share->name() ?></button>
112-
<?php
113-
}
114-
} else {?>
115-
<a href="POST"><?= $share->name() ?></a>
116-
<form method="POST" action="<?= $share->url() ?>" disabled="disabled">
117-
<input type="hidden" value="<?= $link ?>" name="<?= $share->field() ?>"/>
118-
</form>
119-
<?php } ?>
120-
</li><?php
121-
}
122-
?></ul>
89+
<?php $this->renderHelper('index/normal/entry_share_menu'); ?>
12390
<a class="dropdown-close" href="#close">❌</a>
12491
</div>
12592
<?php } ?>

views/helpers/index/normal/entry_header.phtml

100755100644
Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
<?php
22
declare(strict_types=1);
33
/** @var FreshRSS_View $this */
4-
if ($this->feed === null) {
5-
throw new FreshRSS_Context_Exception('Feed not initialised!');
6-
}
74
$topline_read = FreshRSS_Context::userConf()->topline_read;
85
$topline_favorite = FreshRSS_Context::userConf()->topline_favorite;
6+
$topline_sharing = FreshRSS_Context::userConf()->topline_sharing;
97
$topline_website = FreshRSS_Context::userConf()->topline_website;
108
$topline_thumbnail = FreshRSS_Context::userConf()->topline_thumbnail;
119
$topline_summary = FreshRSS_Context::userConf()->topline_summary;
@@ -17,9 +15,9 @@
1715
if (FreshRSS_Auth::hasAccess()) {
1816
if ($topline_read) {
1917
?><li class="item manage"><?php
20-
$arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $this->entry->id()));
18+
$arUrl = ['c' => 'entry', 'a' => 'read', 'params' => ['id' => $this->entry->id()]];
2119
if ($this->entry->isRead()) {
22-
$arUrl['params']['is_read'] = 0;
20+
$arUrl['params']['is_read'] = '0';
2321
}
2422
?><a class="item-element read" href="<?= Minz_Url::display($arUrl) ?>" title="<?= _t('conf.shortcut.mark_read') ?>"><?php
2523
echo _i($this->entry->isRead() ? 'read' : 'unread'); ?></a><?php
@@ -37,9 +35,9 @@
3735

3836
if ($topline_favorite) {
3937
?><li class="item manage"><?php
40-
$arUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $this->entry->id()));
38+
$arUrl = ['c' => 'entry', 'a' => 'bookmark', 'params' => ['id' => $this->entry->id()]];
4139
if ($this->entry->isFavorite()) {
42-
$arUrl['params']['is_favorite'] = 0;
40+
$arUrl['params']['is_favorite'] = '0';
4341
}
4442
?><a class="item-element bookmark" href="<?= Minz_Url::display($arUrl) ?>" title="<?= _t('conf.shortcut.mark_favorite') ?>"><?php
4543
echo _i($this->entry->isFavorite() ? 'starred' : 'non-starred'); ?></a><?php
@@ -64,8 +62,8 @@
6462
endif;
6563
?></li><?php
6664
endif; ?>
67-
68-
<li class="item title<?= (($topline_thumbnail !== 'none') || $topline_summary) ? ' multiline' : '' ?>" dir="auto"><a target="_blank" rel="noreferrer" href="<?= $this->entry->link() ?>" class="item-element"><?= $this->entry->title() ?><?php
65+
<li class="item titleAuthorSummaryDate">
66+
<a target="_blank" rel="noreferrer" href="<?= $this->entry->link() ?>" class="item-element title<?= (($topline_thumbnail !== 'none') || $topline_summary) ? ' multiline' : '' ?>" dir="auto"><?= $this->entry->title() ?><?php
6967
if ($topline_display_authors):
7068
?><span class="author"><?php
7169
$authors = $this->entry->authors();
@@ -78,11 +76,25 @@
7876
}
7977
?></span><?php
8078
endif;
79+
?></a>
80+
<?php
8181
if ($topline_summary):
8282
?><div class="summary"><?= trim(mb_substr(strip_tags($this->entry->content(false)), 0, 500, 'UTF-8')) ?></div><?php
83-
endif;
84-
?></a></li>
85-
<?php if ($topline_date) { ?><li class="item date"><time datetime="<?= $this->entry->machineReadableDate() ?>" class="item-element"><?= $this->entry->date() ?></time>&nbsp;</li><?php } ?>
83+
endif; ?>
84+
<?php if ($topline_date) { ?><span class="item-element date"><time datetime="<?= $this->entry->machineReadableDate() ?>"><?= $this->entry->date() ?></time>&nbsp;</span><?php } ?>
85+
</li>
86+
<?php if ($topline_sharing) { ?>
87+
<li class="item share">
88+
<div class="item-element dropdown">
89+
<div id="dropdown-share2-<?= $this->entry->id() ?>" class="dropdown-target"></div>
90+
<a class="dropdown-toggle" href="#dropdown-share2-<?= $this->entry->id() ?>" title="<?= _t('index.share') ?>">
91+
<?= _i('share') ?>
92+
</a>
93+
<?php $this->renderHelper('index/normal/entry_share_menu'); ?>
94+
<a class="dropdown-close" href="#close">❌</a>
95+
</div>
96+
</li>
97+
<?php } ?>
8698
<?php if ($topline_link) { ?><li class="item link"><a target="_blank" rel="noreferrer" href="<?= $this->entry->link() ?>" class="item-element" title="<?=
8799
_t('conf.shortcut.see_on_website') ?>"><?= _i('link') ?></a></li><?php } ?>
88100
</ul>

0 commit comments

Comments
 (0)