update.phtml 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <div class="post">
  2. <!-- <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> <?php echo Minz_Translate::t ('or'); ?> <a href="<?php echo _url ('index', 'index', 'get', 'f_' . $this->feed->id ()); ?>"><?php echo Minz_Translate::t ('filter'); ?></a> -->
  3. <h1><?php echo $this->feed->name (); ?></h1>
  4. <?php echo $this->feed->description (); ?>
  5. <?php $nbEntries = $this->feed->nbEntries (); ?>
  6. <?php if ($this->feed->inError ()) { ?>
  7. <p class="alert alert-error"><span class="alert-head"><?php echo Minz_Translate::t ('damn'); ?></span> <?php echo Minz_Translate::t ('feed_in_error'); ?></p>
  8. <?php } elseif ($nbEntries === 0) { ?>
  9. <p class="alert alert-warn"><?php echo Minz_Translate::t ('feed_empty'); ?></p>
  10. <?php } ?>
  11. <form method="post" action="<?php echo _url ('subscription', 'feed', 'id', $this->feed->id ()); ?>" autocomplete="off">
  12. <legend><?php echo Minz_Translate::t ('informations'); ?></legend>
  13. <div class="form-group">
  14. <label class="group-name" for="name"><?php echo Minz_Translate::t ('title'); ?></label>
  15. <div class="group-controls">
  16. <input type="text" name="name" id="name" class="extend" value="<?php echo $this->feed->name () ; ?>" />
  17. </div>
  18. </div>
  19. <div class="form-group">
  20. <label class="group-name" for="description"><?php echo Minz_Translate::t ('feed_description'); ?></label>
  21. <div class="group-controls">
  22. <textarea name="description" id="description"><?php echo htmlspecialchars($this->feed->description(), ENT_NOQUOTES, 'UTF-8'); ?></textarea>
  23. </div>
  24. </div>
  25. <div class="form-group">
  26. <label class="group-name" for="website"><?php echo Minz_Translate::t ('website_url'); ?></label>
  27. <div class="group-controls">
  28. <div class="stick">
  29. <input type="text" name="website" id="website" class="extend" value="<?php echo $this->feed->website (); ?>" />
  30. <a class="btn" target="_blank" href="<?php echo $this->feed->website (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a>
  31. </div>
  32. </div>
  33. </div>
  34. <div class="form-group">
  35. <label class="group-name" for="url"><?php echo Minz_Translate::t ('feed_url'); ?></label>
  36. <div class="group-controls">
  37. <div class="stick">
  38. <input type="text" name="url" id="url" class="extend" value="<?php echo $this->feed->url (); ?>" />
  39. <a class="btn" target="_blank" href="<?php echo $this->feed->url (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a>
  40. </div>
  41. <a class="btn" target="_blank" href="http://validator.w3.org/feed/check.cgi?url=<?php echo $this->feed->url (); ?>"><?php echo Minz_Translate::t ('feed_validator'); ?></a>
  42. </div>
  43. </div>
  44. <div class="form-group">
  45. <label class="group-name" for="category"><?php echo Minz_Translate::t ('category'); ?></label>
  46. <div class="group-controls">
  47. <select name="category" id="category">
  48. <?php foreach ($this->categories as $cat) { ?>
  49. <option value="<?php echo $cat->id (); ?>"<?php echo $cat->id ()== $this->feed->category () ? ' selected="selected"' : ''; ?>>
  50. <?php echo $cat->name (); ?>
  51. </option>
  52. <?php } ?>
  53. </select>
  54. </div>
  55. </div>
  56. <div class="form-group">
  57. <label class="group-name" for="priority"><?php echo Minz_Translate::t ('show_in_all_flux'); ?></label>
  58. <div class="group-controls">
  59. <label class="checkbox" for="priority">
  60. <input type="checkbox" name="priority" id="priority" value="10"<?php echo $this->feed->priority () > 0 ? ' checked="checked"' : ''; ?> />
  61. <?php echo Minz_Translate::t ('yes'); ?>
  62. </label>
  63. </div>
  64. </div>
  65. <div class="form-group">
  66. <div class="group-controls">
  67. <a href="<?php echo _url('stats', 'repartition', 'id', $this->feed->id()); ?>">
  68. <?php echo _i('stats'); ?> <?php echo _t('stats'); ?>
  69. </a>
  70. </div>
  71. </div>
  72. <div class="form-group form-actions">
  73. <div class="group-controls">
  74. <button class="btn btn-important"><?php echo _t('save'); ?></button>
  75. <button class="btn btn-attention confirm"
  76. data-str-confirm="<?php echo _t('confirm_action_feed_cat'); ?>"
  77. formaction="<?php echo _url('feed', 'delete', 'id', $this->feed->id ()); ?>"
  78. formmethod="post"><?php echo _t('delete'); ?></button>
  79. </div>
  80. </div>
  81. <legend><?php echo Minz_Translate::t ('archiving_configuration'); ?></legend>
  82. <div class="form-group">
  83. <div class="group-controls">
  84. <div class="stick">
  85. <input type="text" value="<?php echo _t('number_articles', $nbEntries); ?>" disabled="disabled" />
  86. <a class="btn" href="<?php echo _url('feed', 'actualize', 'id', $this->feed->id ()); ?>">
  87. <?php echo _i('refresh'); ?> <?php echo _t('actualize'); ?>
  88. </a>
  89. </div>
  90. </div>
  91. </div>
  92. <div class="form-group">
  93. <label class="group-name" for="keep_history"><?php echo Minz_Translate::t ('keep_history'); ?></label>
  94. <div class="group-controls">
  95. <select class="number" name="keep_history" id="keep_history" required="required"><?php
  96. foreach (array('' => '', -2 => Minz_Translate::t('by_default'), 0 => '0', 10 => '10', 50 => '50', 100 => '100', 500 => '500', 1000 => '1 000', 5000 => '5 000', 10000 => '10 000', -1 => '∞') as $v => $t) {
  97. echo '<option value="' . $v . ($this->feed->keepHistory() === $v ? '" selected="selected' : '') . '">' . $t . '</option>';
  98. }
  99. ?></select>
  100. </div>
  101. </div>
  102. <div class="form-group">
  103. <label class="group-name" for="ttl"><?php echo Minz_Translate::t('ttl'); ?></label>
  104. <div class="group-controls">
  105. <select class="number" name="ttl" id="ttl" required="required"><?php
  106. $found = false;
  107. foreach (array(-2 => Minz_Translate::t('by_default'), 900 => '15min', 1200 => '20min', 1500 => '25min', 1800 => '30min', 2700 => '45min',
  108. 3600 => '1h', 5400 => '1.5h', 7200 => '2h', 10800 => '3h', 14400 => '4h', 18800 => '5h', 21600 => '6h', 25200 => '7h', 28800 => '8h',
  109. 36000 => '10h', 43200 => '12h', 64800 => '18h',
  110. 86400 => '1d', 129600 => '1.5d', 172800 => '2d', 259200 => '3d', 345600 => '4d', 432000 => '5d', 518400 => '6d',
  111. 604800 => '1wk', 1209600 => '2wk', 1814400 => '3wk', 2419200 => '4wk', 2629744 => '1mo', -1 => '∞') as $v => $t) {
  112. echo '<option value="' . $v . ($this->feed->ttl() === $v ? '" selected="selected' : '') . '">' . $t . '</option>';
  113. if ($this->feed->ttl() == $v) {
  114. $found = true;
  115. }
  116. }
  117. if (!$found) {
  118. echo '<option value="' . intval($this->feed->ttl()) . '" selected="selected">' . intval($this->feed->ttl()) . 's</option>';
  119. }
  120. ?></select>
  121. </div>
  122. </div>
  123. <div class="form-group form-actions">
  124. <div class="group-controls">
  125. <button class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button>
  126. <button class="btn btn-attention confirm" formmethod="post" formaction="<?php echo Minz_Url::display (array ('c' => 'feed', 'a' => 'truncate', 'params' => array ('id' => $this->feed->id ()))); ?>"><?php echo Minz_Translate::t ('truncate'); ?></button>
  127. </div>
  128. </div>
  129. <legend><?php echo Minz_Translate::t ('login_configuration'); ?></legend>
  130. <?php $auth = $this->feed->httpAuth (false); ?>
  131. <div class="form-group">
  132. <label class="group-name" for="http_user"><?php echo Minz_Translate::t ('http_username'); ?></label>
  133. <div class="group-controls">
  134. <input type="text" name="http_user" id="http_user" class="extend" value="<?php echo $auth['username']; ?>" autocomplete="off" />
  135. <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t ('access_protected_feeds'); ?>
  136. </div>
  137. <label class="group-name" for="http_pass"><?php echo Minz_Translate::t ('http_password'); ?></label>
  138. <div class="group-controls">
  139. <input type="password" name="http_pass" id="http_pass" class="extend" value="<?php echo $auth['password']; ?>" autocomplete="off" />
  140. </div>
  141. </div>
  142. <div class="form-group form-actions">
  143. <div class="group-controls">
  144. <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button>
  145. <button type="reset" class="btn"><?php echo Minz_Translate::t ('cancel'); ?></button>
  146. </div>
  147. </div>
  148. <legend><?php echo Minz_Translate::t ('advanced'); ?></legend>
  149. <div class="form-group">
  150. <label class="group-name" for="path_entries"><?php echo Minz_Translate::t ('css_path_on_website'); ?></label>
  151. <div class="group-controls">
  152. <input type="text" name="path_entries" id="path_entries" class="extend" value="<?php echo $this->feed->pathEntries (); ?>" placeholder="<?php echo Minz_Translate::t ('blank_to_disable'); ?>" />
  153. <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t ('retrieve_truncated_feeds'); ?>
  154. </div>
  155. </div>
  156. <div class="form-group form-actions">
  157. <div class="group-controls">
  158. <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button>
  159. <button type="reset" class="btn"><?php echo Minz_Translate::t ('cancel'); ?></button>
  160. </div>
  161. </div>
  162. </form>
  163. </div>