update.phtml 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810
  1. <?php
  2. declare(strict_types=1);
  3. /** @var FreshRSS_View $this */
  4. ?>
  5. <div class="post" id="feed_update">
  6. <h1><?= $this->feed->name() ?></h1>
  7. <div>
  8. <a href="<?= _url('index', 'index', 'get', 'f_' . $this->feed->id()) ?>"><?= _i('link') ?> <?= _t('gen.action.filter') ?></a>
  9. <?= _t('gen.short.or') ?>
  10. <a href="<?= _url('stats', 'repartition', 'id', $this->feed->id()) ?>"><?= _i('stats') ?> <?= _t('sub.feed.stats') ?></a>
  11. </div>
  12. <?php $nbEntries = $this->feed->nbEntries(); ?>
  13. <?php if ($this->feed->inError()) { ?>
  14. <p class="alert alert-error"><span class="alert-head"><?= _t('gen.short.damn') ?></span> <?= _t('sub.feed.error') ?></p>
  15. <?php } elseif ($nbEntries === 0) { ?>
  16. <p class="alert alert-warn"><?= _t('sub.feed.empty') ?></p>
  17. <?php } ?>
  18. <?php
  19. $from = Minz_Request::paramString('from');
  20. if ($from === '') {
  21. $url = _url('subscription', 'feed', 'id', $this->feed->id(), '#', 'slider');
  22. } else {
  23. $get = Minz_Request::paramString('get');
  24. if ($get === '') {
  25. $url = _url('subscription', 'feed', 'id', $this->feed->id(), 'from', $from, '#', 'slider');
  26. } else {
  27. $url = _url('subscription', 'feed', 'id', $this->feed->id(), 'from', $from, 'get', $get, '#', 'slider');
  28. }
  29. }
  30. ?>
  31. <form method="post" action="<?= $url ?>" autocomplete="off">
  32. <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
  33. <fieldset>
  34. <legend><?= _t('sub.feed.information') ?></legend>
  35. <div class="form-group">
  36. <label class="group-name" for="name"><?= _t('sub.feed.title') ?></label>
  37. <div class="group-controls">
  38. <input type="text" name="name" id="name" class="w100" value="<?= $this->feed->name(true) ?>" required="required" />
  39. </div>
  40. </div>
  41. <div class="form-group">
  42. <label class="group-name" for="description"><?= _t('sub.feed.description') ?></label>
  43. <div class="group-controls">
  44. <textarea name="description" id="description" class="w100"><?= htmlspecialchars($this->feed->description(), ENT_NOQUOTES, 'UTF-8') ?></textarea>
  45. </div>
  46. </div>
  47. <div class="form-group">
  48. <label class="group-name" for="website"><?= _t('sub.feed.website') ?></label>
  49. <div class="group-controls">
  50. <div class="stick w100">
  51. <input type="url" name="website" id="website" value="<?= $this->feed->website() ?>" />
  52. <a class="btn open-url" target="_blank" rel="noreferrer" href="<?= $this->feed->website() ?>" data-input="website" title="<?= _t('gen.action.open_url') ?>"><?= _i('link') ?></a>
  53. </div>
  54. </div>
  55. </div>
  56. <div class="form-group">
  57. <label class="group-name" for="url"><?= _t('sub.feed.url') ?></label>
  58. <div class="group-controls">
  59. <div class="stick w100">
  60. <input type="url" name="url" id="url" value="<?= $this->feed->url() ?>" required="required" />
  61. <a class="btn open-url" target="_blank" rel="noreferrer" href="<?= $this->feed->url() ?>" data-input="url" title="<?= _t('gen.action.open_url') ?>"><?= _i('link') ?></a>
  62. </div>
  63. <a class="btn" target="_blank" rel="noreferrer" href="https://validator.w3.org/feed/check.cgi?url=<?=
  64. rawurlencode(htmlspecialchars_decode($this->feed->url(), ENT_QUOTES)) ?>"><?= _t('sub.feed.validator') ?></a>
  65. </div>
  66. </div>
  67. <div class="form-group">
  68. <label class="group-name" for="category"><?= _t('sub.category') ?></label>
  69. <div class="group-controls">
  70. <select name="category" id="category" class="w100">
  71. <?php foreach ($this->categories as $cat) { ?>
  72. <option value="<?= $cat->id() ?>"<?= $cat->id() == $this->feed->categoryId() ? ' selected="selected"' : '' ?>>
  73. <?= $cat->name() ?>
  74. </option>
  75. <?php } ?>
  76. </select>
  77. </div>
  78. </div>
  79. <div class="form-group">
  80. <label class="group-name" for="priority"><?= _t('sub.feed.priority') ?></label>
  81. <div class="group-controls">
  82. <select name="priority" id="priority" class="w50">
  83. <option value='<?= FreshRSS_Feed::PRIORITY_IMPORTANT ?>' <?php
  84. if (FreshRSS_Feed::PRIORITY_IMPORTANT === $this->feed->priority()) {echo 'selected="selected"';}?>><?= _t('sub.feed.priority.important') ?></option>
  85. <option value='<?= FreshRSS_Feed::PRIORITY_MAIN_STREAM ?>' <?php
  86. if (FreshRSS_Feed::PRIORITY_MAIN_STREAM === $this->feed->priority()) {echo 'selected="selected"';}?>><?= _t('sub.feed.priority.main_stream') ?></option>
  87. <option value='<?= FreshRSS_Feed::PRIORITY_CATEGORY ?>' <?php
  88. if (FreshRSS_Feed::PRIORITY_CATEGORY === $this->feed->priority()) {echo 'selected="selected"';}?>><?= _t('sub.feed.priority.category') ?></option>
  89. <option value='<?= FreshRSS_Feed::PRIORITY_ARCHIVED ?>' <?php
  90. if (FreshRSS_Feed::PRIORITY_ARCHIVED === $this->feed->priority()) {echo 'selected="selected"';}?>><?= _t('sub.feed.priority.archived') ?></option>
  91. </select>
  92. <?= _i('important') ?>
  93. </div>
  94. </div>
  95. <div class="form-group">
  96. <label class="group-name" for="ttl"><?= _t('sub.feed.ttl') ?></label>
  97. <div class="group-controls">
  98. <select class="w50" name="ttl" id="ttl" required="required"><?php
  99. $found = false;
  100. foreach (array(FreshRSS_Feed::TTL_DEFAULT => _t('gen.short.by_default'), 900 => '15min', 1200 => '20min', 1500 => '25min', 1800 => '30min', 2700 => '45min',
  101. 3600 => '1h', 5400 => '1.5h', 7200 => '2h', 10800 => '3h', 14400 => '4h', 18800 => '5h', 21600 => '6h', 25200 => '7h', 28800 => '8h',
  102. 36000 => '10h', 43200 => '12h', 64800 => '18h',
  103. 86400 => '1d', 129600 => '1.5d', 172800 => '2d', 259200 => '3d', 345600 => '4d', 432000 => '5d', 518400 => '6d',
  104. 604800 => '1wk', 1209600 => '2wk', 1814400 => '3wk', 2419200 => '4wk', 2629744 => '1mo') as $v => $t) {
  105. echo '<option value="' . $v . ($this->feed->ttl() === $v ? '" selected="selected' : '') . '">' . $t . '</option>';
  106. if ($this->feed->ttl() == $v) {
  107. $found = true;
  108. }
  109. }
  110. if (!$found) {
  111. echo '<option value="' . intval($this->feed->ttl()) . '" selected="selected">' . intval($this->feed->ttl()) . 's</option>';
  112. }
  113. ?></select>
  114. <label for="mute">
  115. <input type="checkbox" name="mute" id="mute" value="1"<?= $this->feed->mute() ? ' checked="checked"' : '' ?> />
  116. <?= _t('sub.feed.mute') ?>
  117. </label>
  118. </div>
  119. </div>
  120. <?php if ($this->feed->pubSubHubbubEnabled()) { ?>
  121. <div class="form-group">
  122. <div class="group-controls">
  123. <label class="checkbox" for="pubsubhubbub">
  124. <input type="checkbox" name="pubsubhubbub" id="pubsubhubbub" disabled="disabled" value="1" checked="checked" />
  125. <?= _t('sub.feed.websub') ?>
  126. </label>
  127. </div>
  128. </div>
  129. <?php } ?>
  130. <div class="form-group form-actions">
  131. <div class="group-controls">
  132. <button type="submit" class="btn btn-important"><?= _t('gen.action.submit') ?></button>
  133. <button type="reset" class="btn"><?= _t('gen.action.cancel') ?></button>
  134. <?php
  135. if ($from === '') {
  136. $url = _url('feed', 'delete', 'id', $this->feed->id());
  137. } else {
  138. $url = _url('feed', 'delete', 'id', $this->feed->id(), 'from', $from);
  139. }
  140. ?>
  141. <button type="submit" class="btn btn-attention confirm"
  142. data-str-confirm="<?= _t('gen.js.confirm_action_feed_cat') ?>"
  143. formaction="<?= $url ?>"
  144. formmethod="post"><?= _t('gen.action.remove') ?></button>
  145. </div>
  146. </div>
  147. </fieldset>
  148. <fieldset>
  149. <legend><?= _t('sub.feed.auth.configuration') ?></legend>
  150. <?php $auth = $this->feed->httpAuth(false); ?>
  151. <div class="form-group">
  152. <label class="group-name" for="http_user_feed<?= $this->feed->id() ?>"><?= _t('sub.feed.auth.username') ?></label>
  153. <div class="group-controls">
  154. <input type="text" name="http_user_feed<?= $this->feed->id() ?>" id="http_user_feed<?= $this->feed->id() ?>" class="w50" value="<?=
  155. empty($auth['username']) ? '' : $auth['username'] ?>" autocomplete="off" />
  156. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.auth.help') ?></p>
  157. </div>
  158. </div>
  159. <div class="form-group">
  160. <label class="group-name" for="http_pass_feed<?= $this->feed->id() ?>"><?= _t('sub.feed.auth.password') ?></label>
  161. <div class="group-controls">
  162. <div class="stick w50">
  163. <input type="password" name="http_pass_feed<?= $this->feed->id() ?>" id="http_pass_feed<?= $this->feed->id() ?>" value="<?=
  164. $auth['password'] ?>" autocomplete="new-password" />
  165. <button type="button" class="btn toggle-password" data-toggle="http_pass_feed<?= $this->feed->id() ?>"><?= _i('key') ?></button>
  166. </div>
  167. </div>
  168. </div>
  169. <div class="form-group form-actions">
  170. <div class="group-controls">
  171. <button type="submit" class="btn btn-important"><?= _t('gen.action.submit') ?></button>
  172. <button type="reset" class="btn"><?= _t('gen.action.cancel') ?></button>
  173. </div>
  174. </div>
  175. </fieldset>
  176. <fieldset>
  177. <legend><?= _t('sub.feed.filteractions') ?></legend>
  178. <div class="form-group">
  179. <label class="group-name" for="mark_updated_article_unread"><?= _t('conf.reading.mark_updated_article_unread') ?></label>
  180. <div class="group-controls">
  181. <select name="mark_updated_article_unread" id="mark_updated_article_unread" class="w50">
  182. <option value=""<?= $this->feed->attributeBoolean('mark_updated_article_unread') === null ? ' selected="selected"' : '' ?>><?= _t('gen.short.by_default') ?></option>
  183. <option value="0"<?= $this->feed->attributeBoolean('mark_updated_article_unread') === false ? ' selected="selected"' : '' ?>><?= _t('gen.short.no') ?></option>
  184. <option value="1"<?= $this->feed->attributeBoolean('mark_updated_article_unread') === true ? ' selected="selected"' : '' ?>><?= _t('gen.short.yes') ?></option>
  185. </select>
  186. </div>
  187. </div>
  188. <div class="form-group">
  189. <label class="group-name" for="read_when_same_title_in_feed"><?= _t('conf.reading.read.when') ?></label>
  190. <div class="group-controls">
  191. <select name="read_when_same_title_in_feed" id="read_when_same_title_in_feed" class="w50">
  192. <option value=""<?= $this->feed->hasAttribute('read_when_same_title_in_feed') ? '' : ' selected="selected"' ?>><?= _t('gen.short.by_default') ?></option>
  193. <option value="0"<?= $this->feed->attributeBoolean('read_when_same_title_in_feed') === false ? ' selected="selected"' : '' ?>><?= _t('gen.short.no') ?></option>
  194. <option value="10"<?= $this->feed->attributeInt('read_when_same_title_in_feed') == 10 ? ' selected="selected"' : '' ?>>10</option>
  195. <option value="25"<?= $this->feed->attributeInt('read_when_same_title_in_feed') == 25 ? ' selected="selected"' : '' ?>>25</option>
  196. <option value="100"<?= $this->feed->attributeInt('read_when_same_title_in_feed') == 100 ? ' selected="selected"' : '' ?>>100</option>
  197. <option value="1000"<?= $this->feed->attributeInt('read_when_same_title_in_feed') == 1000 ? ' selected="selected"' : '' ?>>1 000</option>
  198. </select>
  199. <?= _t('conf.reading.read.when_same_title') ?>
  200. </div>
  201. </div>
  202. <div class="form-group">
  203. <label class="group-name" for="read_upon_reception"><?= _t('conf.reading.read.when') ?></label>
  204. <div class="group-controls">
  205. <select name="read_upon_reception" id="read_upon_reception" class="w50">
  206. <option value=""<?= $this->feed->attributeBoolean('read_upon_reception') === null ? ' selected="selected"' : '' ?>><?= _t('gen.short.by_default') ?></option>
  207. <option value="0"<?= $this->feed->attributeBoolean('read_upon_reception') === false ? ' selected="selected"' : '' ?>><?= _t('gen.short.no') ?></option>
  208. <option value="1"<?= $this->feed->attributeBoolean('read_upon_reception') === true ? ' selected="selected"' : '' ?>><?= _t('gen.short.yes') ?></option>
  209. </select>
  210. <?= _t('conf.reading.read.upon_reception') ?>
  211. </div>
  212. </div>
  213. <div class="form-group">
  214. <label class="group-name" for="read_upon_gone"><?= _t('conf.reading.read.when') ?></label>
  215. <div class="group-controls">
  216. <select name="read_upon_gone" id="read_upon_gone" class="w50">
  217. <option value=""<?= $this->feed->attributeBoolean('read_upon_gone') === null ? ' selected="selected"' : '' ?>><?= _t('gen.short.by_default') ?></option>
  218. <option value="0"<?= $this->feed->attributeBoolean('read_upon_gone') === false ? ' selected="selected"' : '' ?>><?= _t('gen.short.no') ?></option>
  219. <option value="1"<?= $this->feed->attributeBoolean('read_upon_gone') === true ? ' selected="selected"' : '' ?>><?= _t('gen.short.yes') ?></option>
  220. </select>
  221. <?= _t('conf.reading.read.upon_gone') ?>
  222. </div>
  223. </div>
  224. <div class="form-group">
  225. <label class="group-name" for="filteractions_read"><?= _t('conf.reading.read.when') ?></label>
  226. <div class="group-controls">
  227. <textarea name="filteractions_read" id="filteractions_read" class="w100"><?php
  228. foreach ($this->feed->filtersAction('read') as $filterRead) {
  229. echo $filterRead->getRawInput(), PHP_EOL;
  230. }
  231. ?></textarea>
  232. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.filteractions.help') ?></p>
  233. </div>
  234. </div>
  235. <div class="form-group">
  236. <label class="group-name" for="keep_max_n_unread"><?= _t('conf.reading.read.keep_max_n_unread') ?></label>
  237. <div class="group-controls">
  238. <input type="number" name="keep_max_n_unread" id="keep_max_n_unread" class="w50" min="1" max="10000000"
  239. data-leave-validation="<?= $this->feed->attributeInt('keep_max_n_unread') ?>"
  240. value="<?= $this->feed->attributeInt('keep_max_n_unread') ?>"
  241. placeholder="<?= _t('gen.short.by_default') ?>" />
  242. </div>
  243. </div>
  244. <div class="form-group form-actions">
  245. <div class="group-controls">
  246. <button type="submit" class="btn btn-important"><?= _t('gen.action.submit') ?></button>
  247. <button type="reset" class="btn"><?= _t('gen.action.cancel') ?></button>
  248. </div>
  249. </div>
  250. </fieldset>
  251. <fieldset>
  252. <legend><?= _t('sub.feed.archiving') ?></legend>
  253. <div class="form-group">
  254. <div class="group-controls">
  255. <?= _t('sub.feed.number_entries', $nbEntries) ?>
  256. <a class="btn" href="<?= _url('feed', 'actualize', 'id', $this->feed->id(), '#', 'slider') ?>">
  257. <?= _i('refresh') ?> <?= _t('gen.action.actualize') ?>
  258. </a>
  259. </div>
  260. </div>
  261. <?php
  262. $archiving = $this->feed->attributeArray('archiving');
  263. /** @var array<'default'?:bool,'keep_period'?:string,'keep_max'?:int,'keep_min'?:int,'keep_favourites'?:bool,'keep_labels'?:bool,'keep_unreads'?:bool>|null $archiving */
  264. if (empty($archiving)) {
  265. $archiving = [ 'default' => true ];
  266. } else {
  267. $archiving['default'] = false;
  268. }
  269. $volatile = [
  270. 'enable_keep_period' => false,
  271. 'keep_period_count' => '3',
  272. 'keep_period_unit' => 'P1M',
  273. ];
  274. if (!empty($archiving['keep_period']) && is_string($archiving['keep_period'])) {
  275. if (preg_match('/^PT?(?P<count>\d+)[YMWDH]$/', $archiving['keep_period'], $matches)) {
  276. $volatile['enable_keep_period'] = true;
  277. $volatile['keep_period_count'] = $matches['count'];
  278. $volatile['keep_period_unit'] = str_replace($matches['count'], '1', $archiving['keep_period']);
  279. }
  280. }
  281. //Defaults
  282. if (!isset($archiving['keep_max']) || !is_int($archiving['keep_max'])) {
  283. $archiving['keep_max'] = 0;
  284. }
  285. if (!isset($archiving['keep_min']) || !is_int($archiving['keep_min'])) {
  286. $archiving['keep_min'] = 50;
  287. }
  288. if (!isset($archiving['keep_favourites']) || !is_bool($archiving['keep_favourites'])) {
  289. $archiving['keep_favourites'] = true;
  290. }
  291. if (!isset($archiving['keep_labels']) || !is_bool($archiving['keep_labels'])) {
  292. $archiving['keep_labels'] = true;
  293. }
  294. if (!isset($archiving['keep_unreads']) || !is_bool($archiving['keep_unreads'])) {
  295. $archiving['keep_unreads'] = false;
  296. }
  297. ?>
  298. <p class="alert alert-warn">
  299. <?= _t('conf.archiving.policy_warning') ?>
  300. </p>
  301. <div class="form-group">
  302. <div class="group-name"><?= _t('conf.archiving.policy') ?></div>
  303. <div class="group-controls">
  304. <label class="checkbox">
  305. <input type="checkbox" name="use_default_purge_options" id="use_default_purge_options" value="1"<?= $archiving['default'] ? ' checked="checked"' : '' ?>
  306. data-leave-validation="<?= $archiving['default'] ? 1 : 0 ?>" />
  307. <?= _t('gen.short.by_default') ?>
  308. </label>
  309. </div>
  310. </div>
  311. <div class="form-group archiving"<?= $archiving['default'] ? ' hidden="hidden"' : '' ?>>
  312. <div class="group-controls">
  313. <label class="checkbox" for="enable_keep_max">
  314. <input type="checkbox" name="enable_keep_max" id="enable_keep_max" value="1"<?= empty($archiving['keep_max']) ? '' : ' checked="checked"' ?>
  315. data-leave-validation="<?= empty($archiving['keep_max']) ? 0 : 1 ?>"/>
  316. <?= _t('conf.archiving.keep_max') ?>
  317. <input type="number" id="keep_max" name="keep_max" min="0" value="<?= empty($archiving['keep_max']) ? 200 : $archiving['keep_max'] ?>"
  318. data-leave-validation="<?= empty($archiving['keep_max']) ? 200 : $archiving['keep_max'] ?>"/>
  319. </label>
  320. </div>
  321. </div>
  322. <div class="form-group archiving"<?= $archiving['default'] ? ' hidden="hidden"' : '' ?>>
  323. <div class="group-controls">
  324. <label class="checkbox" for="enable_keep_period">
  325. <input type="checkbox" name="enable_keep_period" id="enable_keep_period" value="1"<?= $volatile['enable_keep_period'] ? ' checked="checked"' : '' ?>
  326. data-leave-validation="<?= $volatile['enable_keep_period'] ? 1 : 0 ?>"/>
  327. <?= _t('conf.archiving.keep_period') ?>
  328. <input type="number" id="keep_period_count" name="keep_period_count" min="0" value="<?= $volatile['keep_period_count'] ?>"
  329. data-leave-validation="<?= $volatile['keep_period_count'] ?>"/>
  330. <select class="number" name="keep_period_unit" id="keep_period_unit" data-leave-validation="<?= $volatile['keep_period_unit'] ?>">
  331. <option></option>
  332. <option value="P1Y" <?= 'P1Y' === $volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.years') ?></option>
  333. <option value="P1M" <?= 'P1M' === $volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.months') ?></option>
  334. <option value="P1W" <?= 'P1W' === $volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.weeks') ?></option>
  335. <option value="P1D" <?= 'P1D' === $volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.days') ?></option>
  336. <option value="PT1H" <?= 'PT1H' === $volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.hours') ?></option>
  337. </select>
  338. </label>
  339. </div>
  340. </div>
  341. <div class="form-group archiving"<?= $archiving['default'] ? ' hidden="hidden"' : '' ?>>
  342. <div class="group-name"><?= _t('conf.archiving.exception') ?></div>
  343. <div class="group-controls">
  344. <label class="checkbox" for="keep_favourites">
  345. <input type="checkbox" name="keep_favourites" id="keep_favourites" value="1"<?= $archiving['keep_favourites'] ? ' checked="checked"' : '' ?>
  346. data-leave-validation="<?= $archiving['keep_favourites'] ? 1 : 0 ?>"/>
  347. <?= _t('conf.archiving.keep_favourites') ?>
  348. </label>
  349. </div>
  350. </div>
  351. <div class="form-group archiving"<?= $archiving['default'] ? ' hidden="hidden"' : '' ?>>
  352. <div class="group-controls">
  353. <label class="checkbox" for="keep_labels">
  354. <input type="checkbox" name="keep_labels" id="keep_labels" value="1"<?= $archiving['keep_labels'] ? ' checked="checked"' : '' ?>
  355. data-leave-validation="<?= $archiving['keep_labels'] ? 1 : 0 ?>"/>
  356. <?= _t('conf.archiving.keep_labels') ?>
  357. </label>
  358. </div>
  359. </div>
  360. <div class="form-group archiving"<?= $archiving['default'] ? ' hidden="hidden"' : '' ?>>
  361. <div class="group-controls">
  362. <label class="checkbox" for="keep_unreads">
  363. <input type="checkbox" name="keep_unreads" id="keep_unreads" value="1"<?= $archiving['keep_unreads'] ? ' checked="checked"' : '' ?>
  364. data-leave-validation="<?= $archiving['keep_unreads'] ?>"/>
  365. <?= _t('conf.archiving.keep_unreads') ?>
  366. </label>
  367. </div>
  368. </div>
  369. <div class="form-group archiving"<?= $archiving['default'] ? ' hidden="hidden"' : '' ?>>
  370. <div class="group-controls">
  371. <label for="keep_min"><?= _t('sub.feed.keep_min') ?>
  372. <input type="number" id="keep_min" name="keep_min" min="0" value="<?= $archiving['keep_min'] ?>"
  373. data-leave-validation="<?= $archiving['keep_min'] ?>">
  374. </label>
  375. </div>
  376. </div>
  377. <div class="form-group form-actions">
  378. <div class="group-controls">
  379. <button type="submit" class="btn btn-important"><?= _t('gen.action.submit') ?></button>
  380. <button type="reset" class="btn"><?= _t('gen.action.cancel') ?></button>
  381. <button type="submit" class="btn btn-attention confirm" formmethod="post" formaction="<?= _url('feed', 'truncate', 'id', $this->feed->id(), '#', 'slider') ?>"><?= _t('gen.action.truncate') ?></button>
  382. </div>
  383. </div>
  384. </fieldset>
  385. <fieldset>
  386. <legend><?= _t('sub.feed.kind') ?></legend>
  387. <div class="form-group">
  388. <label class="group-name" for="feed_kind"><?= _t('sub.feed.kind') ?></label>
  389. <div class="group-controls">
  390. <select name="feed_kind" id="feed_kind" class="select-show w100">
  391. <option value="<?= FreshRSS_Feed::KIND_RSS ?>" <?= $this->feed->kind() === FreshRSS_Feed::KIND_RSS ? 'selected="selected"' : '' ?>><?= _t('sub.feed.kind.rss') ?></option>
  392. <option value="<?= FreshRSS_Feed::KIND_HTML_XPATH ?>" <?= $this->feed->kind() === FreshRSS_Feed::KIND_HTML_XPATH ? 'selected="selected"' : '' ?> data-show="html_xpath"><?= _t('sub.feed.kind.html_xpath') ?></option>
  393. <option value="<?= FreshRSS_Feed::KIND_XML_XPATH ?>" <?= $this->feed->kind() === FreshRSS_Feed::KIND_XML_XPATH ? 'selected="selected"' : '' ?> data-show="html_xpath"><?= _t('sub.feed.kind.xml_xpath') ?></option>
  394. <option value="<?= FreshRSS_Feed::KIND_JSONFEED ?>" <?= $this->feed->kind() === FreshRSS_Feed::KIND_JSONFEED ? 'selected="selected"' : '' ?>><?= _t('sub.feed.kind.jsonfeed') ?></option>
  395. <option value="<?= FreshRSS_Feed::KIND_JSON_DOTNOTATION ?>" <?= $this->feed->kind() === FreshRSS_Feed::KIND_JSON_DOTNOTATION ? 'selected="selected"' : '' ?> data-show="json_dotnotation"><?= _t('sub.feed.kind.json_dotnotation') ?></option>
  396. </select>
  397. </div>
  398. </div>
  399. </fieldset>
  400. <fieldset id="html_xpath">
  401. <?php
  402. /** @var array<string> $xpath */
  403. $xpath = Minz_Helper::htmlspecialchars_utf8($this->feed->attributeArray('xpath') ?? []);
  404. ?>
  405. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.html_xpath.help') ?></p>
  406. <div class="form-group">
  407. <label class="group-name" for="xPathItem"><small><?= _t('sub.feed.kind.html_xpath.xpath') ?></small><br />
  408. <?= _t('sub.feed.kind.html_xpath.item') ?></label>
  409. <div class="group-controls">
  410. <textarea class="valid-xpath w100" name="xPathItem" id="xPathItem" rows="2" cols="64" spellcheck="false"
  411. data-leave-validation="<?= $xpath['item'] ?? '' ?>"><?= $xpath['item'] ?? '' ?></textarea>
  412. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.html_xpath.item.help') ?></p>
  413. </div>
  414. </div>
  415. <div class="form-group">
  416. <label class="group-name" for="xPathItemTitle"><small><?= _t('sub.feed.kind.html_xpath.relative') ?></small><br />
  417. <?= _t('sub.feed.kind.html_xpath.item_title') ?></label>
  418. <div class="group-controls">
  419. <textarea class="valid-xpath w100" name="xPathItemTitle" id="xPathItemTitle" rows="2" cols="64" spellcheck="false"
  420. data-leave-validation="<?= $xpath['itemTitle'] ?? '' ?>"><?= $xpath['itemTitle'] ?? '' ?></textarea>
  421. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.html_xpath.item_title.help') ?></p>
  422. </div>
  423. </div>
  424. <div class="form-group">
  425. <label class="group-name" for="xPathItemContent"><small><?= _t('sub.feed.kind.html_xpath.relative') ?></small><br />
  426. <?= _t('sub.feed.kind.html_xpath.item_content') ?></label>
  427. <div class="group-controls">
  428. <textarea class="valid-xpath w100" name="xPathItemContent" id="xPathItemContent" rows="2" cols="64" spellcheck="false"
  429. data-leave-validation="<?= $xpath['itemContent'] ?? '' ?>"><?= $xpath['itemContent'] ?? '' ?></textarea>
  430. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.html_xpath.item_content.help') ?></p>
  431. </div>
  432. </div>
  433. <div class="form-group">
  434. <label class="group-name" for="xPathItemUri"><small><?= _t('sub.feed.kind.html_xpath.relative') ?></small><br />
  435. <?= _t('sub.feed.kind.html_xpath.item_uri') ?></label>
  436. <div class="group-controls">
  437. <textarea class="valid-xpath w100" name="xPathItemUri" id="xPathItemUri" rows="2" cols="64" spellcheck="false"
  438. data-leave-validation="<?= $xpath['itemUri'] ?? '' ?>"><?= $xpath['itemUri'] ?? '' ?></textarea>
  439. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.html_xpath.item_uri.help') ?></p>
  440. </div>
  441. </div>
  442. <div class="form-group">
  443. <label class="group-name" for="xPathItemThumbnail"><small><?= _t('sub.feed.kind.html_xpath.relative') ?></small><br />
  444. <?= _t('sub.feed.kind.html_xpath.item_thumbnail') ?></label>
  445. <div class="group-controls">
  446. <textarea class="valid-xpath w100" name="xPathItemThumbnail" id="xPathItemThumbnail" rows="2" cols="64" spellcheck="false"
  447. data-leave-validation="<?= $xpath['itemThumbnail'] ?? '' ?>"><?= $xpath['itemThumbnail'] ?? '' ?></textarea>
  448. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.html_xpath.item_thumbnail.help') ?></p>
  449. </div>
  450. </div>
  451. <div class="form-group">
  452. <label class="group-name" for="xPathItemAuthor"><small><?= _t('sub.feed.kind.html_xpath.relative') ?></small><br />
  453. <?= _t('sub.feed.kind.html_xpath.item_author') ?></label>
  454. <div class="group-controls">
  455. <textarea class="valid-xpath w100" name="xPathItemAuthor" id="xPathItemAuthor" rows="2" cols="64" spellcheck="false"
  456. data-leave-validation="<?= $xpath['itemAuthor'] ?? '' ?>"><?= $xpath['itemAuthor'] ?? '' ?></textarea>
  457. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.html_xpath.item_author.help') ?></p>
  458. </div>
  459. </div>
  460. <div class="form-group">
  461. <label class="group-name" for="xPathItemTimestamp"><small><?= _t('sub.feed.kind.html_xpath.relative') ?></small><br />
  462. <?= _t('sub.feed.kind.html_xpath.item_timestamp') ?></label>
  463. <div class="group-controls">
  464. <textarea class="valid-xpath w100" name="xPathItemTimestamp" id="xPathItemTimestamp" rows="2" cols="64" spellcheck="false"
  465. data-leave-validation="<?= $xpath['itemTimestamp'] ?? '' ?>"><?= $xpath['itemTimestamp'] ?? '' ?></textarea>
  466. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.html_xpath.item_timestamp.help') ?></p>
  467. </div>
  468. </div>
  469. <div class="form-group">
  470. <label class="group-name" for="xPathItemTimeFormat">
  471. <?= _t('sub.feed.kind.html_xpath.item_timeFormat') ?></label>
  472. <div class="group-controls">
  473. <textarea class="w100" name="xPathItemTimeFormat" id="xPathItemTimeFormat" rows="2" cols="64" spellcheck="false"
  474. data-leave-validation="<?= $xpath['itemTimeFormat'] ?? '' ?>"><?= $xpath['itemTimeFormat'] ?? '' ?></textarea>
  475. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.html_xpath.item_timeFormat.help') ?></p>
  476. </div>
  477. </div>
  478. <div class="form-group">
  479. <label class="group-name" for="xPathItemCategories"><small><?= _t('sub.feed.kind.html_xpath.relative') ?></small><br />
  480. <?= _t('sub.feed.kind.html_xpath.item_categories') ?></label>
  481. <div class="group-controls">
  482. <textarea class="valid-xpath w100" name="xPathItemCategories" id="xPathItemCategories" rows="2" cols="64" spellcheck="false"
  483. data-leave-validation="<?= $xpath['itemCategories'] ?? '' ?>"><?= $xpath['itemCategories'] ?? '' ?></textarea>
  484. </div>
  485. </div>
  486. <div class="form-group">
  487. <label class="group-name" for="xPathItemUid"><small><?= _t('sub.feed.kind.html_xpath.relative') ?></small><br />
  488. <?= _t('sub.feed.kind.html_xpath.item_uid') ?></label>
  489. <div class="group-controls">
  490. <textarea class="valid-xpath w100" name="xPathItemUid" id="xPathItemUid" rows="2" cols="64" spellcheck="false"
  491. data-leave-validation="<?= $xpath['itemUid'] ?? '' ?>"><?= $xpath['itemUid'] ?? '' ?></textarea>
  492. </div>
  493. </div>
  494. </fieldset>
  495. <fieldset id="json_dotnotation">
  496. <?php
  497. /** @var array<string,string> $jsonSettings */
  498. $jsonSettings = Minz_Helper::htmlspecialchars_utf8($this->feed->attributeArray('json_dotnotation') ?? []);
  499. ?>
  500. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.json_dotnotation.help') ?></p>
  501. <div class="form-group">
  502. <label class="group-name" for="jsonItem"><small><?= _t('sub.feed.kind.json_dotnotation.json') ?></small><br />
  503. <?= _t('sub.feed.kind.json_dotnotation.item') ?></label>
  504. <div class="group-controls">
  505. <textarea class="valid-json w100" name="jsonItem" id="jsonItem" rows="2" cols="64" spellcheck="false" data-leave-validation="<?= $jsonSettings['item'] ?? '' ?>"><?= $jsonSettings['item'] ?? '' ?></textarea>
  506. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.json_dotnotation.item.help') ?></p>
  507. </div>
  508. </div>
  509. <div class="form-group">
  510. <label class="group-name" for="jsonItemTitle"><small><?= _t('sub.feed.kind.json_dotnotation.relative') ?></small><br />
  511. <?= _t('sub.feed.kind.json_dotnotation.item_title') ?></label>
  512. <div class="group-controls">
  513. <textarea class="valid-json w100" name="jsonItemTitle" id="jsonItemTitle" rows="2" cols="64" spellcheck="false" data-leave-validation="<?= $jsonSettings['itemTitle'] ?? '' ?>"><?= $jsonSettings['itemTitle'] ?? '' ?></textarea>
  514. </div>
  515. </div>
  516. <div class="form-group">
  517. <label class="group-name" for="jsonItemContent"><small><?= _t('sub.feed.kind.json_dotnotation.relative') ?></small><br />
  518. <?= _t('sub.feed.kind.json_dotnotation.item_content') ?></label>
  519. <div class="group-controls">
  520. <textarea class="valid-json w100" name="jsonItemContent" id="jsonItemContent" rows="2" cols="64" spellcheck="false" data-leave-validation="<?= $jsonSettings['itemContent'] ?? '' ?>"><?= $jsonSettings['itemContent'] ?? '' ?></textarea>
  521. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.json_dotnotation.item_content.help') ?></p>
  522. </div>
  523. </div>
  524. <div class="form-group">
  525. <label class="group-name" for="jsonItemUri"><small><?= _t('sub.feed.kind.json_dotnotation.relative') ?></small><br />
  526. <?= _t('sub.feed.kind.json_dotnotation.item_uri') ?></label>
  527. <div class="group-controls">
  528. <textarea class="valid-json w100" name="jsonItemUri" id="jsonItemUri" rows="2" cols="64" spellcheck="false" data-leave-validation="<?= $jsonSettings['itemUri'] ?? '' ?>"><?= $jsonSettings['itemUri'] ?? '' ?></textarea>
  529. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.json_dotnotation.item_uri.help') ?></p>
  530. </div>
  531. </div>
  532. <div class="form-group">
  533. <label class="group-name" for="jsonItemThumbnail"><small><?= _t('sub.feed.kind.json_dotnotation.relative') ?></small><br />
  534. <?= _t('sub.feed.kind.json_dotnotation.item_thumbnail') ?></label>
  535. <div class="group-controls">
  536. <textarea class="valid-json w100" name="jsonItemThumbnail" id="jsonItemThumbnail" rows="2" cols="64" spellcheck="false" data-leave-validation="<?= $jsonSettings['itemThumbnail'] ?? '' ?>"><?= $jsonSettings['itemThumbnail'] ?? '' ?></textarea>
  537. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.json_dotnotation.item_thumbnail.help') ?></p>
  538. </div>
  539. </div>
  540. <div class="form-group">
  541. <label class="group-name" for="jsonItemAuthor"><small><?= _t('sub.feed.kind.json_dotnotation.relative') ?></small><br />
  542. <?= _t('sub.feed.kind.json_dotnotation.item_author') ?></label>
  543. <div class="group-controls">
  544. <textarea class="valid-json w100" name="jsonItemAuthor" id="jsonItemAuthor" rows="2" cols="64" spellcheck="false" data-leave-validation="<?= $jsonSettings['itemAuthor'] ?? '' ?>"><?= $jsonSettings['itemAuthor'] ?? '' ?></textarea>
  545. </div>
  546. </div>
  547. <div class="form-group">
  548. <label class="group-name" for="jsonItemTimestamp"><small><?= _t('sub.feed.kind.json_dotnotation.relative') ?></small><br />
  549. <?= _t('sub.feed.kind.json_dotnotation.item_timestamp') ?></label>
  550. <div class="group-controls">
  551. <textarea class="valid-json w100" name="jsonItemTimestamp" id="jsonItemTimestamp" rows="2" cols="64" spellcheck="false" data-leave-validation="<?= $jsonSettings['itemTimestamp'] ?? '' ?>"><?= $jsonSettings['itemTimestamp'] ?? '' ?></textarea>
  552. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.json_dotnotation.item_timestamp.help') ?></p>
  553. </div>
  554. </div>
  555. <div class="form-group">
  556. <label class="group-name" for="jsonItemTimeFormat">
  557. <?= _t('sub.feed.kind.json_dotnotation.item_timeFormat') ?></label>
  558. <div class="group-controls">
  559. <textarea class="w100" name="jsonItemTimeFormat" id="jsonItemTimeFormat" rows="2" cols="64" spellcheck="false" data-leave-validation="<?= $jsonSettings['itemTimeFormat'] ?? '' ?>"><?= $jsonSettings['itemTimeFormat'] ?? '' ?></textarea>
  560. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.json_dotnotation.item_timeFormat.help') ?></p>
  561. </div>
  562. </div>
  563. <div class="form-group">
  564. <label class="group-name" for="jsonItemCategories"><small><?= _t('sub.feed.kind.json_dotnotation.relative') ?></small><br />
  565. <?= _t('sub.feed.kind.json_dotnotation.item_categories') ?></label>
  566. <div class="group-controls">
  567. <textarea class="valid-json w100" name="jsonItemCategories" id="jsonItemCategories" rows="2" cols="64" spellcheck="false" data-leave-validation="<?= $jsonSettings['itemCategories'] ?? '' ?>"><?= $jsonSettings['itemCategories'] ?? '' ?></textarea>
  568. </div>
  569. </div>
  570. <div class="form-group">
  571. <label class="group-name" for="jsonItemUid"><small><?= _t('sub.feed.kind.json_dotnotation.relative') ?></small><br />
  572. <?= _t('sub.feed.kind.json_dotnotation.item_uid') ?></label>
  573. <div class="group-controls">
  574. <textarea class="valid-json w100" name="jsonItemUid" id="jsonItemUid" rows="2" cols="64" spellcheck="false" data-leave-validation="<?= $jsonSettings['itemUid'] ?? '' ?>"><?= $jsonSettings['itemUid'] ?? '' ?></textarea>
  575. </div>
  576. </div>
  577. <div class="form-group form-actions">
  578. <div class="group-controls">
  579. <button class="btn btn-important"><?= _t('gen.action.submit') ?></button>
  580. <button type="reset" class="btn"><?= _t('gen.action.cancel') ?></button>
  581. </div>
  582. </div>
  583. </fieldset>
  584. <fieldset>
  585. <legend><?= _t('sub.feed.advanced') ?></legend>
  586. <div class="form-group">
  587. <label class="group-name" for="path_entries"><?= _t('sub.feed.css_path') ?></label>
  588. <div class="group-controls">
  589. <div class="stick w100">
  590. <input type="text" name="path_entries" id="path_entries" class="w100" value="<?= $this->feed->pathEntries() ?>"
  591. data-leave-validation="<?= $this->feed->pathEntries() ?>" placeholder="<?= _t('gen.short.blank_to_disable') ?>" />
  592. <a id="popup-preview-selector" class="btn" href="<?=
  593. _url('feed', 'contentSelectorPreview', 'id', $this->feed->id(), 'selector', 'selector-token', 'selector_filter', 'selector-filter-token', '#', 'slider') ?>"><?= _i('look') ?></a>
  594. </div>
  595. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.css_help') ?></p>
  596. </div>
  597. </div>
  598. <div class="form-group">
  599. <?php
  600. $path_entries_filter = Minz_Helper::htmlspecialchars_utf8($this->feed->attributeString('path_entries_filter') ?? '');
  601. ?>
  602. <label class="group-name" for="path_entries_filter"><?= _t('sub.feed.css_path_filter') ?></label>
  603. <div class="group-controls">
  604. <div class="w100">
  605. <input type="text" name="path_entries_filter" id="path_entries_filter" class="w100" value="<?= $path_entries_filter ?>"
  606. data-leave-validation="<?= $path_entries_filter ?>" placeholder="<?= _t('gen.short.blank_to_disable') ?>" />
  607. </div>
  608. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.css_path_filter.help') ?></p>
  609. </div>
  610. </div>
  611. <div class="form-group">
  612. <?php
  613. /** @var array<int,int|string> $curlParams */
  614. $curlParams = $this->feed->attributeArray('curl_params') ?? [];
  615. ?>
  616. <label class="group-name" for="curl_params_cookie"><?= _t('sub.feed.css_cookie') ?></label>
  617. <div class="group-controls">
  618. <input type="text" name="curl_params_cookie" id="curl_params_cookie" class="w100" value="<?=
  619. !empty($curlParams[CURLOPT_COOKIE]) ? $curlParams[CURLOPT_COOKIE] : ''
  620. ?>" placeholder="<?= _t('gen.short.blank_to_disable') ?>" />
  621. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.css_cookie_help') ?></p>
  622. <label for="curl_params_cookiefile">
  623. <input type="checkbox" name="curl_params_cookiefile" id="curl_params_cookiefile" value="1"<?=
  624. isset($curlParams[CURLOPT_COOKIEFILE]) ? ' checked="checked"' : ''
  625. ?> />
  626. <?= _t('sub.feed.accept_cookies') ?>
  627. </label>
  628. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.accept_cookies_help') ?></p>
  629. </div>
  630. </div>
  631. <div class="form-group">
  632. <label class="group-name" for="curl_params_redirects"><?= _t('sub.feed.max_http_redir') ?></label>
  633. <div class="group-controls">
  634. <input type="number" name="curl_params_redirects" id="curl_params_redirects" class="w50" min="-1" value="<?=
  635. !empty($curlParams[CURLOPT_MAXREDIRS]) ? $curlParams[CURLOPT_MAXREDIRS] : ''
  636. ?>" placeholder="<?= _t('gen.short.blank_to_disable') ?>" />
  637. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.max_http_redir_help') ?></p>
  638. </div>
  639. </div>
  640. <div class="form-group">
  641. <label class="group-name" for="content_action"><?= _t('sub.feed.content_action') ?></label>
  642. <div class="group-controls">
  643. <select name="content_action" id="content_action" class="w50">
  644. <option value="replace"<?= 'replace' === $this->feed->attributeString('content_action') ? ' selected="selected"' : '' ?>><?= _t('sub.feed.content_action.replace') ?></option>
  645. <option value="prepend"<?= 'prepend' === $this->feed->attributeString('content_action') ? ' selected="selected"' : '' ?>><?= _t('sub.feed.content_action.prepend') ?></option>
  646. <option value="append"<?= 'append' === $this->feed->attributeString('content_action') ? ' selected="selected"' : '' ?>><?= _t('sub.feed.content_action.append') ?></option>
  647. </select>
  648. </div>
  649. </div>
  650. <div class="form-group">
  651. <label class="group-name" for="curl_params_useragent"><?= _t('sub.feed.useragent') ?></label>
  652. <div class="group-controls">
  653. <input type="text" name="curl_params_useragent" id="curl_params_useragent" class="w100" value="<?=
  654. !empty($curlParams[CURLOPT_USERAGENT]) ? $curlParams[CURLOPT_USERAGENT] : ''
  655. ?>" placeholder="<?= _t('gen.short.blank_to_disable') ?>" />
  656. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.useragent_help') ?></p>
  657. </div>
  658. </div>
  659. <div class="form-group">
  660. <label class="group-name" for="proxy_type"><?= _t('sub.feed.proxy') ?></label>
  661. <div class="group-controls">
  662. <select name="proxy_type" id="proxy_type"><?php
  663. $type = $curlParams[CURLOPT_PROXYTYPE] ?? '';
  664. foreach (['' => '', 3 => 'NONE', 0 => 'HTTP', 2 => 'HTTPS', 4 => 'SOCKS4', 6 => 'SOCKS4A', 5 => 'SOCKS5', 7 => 'SOCKS5H'] as $k => $v) {
  665. echo '<option value="' . $k . ($type === $k ? '" selected="selected' : '' ) . '">' . $v . '</option>';
  666. }
  667. ?>
  668. </select>
  669. <input type="text" name="curl_params" id="curl_params" value="<?=
  670. !empty($curlParams[CURLOPT_PROXY]) ? $curlParams[CURLOPT_PROXY] : ''
  671. ?>" placeholder="<?= _t('gen.short.blank_to_disable') ?>" />
  672. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.proxy_help') ?></p>
  673. </div>
  674. </div>
  675. <div class="form-group">
  676. <label class="group-name" for="curl_method"><?= _t('sub.feed.method') ?></label>
  677. <div class="group-controls">
  678. <select class="number" name="curl_method" id="curl_method"><?php
  679. $curl_method = 'GET';
  680. if ($this->feed->attributeArray('curl_params') !== null && !empty($this->feed->attributeArray('curl_params')[CURLOPT_POST])) {
  681. $curl_method = 'POST';
  682. }
  683. foreach (['GET' => 'GET', 'POST' => 'POST'] as $k => $v) {
  684. echo '<option value="' . $k . ($curl_method === $k ? '" selected="selected' : '') . '">' . $v . '</option>';
  685. }
  686. ?>
  687. </select>
  688. <div class="stick">
  689. <input type="text" name="curl_fields" id="curl_fields" value="<?=
  690. $this->feed->attributeArray('curl_params') !== null && !empty($this->feed->attributeArray('curl_params')[CURLOPT_POSTFIELDS]) ?
  691. htmlentities($this->feed->attributeArray('curl_params')[CURLOPT_POSTFIELDS], ENT_COMPAT) : ''
  692. ?>" placeholder="<?= _t('sub.feed.method_postparams') ?>" />
  693. </div>
  694. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.method_help') ?></p>
  695. </div>
  696. </div>
  697. <div class="form-group">
  698. <label class="group-name" for="timeout"><?= _t('sub.feed.timeout') ?></label>
  699. <div class="group-controls">
  700. <input type="number" name="timeout" id="timeout" class="w50" min="3" max="900" value="<?= $this->feed->attributeInt('timeout') ?>" placeholder="<?= _t('gen.short.by_default') ?>" />
  701. </div>
  702. </div>
  703. <div class="form-group">
  704. <label class="group-name" for="ssl_verify"><?= _t('sub.feed.ssl_verify') ?></label>
  705. <div class="group-controls">
  706. <select name="ssl_verify" id="ssl_verify" class="w50">
  707. <option value=""<?= $this->feed->attributeBoolean('ssl_verify') === null ? ' selected="selected"' : '' ?>><?= _t('gen.short.by_default') ?></option>
  708. <option value="0"<?= $this->feed->attributeBoolean('ssl_verify') === false ? ' selected="selected"' : '' ?>><?= _t('gen.short.no') ?></option>
  709. <option value="1"<?= $this->feed->attributeBoolean('ssl_verify') === true ? ' selected="selected"' : '' ?>><?= _t('gen.short.yes') ?></option>
  710. </select>
  711. </div>
  712. </div>
  713. <div class="form-group">
  714. <div class="group-controls">
  715. <label class="checkbox" for="clear_cache">
  716. <input type="checkbox" name="clear_cache" id="clear_cache" value="1"<?= $this->feed->attributeBoolean('clear_cache') ? ' checked="checked"' : '' ?> />
  717. <?= _t('sub.feed.clear_cache') ?>
  718. </label>
  719. </div>
  720. </div>
  721. <div class="form-group form-actions">
  722. <div class="group-controls">
  723. <button type="submit" class="btn btn-important"><?= _t('gen.action.submit') ?></button>
  724. <button type="reset" class="btn"><?= _t('gen.action.cancel') ?></button>
  725. </div>
  726. </div>
  727. </fieldset>
  728. </form>
  729. <h2><?= _t('sub.feed.maintenance.title') ?></h2>
  730. <div class="form-group">
  731. <div class="group-controls">
  732. <a class="btn btn-important" href="<?= _url('feed', 'clearCache', 'id', $this->feed->id(), '#', 'slider') ?>">
  733. <?= _t('sub.feed.maintenance.clear_cache') ?>
  734. </a>
  735. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.maintenance.clear_cache_help') ?></p>
  736. </div>
  737. <div class="group-controls">
  738. <form method="post" action="<?= _url('feed', 'reload', '#', 'slider') ?>">
  739. <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
  740. <input type="hidden" name="id" value="<?= $this->feed->id() ?>" />
  741. <button type="submit" class="btn btn-important">
  742. <?= _t('sub.feed.maintenance.reload_articles') ?>
  743. </button>
  744. <input type="number" name="reload_limit" min="1" value="10" />
  745. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.maintenance.reload_articles_help') ?></p>
  746. </form>
  747. </div>
  748. </div>
  749. <h2><?= _t('sub.import_export.export') ?></h2>
  750. <div class="form-group">
  751. <label class="group-name"><?= _t('sub.feed.export-as-opml.label') ?></label>
  752. <div class="group-controls">
  753. <a class="btn btn-important" href="<?= _url('index', 'opml', 'get', 'f_' . $this->feed->id()) ?>" download="f_<?= $this->feed->id() ?> <?= $this->feed->name(true) ?>.opml.xml">
  754. <?= _t('sub.feed.export-as-opml.download') ?>
  755. </a>
  756. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.export-as-opml.help') ?></p>
  757. </div>
  758. </div>
  759. </div>
  760. <div id="popup">
  761. <div id="popup-content">
  762. <div id="popup-close" class="popup-row"><?= _i('close') ?></div>
  763. <div id="popup-iframe-container" class="popup-row">
  764. <div id="popup-iframe-sub">
  765. <iframe id="popup-iframe" frameborder="0"></iframe>
  766. </div>
  767. </div>
  768. </div>
  769. </div>