entry_share_menu.phtml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. declare(strict_types=1);
  3. /** @var FreshRSS_View $this */
  4. ?>
  5. <ul class="dropdown-menu">
  6. <li class="dropdown-header"><?= _t('index.share') ?> <?php
  7. if (FreshRSS_Auth::hasAccess()):
  8. ?><a href="<?= _url('configure', 'integration') ?>"><?php
  9. ?><?= _i('configure') ?></a><?php
  10. endif;
  11. ?></li><?php
  12. $id = '--entryId--';
  13. $link = '--link--';
  14. $title = '--titleText----websiteName----articleAuthors--';
  15. foreach (FreshRSS_Context::userConf()->sharing as $share_options):
  16. $share = FreshRSS_Share::get($share_options['type']);
  17. if ($share === null) {
  18. continue;
  19. }
  20. $cssClass = $share->isDeprecated() ? ' error' : '';
  21. $share_options['id'] = $id;
  22. $share_options['link'] = $link;
  23. $share_options['title'] = $title;
  24. $share->update($share_options);
  25. ?><li class="item share<?= $cssClass ?>"><?php
  26. if ('GET' === $share->method()):
  27. if ($share->HTMLtag() !== 'button') {
  28. ?><a target="_blank" rel="noreferrer" href="<?= $share->url() ?>" data-type="<?= $share->type() ?>"><?= $share->name() ?></a><?php
  29. } else {
  30. ?><button type="button" class="as-link" data-url="<?= $share->url() ?>" data-type="<?= $share->type() ?>" data-title="<?= htmlspecialchars($title) ?>"><?= $share->name() ?></button><?php
  31. }
  32. else:
  33. ?><a href="POST"><?= $share->name() ?></a>
  34. <form method="POST" action="<?= $share->url() ?>" disabled="disabled">
  35. <input type="hidden" value="<?= $link ?>" name="<?= $share->field() ?>"/>
  36. </form><?php
  37. endif; ?>
  38. </li><?php
  39. endforeach;
  40. ?></ul>