update.phtml 35 KB

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