entry_share_menu.phtml 1.4 KB

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