update.phtml 43 KB

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