entry_share_menu.phtml 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  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') ?> <a href="<?= _url('configure', 'integration') ?>"><?= _i('configure') ?></a></li><?php
  7. $link = '--link--';
  8. $title = '--titleText----websiteName----articleAuthors--';
  9. foreach (FreshRSS_Context::userConf()->sharing as $share_options) {
  10. $share = FreshRSS_Share::get($share_options['type']);
  11. if ($share === null) {
  12. continue;
  13. }
  14. $cssClass = $share->isDeprecated() ? ' error' : '';
  15. $share_options['link'] = $link;
  16. $share_options['title'] = $title;
  17. $share->update($share_options);
  18. ?><li class="item share<?= $cssClass ?>">
  19. <?php if ('GET' === $share->method()) {
  20. if ($share->HTMLtag() !== 'button') {?>
  21. <a target="_blank" rel="noreferrer" href="<?= $share->url() ?>" data-type="<?= $share->type() ?>"><?= $share->name() ?></a>
  22. <?php } else { ?>
  23. <button type="button" class="as-link" data-url="<?= $share->url() ?>" data-type="<?= $share->type() ?>" data-title="<?= htmlspecialchars($title) ?>"><?= $share->name() ?></button>
  24. <?php
  25. }
  26. } else {?>
  27. <a href="POST"><?= $share->name() ?></a>
  28. <form method="POST" action="<?= $share->url() ?>" disabled="disabled">
  29. <input type="hidden" value="<?= $link ?>" name="<?= $share->field() ?>"/>
  30. </form>
  31. <?php } ?>
  32. </li><?php
  33. }
  34. ?></ul>