bookmark.phtml 543 B

12345678910111213141516171819
  1. <?php
  2. declare(strict_types=1);
  3. /** @var FreshRSS_View $this */
  4. header('Content-Type: application/json; charset=UTF-8');
  5. $url = array(
  6. 'c' => Minz_Request::controllerName(),
  7. 'a' => Minz_Request::actionName(),
  8. 'params' => $_GET,
  9. );
  10. $url['params']['is_favorite'] = (Minz_Request::paramTernary('is_favorite') ?? true) ? '0' : '1';
  11. FreshRSS::loadStylesAndScripts();
  12. echo json_encode(array(
  13. 'url' => str_ireplace('&amp;', '&', Minz_Url::display($url)),
  14. 'icon' => _i($url['params']['is_favorite'] === '1' ? 'non-starred' : 'starred')
  15. ));