feed.phtml 9.1 KB

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