aboutsummaryrefslogtreecommitdiff
path: root/app/views/helpers/index/normal/entry_share_menu.phtml
blob: 6877dd94a4c8575e678e98d342879f76c86fcd56 (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
<?php
	declare(strict_types=1);
	/** @var FreshRSS_View $this */
?>
<ul class="dropdown-menu">
	<li class="dropdown-header"><?= _t('index.share') ?> <?php
		if (FreshRSS_Auth::hasAccess()):
			?><a href="<?= _url('configure', 'integration') ?>"><?php
			?><?= _i('configure') ?></a><?php
		endif;
	?></li><?php
		$id = '--entryId--';
		$link = '--link--';
		$title = '--titleText----websiteName----articleAuthors--';
		foreach (FreshRSS_Context::userConf()->sharing as $share_options):
			$share = FreshRSS_Share::get($share_options['type']);
			if ($share === null) {
				continue;
			}
			$cssClass = $share->isDeprecated() ? ' error' : '';
			$share_options['id'] = $id;
			$share_options['link'] = $link;
			$share_options['title'] = $title;
			$share->update($share_options);
			?><li class="item share<?= $cssClass ?>"><?php
				if ('GET' === $share->method()):
					if ($share->HTMLtag() !== 'button') {
						?><a target="_blank" rel="noreferrer" href="<?= $share->url() ?>" data-type="<?= $share->type() ?>"><?= $share->name() ?></a><?php
					} else {
						?><button type="button" class="as-link" data-url="<?= $share->url() ?>" data-type="<?= $share->type() ?>" data-title="<?= htmlspecialchars($title) ?>"><?= $share->name() ?></button><?php
					}
				else:
					?><a href="POST"><?= $share->name() ?></a>
					<form method="POST" action="<?= $share->url() ?>" disabled="disabled">
						<input type="hidden" value="<?= $link ?>" name="<?= $share->field() ?>"/>
					</form><?php
				endif; ?>
			</li><?php
		endforeach;
?></ul>