update.phtml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. <div class="post">
  2. <h1><?php echo $this->feed->name(); ?></h1>
  3. <div>
  4. <a href="<?php echo _url('index', 'index', 'get', 'f_' . $this->feed->id()); ?>"><?php echo _i('link'); ?> <?php echo _t('gen.action.filter'); ?></a>
  5. <?php echo _t('gen.short.or'); ?>
  6. <a href="<?php echo _url('stats', 'repartition', 'id', $this->feed->id()); ?>"><?php echo _i('stats'); ?> <?php echo _t('sub.feed.stats'); ?></a>
  7. </div>
  8. <p><?php echo $this->feed->description(); ?></p>
  9. <?php $nbEntries = $this->feed->nbEntries(); ?>
  10. <?php if ($this->feed->inError()) { ?>
  11. <p class="alert alert-error"><span class="alert-head"><?php echo _t('gen.short.damn'); ?></span> <?php echo _t('sub.feed.error'); ?></p>
  12. <?php } elseif ($nbEntries === 0) { ?>
  13. <p class="alert alert-warn"><?php echo _t('sub.feed.empty'); ?></p>
  14. <?php } ?>
  15. <form method="post" action="<?php echo _url('subscription', 'feed', 'id', $this->feed->id()); ?>" autocomplete="off">
  16. <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" />
  17. <legend><?php echo _t('sub.feed.informations'); ?></legend>
  18. <div class="form-group">
  19. <label class="group-name" for="name"><?php echo _t('sub.feed.title'); ?></label>
  20. <div class="group-controls">
  21. <input type="text" name="name" id="name" class="extend" value="<?php echo $this->feed->name() ; ?>" />
  22. </div>
  23. </div>
  24. <div class="form-group">
  25. <label class="group-name" for="description"><?php echo _t('sub.feed.description'); ?></label>
  26. <div class="group-controls">
  27. <textarea name="description" id="description"><?php echo htmlspecialchars($this->feed->description(), ENT_NOQUOTES, 'UTF-8'); ?></textarea>
  28. </div>
  29. </div>
  30. <div class="form-group">
  31. <label class="group-name" for="website"><?php echo _t('sub.feed.website'); ?></label>
  32. <div class="group-controls">
  33. <div class="stick">
  34. <input type="text" name="website" id="website" class="extend" value="<?php echo $this->feed->website(); ?>" />
  35. <a class="btn" target="_blank" rel="noreferrer" href="<?php echo $this->feed->website(); ?>"><?php echo _i('link'); ?></a>
  36. </div>
  37. </div>
  38. </div>
  39. <div class="form-group">
  40. <label class="group-name" for="url"><?php echo _t('sub.feed.url'); ?></label>
  41. <div class="group-controls">
  42. <div class="stick">
  43. <input type="text" name="url" id="url" class="extend" value="<?php echo $this->feed->url(); ?>" />
  44. <a class="btn" target="_blank" rel="noreferrer" href="<?php echo $this->feed->url(); ?>"><?php echo _i('link'); ?></a>
  45. </div>
  46. <a class="btn" target="_blank" rel="noreferrer" href="http://validator.w3.org/feed/check.cgi?url=<?php echo rawurlencode(htmlspecialchars_decode($this->feed->url(), ENT_QUOTES)); ?>"><?php echo _t('sub.feed.validator'); ?></a>
  47. </div>
  48. </div>
  49. <div class="form-group">
  50. <label class="group-name" for="category"><?php echo _t('sub.category'); ?></label>
  51. <div class="group-controls">
  52. <select name="category" id="category">
  53. <?php foreach ($this->categories as $cat) { ?>
  54. <option value="<?php echo $cat->id(); ?>"<?php echo $cat->id()== $this->feed->category() ? ' selected="selected"' : ''; ?>>
  55. <?php echo $cat->name(); ?>
  56. </option>
  57. <?php } ?>
  58. </select>
  59. </div>
  60. </div>
  61. <div class="form-group">
  62. <label class="group-name" for="priority"><?php echo _t('sub.feed.priority'); ?></label>
  63. <div class="group-controls">
  64. <select name="priority" id="priority">
  65. <option value='<?php echo FreshRSS_Feed::PRIORITY_MAIN_STREAM;?>' <?php if (FreshRSS_Feed::PRIORITY_MAIN_STREAM === $this->feed->priority()) {echo 'selected="selected"';}?>><?php echo _t('sub.feed.priority.main_stream'); ?></option>
  66. <option value='<?php echo FreshRSS_Feed::PRIORITY_NORMAL;?>' <?php if (FreshRSS_Feed::PRIORITY_NORMAL === $this->feed->priority()) {echo 'selected="selected"';}?>><?php echo _t('sub.feed.priority.normal'); ?></option>
  67. <option value='<?php echo FreshRSS_Feed::PRIORITY_ARCHIVED;?>' <?php if (FreshRSS_Feed::PRIORITY_ARCHIVED === $this->feed->priority()) {echo 'selected="selected"';}?>><?php echo _t('sub.feed.priority.archived'); ?></option>
  68. </select>
  69. </div>
  70. </div>
  71. <div class="form-group form-actions">
  72. <div class="group-controls">
  73. <button class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button>
  74. <button class="btn btn-attention confirm"
  75. data-str-confirm="<?php echo _t('gen.js.confirm_action_feed_cat'); ?>"
  76. formaction="<?php echo _url('feed', 'delete', 'id', $this->feed->id()); ?>"
  77. formmethod="post"><?php echo _t('gen.action.remove'); ?></button>
  78. </div>
  79. </div>
  80. <legend><?php echo _t('sub.feed.archiving'); ?></legend>
  81. <div class="form-group">
  82. <div class="group-controls">
  83. <div class="stick">
  84. <input type="text" value="<?php echo _t('sub.feed.number_entries', $nbEntries); ?>" disabled="disabled" />
  85. <a class="btn" href="<?php echo _url('feed', 'actualize', 'id', $this->feed->id()); ?>">
  86. <?php echo _i('refresh'); ?> <?php echo _t('gen.action.actualize'); ?>
  87. </a>
  88. </div>
  89. </div>
  90. </div>
  91. <div class="form-group">
  92. <label class="group-name" for="keep_history"><?php echo _t('sub.feed.keep_history'); ?></label>
  93. <div class="group-controls">
  94. <select class="number" name="keep_history" id="keep_history" required="required"><?php
  95. foreach (array('' => '', FreshRSS_Feed::KEEP_HISTORY_DEFAULT => _t('gen.short.by_default'), 0 => '0', 10 => '10', 50 => '50', 100 => '100', 500 => '500', 1000 => '1 000', 5000 => '5 000', 10000 => '10 000', FreshRSS_Feed::KEEP_HISTORY_INFINITE => '∞') as $v => $t) {
  96. echo '<option value="' . $v . ($this->feed->keepHistory() === $v ? '" selected="selected' : '') . '">' . $t . '</option>';
  97. }
  98. ?></select>
  99. </div>
  100. </div>
  101. <div class="form-group">
  102. <label class="group-name" for="ttl"><?php echo _t('sub.feed.ttl'); ?></label>
  103. <div class="group-controls">
  104. <select class="number" name="ttl" id="ttl" required="required"><?php
  105. $found = false;
  106. foreach (array(FreshRSS_Feed::TTL_DEFAULT => _t('gen.short.by_default'), 900 => '15min', 1200 => '20min', 1500 => '25min', 1800 => '30min', 2700 => '45min',
  107. 3600 => '1h', 5400 => '1.5h', 7200 => '2h', 10800 => '3h', 14400 => '4h', 18800 => '5h', 21600 => '6h', 25200 => '7h', 28800 => '8h',
  108. 36000 => '10h', 43200 => '12h', 64800 => '18h',
  109. 86400 => '1d', 129600 => '1.5d', 172800 => '2d', 259200 => '3d', 345600 => '4d', 432000 => '5d', 518400 => '6d',
  110. 604800 => '1wk', 1209600 => '2wk', 1814400 => '3wk', 2419200 => '4wk', 2629744 => '1mo') as $v => $t) {
  111. echo '<option value="' . $v . ($this->feed->ttl() === $v ? '" selected="selected' : '') . '">' . $t . '</option>';
  112. if ($this->feed->ttl() == $v) {
  113. $found = true;
  114. }
  115. }
  116. if (!$found) {
  117. echo '<option value="' . intval($this->feed->ttl()) . '" selected="selected">' . intval($this->feed->ttl()) . 's</option>';
  118. }
  119. ?></select>
  120. <label for="mute">
  121. <input type="checkbox" name="mute" id="mute" value="1"<?php echo $this->feed->mute() ? ' checked="checked"' : ''; ?> />
  122. <?php echo _t('sub.feed.mute'); ?>
  123. </label>
  124. </div>
  125. </div>
  126. <div class="form-group">
  127. <label class="group-name" for="pubsubhubbub"><?php echo _t('sub.feed.websub'); ?></label>
  128. <div class="group-controls">
  129. <label class="checkbox" for="pubsubhubbub">
  130. <input type="checkbox" name="pubsubhubbub" id="pubsubhubbub" disabled="disabled" value="1"<?php echo $this->feed->pubSubHubbubEnabled() ? ' checked="checked"' : ''; ?> />
  131. </label>
  132. </div>
  133. </div>
  134. <div class="form-group form-actions">
  135. <div class="group-controls">
  136. <button class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button>
  137. <button class="btn btn-attention confirm" formmethod="post" formaction="<?php echo _url('feed', 'truncate', 'id', $this->feed->id()); ?>"><?php echo _t('gen.action.truncate'); ?></button>
  138. </div>
  139. </div>
  140. <legend><?php echo _t('sub.feed.auth.configuration'); ?></legend>
  141. <?php $auth = $this->feed->httpAuth(false); ?>
  142. <div class="form-group">
  143. <label class="group-name" for="http_user_feed<?php echo $this->feed->id(); ?>"><?php echo _t('sub.feed.auth.username'); ?></label>
  144. <div class="group-controls">
  145. <input type="text" name="http_user_feed<?php echo $this->feed->id(); ?>" id="http_user_feed<?php echo $this->feed->id(); ?>" class="extend" value="<?php echo empty($auth['username']) ? ' ' : $auth['username']; ?>" autocomplete="off" />
  146. <?php echo _i('help'); ?> <?php echo _t('sub.feed.auth.help'); ?>
  147. </div>
  148. <label class="group-name" for="http_pass_feed<?php echo $this->feed->id(); ?>"><?php echo _t('sub.feed.auth.password'); ?></label>
  149. <div class="group-controls">
  150. <input type="password" name="http_pass_feed<?php echo $this->feed->id(); ?>" id="http_pass_feed<?php echo $this->feed->id(); ?>" class="extend" value="<?php echo $auth['password']; ?>" autocomplete="new-password" />
  151. </div>
  152. </div>
  153. <div class="form-group form-actions">
  154. <div class="group-controls">
  155. <button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button>
  156. <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button>
  157. </div>
  158. </div>
  159. <legend><?php echo _t('sub.feed.advanced'); ?></legend>
  160. <div class="form-group">
  161. <label class="group-name" for="path_entries"><?php echo _t('sub.feed.css_path'); ?></label>
  162. <div class="group-controls">
  163. <input type="text" name="path_entries" id="path_entries" class="extend" value="<?php echo $this->feed->pathEntries(); ?>" placeholder="<?php echo _t('gen.short.blank_to_disable'); ?>" />
  164. <?php echo _i('help'); ?> <?php echo _t('sub.feed.css_help'); ?>
  165. </div>
  166. </div>
  167. <div class="form-group">
  168. <label class="group-name" for="mark_updated_article_unread"><?php echo _t('conf.reading.mark_updated_article_unread'); ?></label>
  169. <div class="group-controls">
  170. <label class="checkbox" for="mark_updated_article_unread">
  171. <select name="mark_updated_article_unread" id="mark_updated_article_unread">
  172. <option value=""<?php echo $this->feed->attributes('mark_updated_article_unread') === null ? ' selected="selected"' : ''; ?>><?php echo _t('gen.short.by_default'); ?></option>
  173. <option value="0"<?php echo $this->feed->attributes('mark_updated_article_unread') === false ? ' selected="selected"' : ''; ?>><?php echo _t('gen.short.no'); ?></option>
  174. <option value="1"<?php echo $this->feed->attributes('mark_updated_article_unread') === true ? ' selected="selected"' : ''; ?>><?php echo _t('gen.short.yes'); ?></option>
  175. </select>
  176. </label>
  177. </div>
  178. </div>
  179. <div class="form-group">
  180. <label class="group-name" for="read_upon_reception"><?php echo _t('conf.reading.read.when'); ?></label>
  181. <div class="group-controls">
  182. <label class="checkbox" for="read_upon_reception">
  183. <select name="read_upon_reception" id="read_upon_reception">
  184. <option value=""<?php echo $this->feed->attributes('read_upon_reception') === null ? ' selected="selected"' : ''; ?>><?php echo _t('gen.short.by_default'); ?></option>
  185. <option value="0"<?php echo $this->feed->attributes('read_upon_reception') === false ? ' selected="selected"' : ''; ?>><?php echo _t('gen.short.no'); ?></option>
  186. <option value="1"<?php echo $this->feed->attributes('read_upon_reception') === true ? ' selected="selected"' : ''; ?>><?php echo _t('gen.short.yes'); ?></option>
  187. </select>
  188. <?php echo _t('conf.reading.read.upon_reception'); ?>
  189. </label>
  190. </div>
  191. </div>
  192. <div class="form-group">
  193. <label class="group-name" for="clear_cache"><?php echo _t('sub.feed.clear_cache'); ?></label>
  194. <div class="group-controls">
  195. <input type="checkbox" name="clear_cache" id="clear_cache" value="1"<?php echo $this->feed->attributes('clear_cache') ? ' checked="checked"' : ''; ?> />
  196. </div>
  197. </div>
  198. <?php if (FreshRSS_Auth::hasAccess('admin')) { ?>
  199. <div class="form-group">
  200. <label class="group-name" for="timeout"><?php echo _t('sub.feed.timeout'); ?></label>
  201. <div class="group-controls">
  202. <input type="number" name="timeout" id="timeout" min="3" max="120" value="<?php echo $this->feed->attributes('timeout'); ?>" placeholder="<?php echo _t('gen.short.by_default'); ?>" />
  203. </div>
  204. </div>
  205. <div class="form-group">
  206. <label class="group-name" for="ssl_verify"><?php echo _t('sub.feed.ssl_verify'); ?></label>
  207. <div class="group-controls">
  208. <label class="checkbox" for="ssl_verify">
  209. <select name="ssl_verify" id="ssl_verify">
  210. <option value=""<?php echo $this->feed->attributes('ssl_verify') === null ? ' selected="selected"' : ''; ?>><?php echo _t('gen.short.by_default'); ?></option>
  211. <option value="0"<?php echo $this->feed->attributes('ssl_verify') === false ? ' selected="selected"' : ''; ?>><?php echo _t('gen.short.no'); ?></option>
  212. <option value="1"<?php echo $this->feed->attributes('ssl_verify') === true ? ' selected="selected"' : ''; ?>><?php echo _t('gen.short.yes'); ?></option>
  213. </select>
  214. </label>
  215. </div>
  216. </div>
  217. <?php } ?>
  218. <legend><?php echo _t('sub.feed.filteractions'); ?></legend>
  219. <div class="form-group">
  220. <label class="group-name" for="filteractions_read"><?php echo _t('conf.reading.read.when'); ?></label>
  221. <div class="group-controls">
  222. <textarea name="filteractions_read" id="filteractions_read"><?php
  223. foreach ($this->feed->filtersAction('read') as $filterRead) {
  224. echo htmlspecialchars($filterRead->getRawInput(), ENT_NOQUOTES, 'UTF-8'), "\n\n";
  225. }
  226. ?></textarea>
  227. <?php echo _i('help'); ?> <?php echo _t('sub.feed.filteractions.help'); ?>
  228. </div>
  229. </div>
  230. <div class="form-group form-actions">
  231. <div class="group-controls">
  232. <button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button>
  233. <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button>
  234. </div>
  235. </div>
  236. </form>
  237. </div>