4
0

update.phtml 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494
  1. <?php /** @var FreshRSS_View $this */ ?>
  2. <div class="post">
  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. <p><?= sanitizeHTML($this->feed->description()) ?></p>
  10. <?php $nbEntries = $this->feed->nbEntries(); ?>
  11. <?php if ($this->feed->inError()) { ?>
  12. <p class="alert alert-error"><span class="alert-head"><?= _t('gen.short.damn') ?></span> <?= _t('sub.feed.error') ?></p>
  13. <?php } elseif ($nbEntries === 0) { ?>
  14. <p class="alert alert-warn"><?= _t('sub.feed.empty') ?></p>
  15. <?php } ?>
  16. <form method="post" action="<?= _url('subscription', 'feed', 'id', $this->feed->id()) ?>" autocomplete="off">
  17. <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
  18. <legend><?= _t('sub.feed.information') ?></legend>
  19. <div class="form-group">
  20. <label class="group-name" for="name"><?= _t('sub.feed.title') ?></label>
  21. <div class="group-controls">
  22. <input type="text" name="name" id="name" class="extend" value="<?= $this->feed->name(true) ?>" />
  23. </div>
  24. </div>
  25. <div class="form-group">
  26. <label class="group-name" for="description"><?= _t('sub.feed.description') ?></label>
  27. <div class="group-controls">
  28. <textarea name="description" id="description"><?= htmlspecialchars($this->feed->description(), ENT_NOQUOTES, 'UTF-8') ?></textarea>
  29. </div>
  30. </div>
  31. <div class="form-group">
  32. <label class="group-name" for="website"><?= _t('sub.feed.website') ?></label>
  33. <div class="group-controls">
  34. <div class="stick">
  35. <input type="text" name="website" id="website" class="extend" value="<?= $this->feed->website() ?>" />
  36. <a class="btn" target="_blank" rel="noreferrer" href="<?= $this->feed->website() ?>"><?= _i('link') ?></a>
  37. </div>
  38. </div>
  39. </div>
  40. <div class="form-group">
  41. <label class="group-name" for="url"><?= _t('sub.feed.url') ?></label>
  42. <div class="group-controls">
  43. <div class="stick">
  44. <input type="text" name="url" id="url" class="extend" value="<?= $this->feed->url() ?>" />
  45. <a class="btn" target="_blank" rel="noreferrer" href="<?= $this->feed->url() ?>"><?= _i('link') ?></a>
  46. </div>
  47. <a class="btn" target="_blank" rel="noreferrer" href="https://validator.w3.org/feed/check.cgi?url=<?=
  48. rawurlencode(htmlspecialchars_decode($this->feed->url(), ENT_QUOTES)) ?>"><?= _t('sub.feed.validator') ?></a>
  49. </div>
  50. </div>
  51. <div class="form-group">
  52. <label class="group-name" for="category"><?= _t('sub.category') ?></label>
  53. <div class="group-controls">
  54. <select name="category" id="category">
  55. <?php foreach ($this->categories as $cat) { ?>
  56. <option value="<?= $cat->id() ?>"<?= $cat->id() == $this->feed->category() ? ' selected="selected"' : '' ?>>
  57. <?= $cat->name() ?>
  58. </option>
  59. <?php } ?>
  60. </select>
  61. </div>
  62. </div>
  63. <div class="form-group">
  64. <label class="group-name" for="priority"><?= _t('sub.feed.priority') ?></label>
  65. <div class="group-controls">
  66. <select name="priority" id="priority">
  67. <option value='<?= FreshRSS_Feed::PRIORITY_MAIN_STREAM ?>' <?php
  68. if (FreshRSS_Feed::PRIORITY_MAIN_STREAM === $this->feed->priority()) {echo 'selected="selected"';}?>><?= _t('sub.feed.priority.main_stream') ?></option>
  69. <option value='<?= FreshRSS_Feed::PRIORITY_NORMAL ?>' <?php
  70. if (FreshRSS_Feed::PRIORITY_NORMAL === $this->feed->priority()) {echo 'selected="selected"';}?>><?= _t('sub.feed.priority.normal') ?></option>
  71. <option value='<?= FreshRSS_Feed::PRIORITY_ARCHIVED ?>' <?php
  72. if (FreshRSS_Feed::PRIORITY_ARCHIVED === $this->feed->priority()) {echo 'selected="selected"';}?>><?= _t('sub.feed.priority.archived') ?></option>
  73. </select>
  74. </div>
  75. </div>
  76. <div class="form-group">
  77. <label class="group-name" for="ttl"><?= _t('sub.feed.ttl') ?></label>
  78. <div class="group-controls">
  79. <select class="number" name="ttl" id="ttl" required="required"><?php
  80. $found = false;
  81. foreach (array(FreshRSS_Feed::TTL_DEFAULT => _t('gen.short.by_default'), 900 => '15min', 1200 => '20min', 1500 => '25min', 1800 => '30min', 2700 => '45min',
  82. 3600 => '1h', 5400 => '1.5h', 7200 => '2h', 10800 => '3h', 14400 => '4h', 18800 => '5h', 21600 => '6h', 25200 => '7h', 28800 => '8h',
  83. 36000 => '10h', 43200 => '12h', 64800 => '18h',
  84. 86400 => '1d', 129600 => '1.5d', 172800 => '2d', 259200 => '3d', 345600 => '4d', 432000 => '5d', 518400 => '6d',
  85. 604800 => '1wk', 1209600 => '2wk', 1814400 => '3wk', 2419200 => '4wk', 2629744 => '1mo') as $v => $t) {
  86. echo '<option value="' . $v . ($this->feed->ttl() === $v ? '" selected="selected' : '') . '">' . $t . '</option>';
  87. if ($this->feed->ttl() == $v) {
  88. $found = true;
  89. }
  90. }
  91. if (!$found) {
  92. echo '<option value="' . intval($this->feed->ttl()) . '" selected="selected">' . intval($this->feed->ttl()) . 's</option>';
  93. }
  94. ?></select>
  95. <label for="mute">
  96. <input type="checkbox" name="mute" id="mute" value="1"<?= $this->feed->mute() ? ' checked="checked"' : '' ?> />
  97. <?= _t('sub.feed.mute') ?>
  98. </label>
  99. </div>
  100. </div>
  101. <?php if ($this->feed->pubSubHubbubEnabled()) { ?>
  102. <div class="form-group">
  103. <div class="group-controls">
  104. <label class="checkbox" for="pubsubhubbub">
  105. <input type="checkbox" name="pubsubhubbub" id="pubsubhubbub" disabled="disabled" value="1" checked="checked" />
  106. <?= _t('sub.feed.websub') ?>
  107. </label>
  108. </div>
  109. </div>
  110. <?php } ?>
  111. <div class="form-group form-actions">
  112. <div class="group-controls">
  113. <button class="btn btn-important"><?= _t('gen.action.submit') ?></button>
  114. <button type="reset" class="btn"><?= _t('gen.action.cancel') ?></button>
  115. <button class="btn btn-attention confirm"
  116. data-str-confirm="<?= _t('gen.js.confirm_action_feed_cat') ?>"
  117. formaction="<?= _url('feed', 'delete', 'id', $this->feed->id()) ?>"
  118. formmethod="post"><?= _t('gen.action.remove') ?></button>
  119. </div>
  120. </div>
  121. <legend><?= _t('sub.feed.auth.configuration') ?></legend>
  122. <?php $auth = $this->feed->httpAuth(false); ?>
  123. <div class="form-group">
  124. <label class="group-name" for="http_user_feed<?= $this->feed->id() ?>"><?= _t('sub.feed.auth.username') ?></label>
  125. <div class="group-controls">
  126. <input type="text" name="http_user_feed<?= $this->feed->id() ?>" id="http_user_feed<?= $this->feed->id() ?>" class="extend" value="<?=
  127. empty($auth['username']) ? '' : $auth['username'] ?>" autocomplete="off" />
  128. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.auth.help') ?></p>
  129. </div>
  130. </div>
  131. <div class="form-group">
  132. <label class="group-name" for="http_pass_feed<?= $this->feed->id() ?>"><?= _t('sub.feed.auth.password') ?></label>
  133. <div class="group-controls">
  134. <div class="stick">
  135. <input type="password" name="http_pass_feed<?= $this->feed->id() ?>" id="http_pass_feed<?= $this->feed->id() ?>" value="<?=
  136. $auth['password'] ?>" autocomplete="new-password" />
  137. <button type="button" class="btn toggle-password" data-toggle="http_pass_feed<?= $this->feed->id() ?>"><?= _i('key') ?></button>
  138. </div>
  139. </div>
  140. </div>
  141. <div class="form-group form-actions">
  142. <div class="group-controls">
  143. <button type="submit" class="btn btn-important"><?= _t('gen.action.submit') ?></button>
  144. <button type="reset" class="btn"><?= _t('gen.action.cancel') ?></button>
  145. </div>
  146. </div>
  147. <legend><?= _t('sub.feed.filteractions') ?></legend>
  148. <div class="form-group">
  149. <label class="group-name" for="mark_updated_article_unread"><?= _t('conf.reading.mark_updated_article_unread') ?></label>
  150. <div class="group-controls">
  151. <label class="checkbox" for="mark_updated_article_unread">
  152. <select name="mark_updated_article_unread" id="mark_updated_article_unread">
  153. <option value=""<?= $this->feed->attributes('mark_updated_article_unread') === null ? ' selected="selected"' : '' ?>><?= _t('gen.short.by_default') ?></option>
  154. <option value="0"<?= $this->feed->attributes('mark_updated_article_unread') === false ? ' selected="selected"' : '' ?>><?= _t('gen.short.no') ?></option>
  155. <option value="1"<?= $this->feed->attributes('mark_updated_article_unread') === true ? ' selected="selected"' : '' ?>><?= _t('gen.short.yes') ?></option>
  156. </select>
  157. </label>
  158. </div>
  159. </div>
  160. <div class="form-group">
  161. <label class="group-name" for="keep_max_n_unread"><?= _t('conf.reading.read.keep_max_n_unread') ?></label>
  162. <div class="group-controls">
  163. <input type="number" name="keep_max_n_unread" id="keep_max_n_unread" min="1" max="10000000" value="<?= $this->feed->attributes('keep_max_n_unread') ?>" placeholder="<?= _t('gen.short.by_default') ?>" />
  164. </div>
  165. </div>
  166. <div class="form-group">
  167. <label class="group-name" for="read_upon_reception"><?= _t('conf.reading.read.when') ?></label>
  168. <div class="group-controls">
  169. <label class="checkbox" for="read_upon_reception">
  170. <select name="read_upon_reception" id="read_upon_reception">
  171. <option value=""<?= $this->feed->attributes('read_upon_reception') === null ? ' selected="selected"' : '' ?>><?= _t('gen.short.by_default') ?></option>
  172. <option value="0"<?= $this->feed->attributes('read_upon_reception') === false ? ' selected="selected"' : '' ?>><?= _t('gen.short.no') ?></option>
  173. <option value="1"<?= $this->feed->attributes('read_upon_reception') === true ? ' selected="selected"' : '' ?>><?= _t('gen.short.yes') ?></option>
  174. </select>
  175. <?= _t('conf.reading.read.upon_reception') ?>
  176. </label>
  177. </div>
  178. </div>
  179. <div class="form-group">
  180. <label class="group-name" for="read_when_same_title_in_feed"><?= _t('conf.reading.read.when') ?></label>
  181. <div class="group-controls">
  182. <label class="checkbox" for="read_when_same_title_in_feed">
  183. <select name="read_when_same_title_in_feed" id="read_when_same_title_in_feed">
  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. </label>
  193. </div>
  194. </div>
  195. <div class="form-group">
  196. <label class="group-name" for="filteractions_read"><?= _t('conf.reading.read.when') ?></label>
  197. <div class="group-controls">
  198. <textarea name="filteractions_read" id="filteractions_read"><?php
  199. foreach ($this->feed->filtersAction('read') as $filterRead) {
  200. echo $filterRead->getRawInput(), PHP_EOL;
  201. }
  202. ?></textarea>
  203. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.filteractions.help') ?></p>
  204. </div>
  205. </div>
  206. <div class="form-group form-actions">
  207. <div class="group-controls">
  208. <button type="submit" class="btn btn-important"><?= _t('gen.action.submit') ?></button>
  209. <button type="reset" class="btn"><?= _t('gen.action.cancel') ?></button>
  210. </div>
  211. </div>
  212. <legend><?= _t('sub.feed.archiving') ?></legend>
  213. <div class="form-group">
  214. <div class="group-controls">
  215. <div class="stick">
  216. <input type="text" value="<?= _t('sub.feed.number_entries', $nbEntries) ?>" disabled="disabled" />
  217. <a class="btn" href="<?= _url('feed', 'actualize', 'id', $this->feed->id()) ?>">
  218. <?= _i('refresh') ?> <?= _t('gen.action.actualize') ?>
  219. </a>
  220. </div>
  221. </div>
  222. </div>
  223. <?php
  224. $archiving = $this->feed->attributes('archiving');
  225. if (empty($archiving)) {
  226. $archiving = [ 'default' => true ];
  227. } else {
  228. $archiving['default'] = false;
  229. }
  230. $volatile = [
  231. 'enable_keep_period' => false,
  232. 'keep_period_count' => '3',
  233. 'keep_period_unit' => 'P1M',
  234. ];
  235. if (!empty($archiving['keep_period'])) {
  236. if (preg_match('/^PT?(?P<count>\d+)[YMWDH]$/', $archiving['keep_period'], $matches)) {
  237. $volatile['enable_keep_period'] = true;
  238. $volatile['keep_period_count'] = $matches['count'];
  239. $volatile['keep_period_unit'] = str_replace($matches['count'], '1', $archiving['keep_period']);
  240. }
  241. }
  242. //Defaults
  243. if (!isset($archiving['keep_max'])) {
  244. $archiving['keep_max'] = false;
  245. }
  246. if (!isset($archiving['keep_min'])) {
  247. $archiving['keep_min'] = 50;
  248. }
  249. if (!isset($archiving['keep_favourites'])) {
  250. $archiving['keep_favourites'] = true;
  251. }
  252. if (!isset($archiving['keep_labels'])) {
  253. $archiving['keep_labels'] = true;
  254. }
  255. if (!isset($archiving['keep_unreads'])) {
  256. $archiving['keep_unreads'] = false;
  257. }
  258. ?>
  259. <p class="alert alert-warn">
  260. <?= _t('conf.archiving.policy_warning') ?>
  261. </p>
  262. <div class="form-group">
  263. <label class="group-name"><?= _t('conf.archiving.policy') ?></label>
  264. <div class="group-controls">
  265. <label class="checkbox">
  266. <input type="checkbox" name="use_default_purge_options" id="use_default_purge_options" value="1"<?= $archiving['default'] ? ' checked="checked"' : '' ?>
  267. data-leave-validation="<?= $archiving['default'] ? 1 : 0 ?>" />
  268. <?= _t('gen.short.by_default') ?>
  269. </label>
  270. </div>
  271. </div>
  272. <div class="form-group archiving"<?= $archiving['default'] ? ' hidden="hidden"' : '' ?>>
  273. <div class="group-controls">
  274. <label class="checkbox" for="enable_keep_max">
  275. <input type="checkbox" name="enable_keep_max" id="enable_keep_max" value="1"<?= empty($archiving['keep_max']) ? '' : ' checked="checked"' ?>
  276. data-leave-validation="<?= empty($archiving['keep_max']) ? 0 : 1 ?>"/>
  277. <?= _t('conf.archiving.keep_max') ?>
  278. <input type="number" id="keep_max" name="keep_max" min="0" value="<?= empty($archiving['keep_max']) ? 200 : $archiving['keep_max'] ?>"
  279. data-leave-validation="<?= empty($archiving['keep_max']) ? 200 : $archiving['keep_max'] ?>"/>
  280. </label>
  281. </div>
  282. </div>
  283. <div class="form-group archiving"<?= $archiving['default'] ? ' hidden="hidden"' : '' ?>>
  284. <div class="group-controls">
  285. <label class="checkbox" for="enable_keep_period">
  286. <input type="checkbox" name="enable_keep_period" id="enable_keep_period" value="1"<?= $volatile['enable_keep_period'] ? ' checked="checked"' : '' ?>
  287. data-leave-validation="<?= $volatile['enable_keep_period'] ? 1 : 0 ?>"/>
  288. <?= _t('conf.archiving.keep_period') ?>
  289. <input type="number" id="keep_period_count" name="keep_period_count" min="0" value="<?= $volatile['keep_period_count'] ?>"
  290. data-leave-validation="<?= $volatile['keep_period_count'] ?>"/>
  291. <select class="number" name="keep_period_unit" id="keep_period_unit" data-leave-validation="<?= $volatile['keep_period_unit'] ?>">
  292. <option></option>
  293. <option value="P1Y" <?= 'P1Y' === $volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.years') ?></option>
  294. <option value="P1M" <?= 'P1M' === $volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.months') ?></option>
  295. <option value="P1W" <?= 'P1W' === $volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.weeks') ?></option>
  296. <option value="P1D" <?= 'P1D' === $volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.days') ?></option>
  297. <option value="PT1H" <?= 'PT1H' === $volatile['keep_period_unit'] ? 'selected="selected"' : '' ?>><?= _t('gen.period.hours') ?></option>
  298. </select>
  299. </label>
  300. </div>
  301. </div>
  302. <div class="form-group archiving"<?= $archiving['default'] ? ' hidden="hidden"' : '' ?>>
  303. <label class="group-name"><?= _t('conf.archiving.exception') ?></label>
  304. <div class="group-controls">
  305. <label class="checkbox" for="keep_favourites">
  306. <input type="checkbox" name="keep_favourites" id="keep_favourites" value="1"<?= $archiving['keep_favourites'] ? ' checked="checked"' : '' ?>
  307. data-leave-validation="<?= $archiving['keep_favourites'] ? 1 : 0 ?>"/>
  308. <?= _t('conf.archiving.keep_favourites') ?>
  309. </label>
  310. </div>
  311. </div>
  312. <div class="form-group archiving"<?= $archiving['default'] ? ' hidden="hidden"' : '' ?>>
  313. <div class="group-controls">
  314. <label class="checkbox" for="keep_labels">
  315. <input type="checkbox" name="keep_labels" id="keep_labels" value="1"<?= $archiving['keep_labels'] ? ' checked="checked"' : '' ?>
  316. data-leave-validation="<?= $archiving['keep_labels'] ? 1 : 0 ?>"/>
  317. <?= _t('conf.archiving.keep_labels') ?>
  318. </label>
  319. </div>
  320. </div>
  321. <div class="form-group archiving"<?= $archiving['default'] ? ' hidden="hidden"' : '' ?>>
  322. <div class="group-controls">
  323. <label class="checkbox" for="keep_unreads">
  324. <input type="checkbox" name="keep_unreads" id="keep_unreads" value="1"<?= $archiving['keep_unreads'] ? ' checked="checked"' : '' ?>
  325. data-leave-validation="<?= $archiving['keep_unreads'] ?>"/>
  326. <?= _t('conf.archiving.keep_unreads') ?>
  327. </label>
  328. </div>
  329. </div>
  330. <div class="form-group archiving"<?= $archiving['default'] ? ' hidden="hidden"' : '' ?>>
  331. <div class="group-controls">
  332. <label for="keep_min"><?= _t('sub.feed.keep_min') ?>
  333. <input type="number" id="keep_min" name="keep_min" min="0" value="<?= $archiving['keep_min'] ?>"
  334. data-leave-validation="<?= $archiving['keep_min'] ?>">
  335. </label>
  336. </div>
  337. </div>
  338. <div class="form-group form-actions">
  339. <div class="group-controls">
  340. <button class="btn btn-important"><?= _t('gen.action.submit') ?></button>
  341. <button type="reset" class="btn"><?= _t('gen.action.cancel') ?></button>
  342. <button class="btn btn-attention confirm" formmethod="post" formaction="<?= _url('feed', 'truncate', 'id', $this->feed->id()) ?>"><?= _t('gen.action.truncate') ?></button>
  343. </div>
  344. </div>
  345. <legend><?= _t('sub.feed.advanced') ?></legend>
  346. <div class="form-group">
  347. <label class="group-name" for="path_entries"><?= _t('sub.feed.css_path') ?></label>
  348. <div class="group-controls">
  349. <div class="stick">
  350. <input type="text" name="path_entries" id="path_entries" class="extend" value="<?= $this->feed->pathEntries() ?>"
  351. placeholder="<?= _t('gen.short.blank_to_disable') ?>" />
  352. <a id="popup-preview-selector" class="btn" href="<?=
  353. _url('feed', 'contentSelectorPreview', 'id', $this->feed->id(), 'selector', 'selector-token') ?>"><?= _i('look') ?></a>
  354. </div>
  355. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.css_help') ?></p>
  356. </div>
  357. </div>
  358. <div class="form-group">
  359. <label class="group-name" for="path_entries"><?= _t('sub.feed.css_cookie') ?></label>
  360. <div class="group-controls">
  361. <div class="stick">
  362. <input type="text" name="curl_params_cookie" id="curl_params_cookie" class="extend" value="<?=
  363. is_array($this->feed->attributes('curl_params')) && !empty($this->feed->attributes('curl_params')[CURLOPT_COOKIE]) ?
  364. $this->feed->attributes('curl_params')[CURLOPT_COOKIE] : ''
  365. ?>" placeholder="<?= _t('gen.short.blank_to_disable') ?>" />
  366. </div>
  367. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.css_cookie_help') ?></p>
  368. </div>
  369. </div>
  370. <div class="form-group">
  371. <label class="group-name" for="content_action"><?= _t('sub.feed.content_action') ?></label>
  372. <div class="group-controls">
  373. <select name="content_action" id="content_action">
  374. <option value="replace"<?= 'replace' === $this->feed->attributes('content_action') ? ' selected="selected"' : '' ?>><?= _t('sub.feed.content_action.replace') ?></option>
  375. <option value="prepend"<?= 'prepend' === $this->feed->attributes('content_action') ? ' selected="selected"' : '' ?>><?= _t('sub.feed.content_action.prepend') ?></option>
  376. <option value="append"<?= 'append' === $this->feed->attributes('content_action') ? ' selected="selected"' : '' ?>><?= _t('sub.feed.content_action.append') ?></option>
  377. </select>
  378. </div>
  379. </div>
  380. <div class="form-group">
  381. <label class="group-name" for="curl_params_useragent"><?= _t('sub.feed.useragent') ?></label>
  382. <div class="group-controls">
  383. <div class="stick">
  384. <input type="text" name="curl_params_useragent" id="curl_params_useragent" class="extend" value="<?=
  385. is_array($this->feed->attributes('curl_params')) && !empty($this->feed->attributes('curl_params')[CURLOPT_USERAGENT]) ?
  386. $this->feed->attributes('curl_params')[CURLOPT_USERAGENT] : ''
  387. ?>" placeholder="<?= _t('gen.short.blank_to_disable') ?>" />
  388. </div>
  389. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.useragent_help') ?></p>
  390. </div>
  391. </div>
  392. <div class="form-group">
  393. <label class="group-name" for="proxy_type"><?= _t('sub.feed.proxy') ?></label>
  394. <div class="group-controls">
  395. <select class="number" name="proxy_type" id="proxy_type"><?php
  396. $type = '';
  397. if (is_array($this->feed->attributes('curl_params')) && isset($this->feed->attributes('curl_params')[CURLOPT_PROXYTYPE])) {
  398. $type = $this->feed->attributes('curl_params')[CURLOPT_PROXYTYPE];
  399. }
  400. foreach(['' => '', 3 => 'NONE', 0 => 'HTTP', 2 => 'HTTPS', 4 => 'SOCKS4', 6 => 'SOCKS4A', 5 => 'SOCKS5', 7 => 'SOCKS5H'] as $k => $v) {
  401. echo '<option value="' . $k . ($type === $k ? '" selected="selected' : '' ) . '">' . $v . '</option>';
  402. }
  403. ?>
  404. </select>
  405. <div class="stick">
  406. <input type="text" name="curl_params" id="curl_params" class="extend" value="<?=
  407. is_array($this->feed->attributes('curl_params')) && !empty($this->feed->attributes('curl_params')[CURLOPT_PROXY]) ?
  408. $this->feed->attributes('curl_params')[CURLOPT_PROXY] : ''
  409. ?>" placeholder="<?= _t('gen.short.blank_to_disable') ?>" />
  410. </div>
  411. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.proxy_help') ?></p>
  412. </div>
  413. </div>
  414. <div class="form-group">
  415. <label class="group-name" for="timeout"><?= _t('sub.feed.timeout') ?></label>
  416. <div class="group-controls">
  417. <input type="number" name="timeout" id="timeout" min="3" max="120" value="<?= $this->feed->attributes('timeout') ?>" placeholder="<?= _t('gen.short.by_default') ?>" />
  418. </div>
  419. </div>
  420. <div class="form-group">
  421. <label class="group-name" for="ssl_verify"><?= _t('sub.feed.ssl_verify') ?></label>
  422. <div class="group-controls">
  423. <label class="checkbox" for="ssl_verify">
  424. <select name="ssl_verify" id="ssl_verify">
  425. <option value=""<?= $this->feed->attributes('ssl_verify') === null ? ' selected="selected"' : '' ?>><?= _t('gen.short.by_default') ?></option>
  426. <option value="0"<?= $this->feed->attributes('ssl_verify') === false ? ' selected="selected"' : '' ?>><?= _t('gen.short.no') ?></option>
  427. <option value="1"<?= $this->feed->attributes('ssl_verify') === true ? ' selected="selected"' : '' ?>><?= _t('gen.short.yes') ?></option>
  428. </select>
  429. </label>
  430. </div>
  431. </div>
  432. <div class="form-group">
  433. <div class="group-controls">
  434. <label class="checkbox" for="clear_cache">
  435. <input type="checkbox" name="clear_cache" id="clear_cache" value="1"<?= $this->feed->attributes('clear_cache') ? ' checked="checked"' : '' ?> />
  436. <?= _t('sub.feed.clear_cache') ?>
  437. </label>
  438. </div>
  439. </div>
  440. <div class="form-group form-actions">
  441. <div class="group-controls">
  442. <button class="btn btn-important"><?= _t('gen.action.submit') ?></button>
  443. <button type="reset" class="btn"><?= _t('gen.action.cancel') ?></button>
  444. </div>
  445. </div>
  446. <legend><?= _t('sub.feed.maintenance.title') ?></legend>
  447. <div class="form-group">
  448. <div class="group-controls">
  449. <a class="btn btn-important" href="<?= _url('feed', 'clearCache', 'id', $this->feed->id()) ?>">
  450. <?= _t('sub.feed.maintenance.clear_cache') ?>
  451. </a>
  452. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.maintenance.clear_cache_help') ?></p>
  453. </div>
  454. <div class="group-controls">
  455. <a class="btn btn-important" href="<?= _url('feed', 'reload', 'id', $this->feed->id()) ?>">
  456. <?= _t('sub.feed.maintenance.reload_articles') ?>
  457. </a>
  458. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.maintenance.reload_articles_help') ?></p>
  459. </div>
  460. </div>
  461. </form>
  462. </div>