index.phtml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. declare(strict_types=1);
  3. /** @var FreshRSS_View $this */
  4. $this->partial('aside_subscription');
  5. ?>
  6. <main class="post ">
  7. <div class="link-back-wrapper">
  8. <a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
  9. </div>
  10. <h1><?= _t('sub.menu.import_export') ?></h1>
  11. <h2><?= _t('sub.category.dynamic_opml') ?></h2>
  12. <div class="form-group form-actions">
  13. <div class="group-controls">
  14. <ul>
  15. <li><a href="<?= _url('subscription', 'add') ?>"><?= _t('sub.title.add_dynamic_opml') ?> <?= _i('opml-dyn') ?></a></li>
  16. </ul>
  17. </div>
  18. </div>
  19. <h2><?= _t('sub.import_export.import') ?></h2>
  20. <form method="post" action="<?= _url('importExport', 'import') ?>" enctype="multipart/form-data">
  21. <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
  22. <div class="form-group">
  23. <label class="group-name" for="file">
  24. <?= extension_loaded('zip') ? _t('sub.import_export.file_to_import') : _t('sub.import_export.file_to_import_no_zip') ?>
  25. </label>
  26. <div class="group-controls">
  27. <input type="file" name="file" id="file" />
  28. </div>
  29. </div>
  30. <div class="form-group form-actions">
  31. <div class="group-controls">
  32. <button type="submit" class="btn btn-important"><?= _t('gen.action.import') ?></button>
  33. </div>
  34. </div>
  35. </form>
  36. <h2><?= _t('sub.import_export.export') ?></h2>
  37. <?php if (count($this->feeds) > 0) { ?>
  38. <form method="post" action="<?= _url('importExport', 'export') ?>">
  39. <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
  40. <div class="form-group">
  41. <div class="group-controls">
  42. <label class="checkbox" for="export_opml">
  43. <input type="checkbox" name="export_opml" id="export_opml" value="1" checked="checked" />
  44. <?= _t('sub.import_export.export_opml') ?>
  45. </label>
  46. <label class="checkbox" for="export_labelled">
  47. <input type="checkbox" name="export_labelled" id="export_labelled" value="1" <?= extension_loaded('zip') ? 'checked="checked"' : '' ?> />
  48. <?= _t('sub.import_export.export_labelled') ?>
  49. </label>
  50. <label class="checkbox" for="export_starred">
  51. <input type="checkbox" name="export_starred" id="export_starred" value="1" <?= extension_loaded('zip') ? 'checked="checked"' : '' ?> />
  52. <?= _t('sub.import_export.export_starred') ?>
  53. </label>
  54. <?php
  55. $select_args = '';
  56. if (extension_loaded('zip')) {
  57. $select_args = ' size="' . min(10, count($this->feeds)) . '" multiple="multiple"';
  58. }
  59. ?>
  60. <select name="export_feeds[]"<?= $select_args ?> size="10">
  61. <?= extension_loaded('zip') ? '' : '<option></option>' ?>
  62. <?php foreach ($this->feeds as $feed) { ?>
  63. <option value="<?= $feed->id() ?>"><?= $feed->name() ?></option>
  64. <?php } ?>
  65. </select>
  66. </div>
  67. </div>
  68. <div class="form-group form-actions">
  69. <div class="group-controls">
  70. <button type="submit" class="btn btn-important"><?= _t('gen.action.export') ?></button>
  71. </div>
  72. </div>
  73. </form>
  74. <?php } ?>
  75. </main>