diff options
| author | 2014-10-01 11:58:08 +0200 | |
|---|---|---|
| committer | 2014-10-01 11:58:08 +0200 | |
| commit | 89c407d7d7f739e42d9e72e40304bbbef00c9b10 (patch) | |
| tree | dd860593609d0659b68576d3e8324a1326144adc | |
| parent | 1eef7893068655f8d145a3e06061a9e6296ac1f3 (diff) | |
Add selected feed on main subscription page
- When an id is given, corresponding feed is displayed
- Refactor code
- Improve coding style
See https://github.com/marienfressinaud/FreshRSS/issues/646
| -rw-r--r-- | app/Controllers/subscriptionController.php | 116 | ||||
| -rw-r--r-- | app/views/helpers/feed/update.phtml | 175 | ||||
| -rw-r--r-- | app/views/subscription/feed.phtml | 191 | ||||
| -rw-r--r-- | app/views/subscription/index.phtml | 5 |
4 files changed, 242 insertions, 245 deletions
diff --git a/app/Controllers/subscriptionController.php b/app/Controllers/subscriptionController.php index ab00f3e6a..83f803edb 100644 --- a/app/Controllers/subscriptionController.php +++ b/app/Controllers/subscriptionController.php @@ -16,6 +16,11 @@ class FreshRSS_subscription_Controller extends Minz_ActionController { array('error' => array(_t('access_denied'))) ); } + + $catDAO = new FreshRSS_CategoryDAO(); + + $this->view->categories = $catDAO->listCategories(false); + $this->view->default_category = $catDAO->getDefault(); } /** @@ -24,12 +29,13 @@ class FreshRSS_subscription_Controller extends Minz_ActionController { * It displays categories and associated feeds. */ public function indexAction() { - $catDAO = new FreshRSS_CategoryDAO(); - - $this->view->categories = $catDAO->listCategories(false); - $this->view->default_category = $catDAO->getDefault(); - Minz_View::prependTitle(_t('subscription_management') . ' · '); + + $id = Minz_Request::param('id'); + if ($id !== false) { + $feedDAO = FreshRSS_Factory::createFeedDao(); + $this->view->feed = $feedDAO->searchById($id); + } } /** @@ -57,74 +63,56 @@ class FreshRSS_subscription_Controller extends Minz_ActionController { $this->view->_useLayout(false); } - $catDAO = new FreshRSS_CategoryDAO(); - $this->view->categories = $catDAO->listCategories(false); - $feedDAO = FreshRSS_Factory::createFeedDao(); $this->view->feeds = $feedDAO->listFeeds(); $id = Minz_Request::param('id'); - if ($id == false && !empty($this->view->feeds)) { - $id = current($this->view->feeds)->id(); + if ($id === false || !isset($this->view->feeds[$id])) { + Minz_Error::error( + 404, + array('error' => array(_t('page_not_found'))) + ); + return; } - $this->view->flux = false; - if ($id != false) { - $this->view->flux = $this->view->feeds[$id]; + $this->view->feed = $this->view->feeds[$id]; + + Minz_View::prependTitle(_t('rss_feed_management') . ' · ' . $this->view->feed->name() . ' · '); + + if (Minz_Request::isPost()) { + $user = Minz_Request::param('http_user', ''); + $pass = Minz_Request::param('http_pass', ''); + + $httpAuth = ''; + if ($user != '' || $pass != '') { + $httpAuth = $user . ':' . $pass; + } + + $cat = intval(Minz_Request::param('category', 0)); + + $values = array( + 'name' => Minz_Request::param('name', ''), + 'description' => sanitizeHTML(Minz_Request::param('description', '', true)), + 'website' => Minz_Request::param('website', ''), + 'url' => Minz_Request::param('url', ''), + 'category' => $cat, + 'pathEntries' => Minz_Request::param('path_entries', ''), + 'priority' => intval(Minz_Request::param('priority', 0)), + 'httpAuth' => $httpAuth, + 'keep_history' => intval(Minz_Request::param('keep_history', -2)), + 'ttl' => intval(Minz_Request::param('ttl', -2)), + ); + + invalidateHttpCache(); + + if ($feedDAO->updateFeed($id, $values)) { + $this->view->feed->_category($cat); + $this->view->feed->faviconPrepare(); - if (!$this->view->flux) { - Minz_Error::error( - 404, - array('error' => array(_t('page_not_found'))) - ); + Minz_Request::good(_t('feed_updated'), array('c' => 'subscription', 'params' => array('id' => $id))); } else { - if (Minz_Request::isPost() && $this->view->flux) { - $user = Minz_Request::param('http_user', ''); - $pass = Minz_Request::param('http_pass', ''); - - $httpAuth = ''; - if ($user != '' || $pass != '') { - $httpAuth = $user . ':' . $pass; - } - - $cat = intval(Minz_Request::param('category', 0)); - - $values = array( - 'name' => Minz_Request::param('name', ''), - 'description' => sanitizeHTML(Minz_Request::param('description', '', true)), - 'website' => Minz_Request::param('website', ''), - 'url' => Minz_Request::param('url', ''), - 'category' => $cat, - 'pathEntries' => Minz_Request::param('path_entries', ''), - 'priority' => intval(Minz_Request::param('priority', 0)), - 'httpAuth' => $httpAuth, - 'keep_history' => intval(Minz_Request::param('keep_history', -2)), - 'ttl' => intval(Minz_Request::param('ttl', -2)), - ); - - if ($feedDAO->updateFeed($id, $values)) { - $this->view->flux->_category($cat); - $this->view->flux->faviconPrepare(); - $notif = array( - 'type' => 'good', - 'content' => _t('feed_updated') - ); - } else { - $notif = array( - 'type' => 'bad', - 'content' => _t('error_occurred_update') - ); - } - invalidateHttpCache(); - - Minz_Session::_param('notification', $notif); - Minz_Request::forward(array('c' => 'subscription'), true); - } - - Minz_View::prependTitle(_t('rss_feed_management') . ' · ' . $this->view->flux->name() . ' · '); + Minz_Request::bad(_t('error_occurred_update'), array('c' => 'subscription')); } - } else { - Minz_View::prependTitle(_t('rss_feed_management') . ' · '); } } } diff --git a/app/views/helpers/feed/update.phtml b/app/views/helpers/feed/update.phtml new file mode 100644 index 000000000..4a6425c45 --- /dev/null +++ b/app/views/helpers/feed/update.phtml @@ -0,0 +1,175 @@ +<div class="post"> + <!-- <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> --> + + <h1><?php echo $this->feed->name (); ?></h1> + <?php echo $this->feed->description (); ?> + + <?php $nbEntries = $this->feed->nbEntries (); ?> + + <?php if ($this->feed->inError ()) { ?> + <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> + <?php } elseif ($nbEntries === 0) { ?> + <p class="alert alert-warn"><?php echo Minz_Translate::t ('feed_empty'); ?></p> + <?php } ?> + + <form method="post" action="<?php echo _url ('subscription', 'feed', 'id', $this->feed->id ()); ?>" autocomplete="off"> + <legend><?php echo Minz_Translate::t ('informations'); ?></legend> + <div class="form-group"> + <label class="group-name" for="name"><?php echo Minz_Translate::t ('title'); ?></label> + <div class="group-controls"> + <input type="text" name="name" id="name" class="extend" value="<?php echo $this->feed->name () ; ?>" /> + </div> + </div> + <div class="form-group"> + <label class="group-name" for="description"><?php echo Minz_Translate::t ('feed_description'); ?></label> + <div class="group-controls"> + <textarea name="description" id="description"><?php echo htmlspecialchars($this->feed->description(), ENT_NOQUOTES, 'UTF-8'); ?></textarea> + </div> + </div> + <div class="form-group"> + <label class="group-name" for="website"><?php echo Minz_Translate::t ('website_url'); ?></label> + <div class="group-controls"> + <div class="stick"> + <input type="text" name="website" id="website" class="extend" value="<?php echo $this->feed->website (); ?>" /> + <a class="btn" target="_blank" href="<?php echo $this->feed->website (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a> + </div> + </div> + </div> + <div class="form-group"> + <label class="group-name" for="url"><?php echo Minz_Translate::t ('feed_url'); ?></label> + <div class="group-controls"> + <div class="stick"> + <input type="text" name="url" id="url" class="extend" value="<?php echo $this->feed->url (); ?>" /> + <a class="btn" target="_blank" href="<?php echo $this->feed->url (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a> + </div> + + <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> + </div> + </div> + <div class="form-group"> + <label class="group-name" for="category"><?php echo Minz_Translate::t ('category'); ?></label> + <div class="group-controls"> + <select name="category" id="category"> + <?php foreach ($this->categories as $cat) { ?> + <option value="<?php echo $cat->id (); ?>"<?php echo $cat->id ()== $this->feed->category () ? ' selected="selected"' : ''; ?>> + <?php echo $cat->name (); ?> + </option> + <?php } ?> + </select> + </div> + </div> + <div class="form-group"> + <label class="group-name" for="priority"><?php echo Minz_Translate::t ('show_in_all_flux'); ?></label> + <div class="group-controls"> + <label class="checkbox" for="priority"> + <input type="checkbox" name="priority" id="priority" value="10"<?php echo $this->feed->priority () > 0 ? ' checked="checked"' : ''; ?> /> + <?php echo Minz_Translate::t ('yes'); ?> + </label> + </div> + </div> + <div class="form-group"> + <div class="group-controls"> + <a href="<?php echo _url('stats', 'repartition', 'id', $this->feed->id()); ?>"> + <?php echo _i('stats'); ?> <?php echo _t('stats'); ?> + </a> + </div> + </div> + <div class="form-group form-actions"> + <div class="group-controls"> + <button class="btn btn-important"><?php echo _t('save'); ?></button> + <button class="btn btn-attention confirm" + data-str-confirm="<?php echo _t('confirm_action_feed_cat'); ?>" + formaction="<?php echo _url('feed', 'delete', 'id', $this->feed->id ()); ?>" + formmethod="post"><?php echo _t('delete'); ?></button> + </div> + </div> + + <legend><?php echo Minz_Translate::t ('archiving_configuration'); ?></legend> + + <div class="form-group"> + <div class="group-controls"> + <div class="stick"> + <input type="text" value="<?php echo _t('number_articles', $nbEntries); ?>" disabled="disabled" /> + <a class="btn" href="<?php echo _url('feed', 'actualize', 'id', $this->feed->id ()); ?>"> + <?php echo _i('refresh'); ?> <?php echo _t('actualize'); ?> + </a> + </div> + </div> + </div> + <div class="form-group"> + <label class="group-name" for="keep_history"><?php echo Minz_Translate::t ('keep_history'); ?></label> + <div class="group-controls"> + <select class="number" name="keep_history" id="keep_history" required="required"><?php + 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) { + echo '<option value="' . $v . ($this->feed->keepHistory() === $v ? '" selected="selected' : '') . '">' . $t . '</option>'; + } + ?></select> + </div> + </div> + <div class="form-group"> + <label class="group-name" for="ttl"><?php echo Minz_Translate::t('ttl'); ?></label> + <div class="group-controls"> + <select class="number" name="ttl" id="ttl" required="required"><?php + $found = false; + foreach (array(-2 => Minz_Translate::t('by_default'), 900 => '15min', 1200 => '20min', 1500 => '25min', 1800 => '30min', 2700 => '45min', + 3600 => '1h', 5400 => '1.5h', 7200 => '2h', 10800 => '3h', 14400 => '4h', 18800 => '5h', 21600 => '6h', 25200 => '7h', 28800 => '8h', + 36000 => '10h', 43200 => '12h', 64800 => '18h', + 86400 => '1d', 129600 => '1.5d', 172800 => '2d', 259200 => '3d', 345600 => '4d', 432000 => '5d', 518400 => '6d', + 604800 => '1wk', 1209600 => '2wk', 1814400 => '3wk', 2419200 => '4wk', 2629744 => '1mo', -1 => '∞') as $v => $t) { + echo '<option value="' . $v . ($this->feed->ttl() === $v ? '" selected="selected' : '') . '">' . $t . '</option>'; + if ($this->feed->ttl() == $v) { + $found = true; + } + } + if (!$found) { + echo '<option value="' . intval($this->feed->ttl()) . '" selected="selected">' . intval($this->feed->ttl()) . 's</option>'; + } + ?></select> + </div> + </div> + <div class="form-group form-actions"> + <div class="group-controls"> + <button class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button> + <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> + </div> + </div> + + <legend><?php echo Minz_Translate::t ('login_configuration'); ?></legend> + <?php $auth = $this->feed->httpAuth (false); ?> + <div class="form-group"> + <label class="group-name" for="http_user"><?php echo Minz_Translate::t ('http_username'); ?></label> + <div class="group-controls"> + <input type="text" name="http_user" id="http_user" class="extend" value="<?php echo $auth['username']; ?>" autocomplete="off" /> + <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t ('access_protected_feeds'); ?> + </div> + + <label class="group-name" for="http_pass"><?php echo Minz_Translate::t ('http_password'); ?></label> + <div class="group-controls"> + <input type="password" name="http_pass" id="http_pass" class="extend" value="<?php echo $auth['password']; ?>" autocomplete="off" /> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button> + <button type="reset" class="btn"><?php echo Minz_Translate::t ('cancel'); ?></button> + </div> + </div> + + <legend><?php echo Minz_Translate::t ('advanced'); ?></legend> + <div class="form-group"> + <label class="group-name" for="path_entries"><?php echo Minz_Translate::t ('css_path_on_website'); ?></label> + <div class="group-controls"> + <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'); ?>" /> + <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t ('retrieve_truncated_feeds'); ?> + </div> + </div> + + <div class="form-group form-actions"> + <div class="group-controls"> + <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button> + <button type="reset" class="btn"><?php echo Minz_Translate::t ('cancel'); ?></button> + </div> + </div> + </form> +</div> diff --git a/app/views/subscription/feed.phtml b/app/views/subscription/feed.phtml index e047741a1..48a401c4a 100644 --- a/app/views/subscription/feed.phtml +++ b/app/views/subscription/feed.phtml @@ -1,186 +1,15 @@ <?php - if (!Minz_Request::param('ajax')) { - $this->partial('aside_subscription'); - } -?> - -<?php if ($this->flux) { ?> -<div class="post"> - <!-- <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> --> - - <h1><?php echo $this->flux->name (); ?></h1> - <?php echo $this->flux->description (); ?> - - <?php $nbEntries = $this->flux->nbEntries (); ?> - - <?php if ($this->flux->inError ()) { ?> - <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> - <?php } elseif ($nbEntries === 0) { ?> - <p class="alert alert-warn"><?php echo Minz_Translate::t ('feed_empty'); ?></p> - <?php } ?> - - <form method="post" action="<?php echo _url ('subscription', 'feed', 'id', $this->flux->id ()); ?>" autocomplete="off"> - <legend><?php echo Minz_Translate::t ('informations'); ?></legend> - <div class="form-group"> - <label class="group-name" for="name"><?php echo Minz_Translate::t ('title'); ?></label> - <div class="group-controls"> - <input type="text" name="name" id="name" class="extend" value="<?php echo $this->flux->name () ; ?>" /> - </div> - </div> - <div class="form-group"> - <label class="group-name" for="description"><?php echo Minz_Translate::t ('feed_description'); ?></label> - <div class="group-controls"> - <textarea name="description" id="description"><?php echo htmlspecialchars($this->flux->description(), ENT_NOQUOTES, 'UTF-8'); ?></textarea> - </div> - </div> - <div class="form-group"> - <label class="group-name" for="website"><?php echo Minz_Translate::t ('website_url'); ?></label> - <div class="group-controls"> - <div class="stick"> - <input type="text" name="website" id="website" class="extend" value="<?php echo $this->flux->website (); ?>" /> - <a class="btn" target="_blank" href="<?php echo $this->flux->website (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a> - </div> - </div> - </div> - <div class="form-group"> - <label class="group-name" for="url"><?php echo Minz_Translate::t ('feed_url'); ?></label> - <div class="group-controls"> - <div class="stick"> - <input type="text" name="url" id="url" class="extend" value="<?php echo $this->flux->url (); ?>" /> - <a class="btn" target="_blank" href="<?php echo $this->flux->url (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a> - </div> - - <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> - </div> - </div> - <div class="form-group"> - <label class="group-name" for="category"><?php echo Minz_Translate::t ('category'); ?></label> - <div class="group-controls"> - <select name="category" id="category"> - <?php foreach ($this->categories as $cat) { ?> - <option value="<?php echo $cat->id (); ?>"<?php echo $cat->id ()== $this->flux->category () ? ' selected="selected"' : ''; ?>> - <?php echo $cat->name (); ?> - </option> - <?php } ?> - </select> - </div> - </div> - <div class="form-group"> - <label class="group-name" for="priority"><?php echo Minz_Translate::t ('show_in_all_flux'); ?></label> - <div class="group-controls"> - <label class="checkbox" for="priority"> - <input type="checkbox" name="priority" id="priority" value="10"<?php echo $this->flux->priority () > 0 ? ' checked="checked"' : ''; ?> /> - <?php echo Minz_Translate::t ('yes'); ?> - </label> - </div> - </div> - <div class="form-group"> - <div class="group-controls"> - <a href="<?php echo _url('stats', 'repartition', 'id', $this->flux->id()); ?>"> - <?php echo _i('stats'); ?> <?php echo _t('stats'); ?> - </a> - </div> - </div> - <div class="form-group form-actions"> - <div class="group-controls"> - <button class="btn btn-important"><?php echo _t('save'); ?></button> - <button class="btn btn-attention confirm" - data-str-confirm="<?php echo _t('confirm_action_feed_cat'); ?>" - formaction="<?php echo _url('feed', 'delete', 'id', $this->flux->id ()); ?>" - formmethod="post"><?php echo _t('delete'); ?></button> - </div> - </div> - <legend><?php echo Minz_Translate::t ('archiving_configuration'); ?></legend> +if (!Minz_Request::param('ajax')) { + $this->partial('aside_subscription'); +} - <div class="form-group"> - <div class="group-controls"> - <div class="stick"> - <input type="text" value="<?php echo _t('number_articles', $nbEntries); ?>" disabled="disabled" /> - <a class="btn" href="<?php echo _url('feed', 'actualize', 'id', $this->flux->id ()); ?>"> - <?php echo _i('refresh'); ?> <?php echo _t('actualize'); ?> - </a> - </div> - </div> - </div> - <div class="form-group"> - <label class="group-name" for="keep_history"><?php echo Minz_Translate::t ('keep_history'); ?></label> - <div class="group-controls"> - <select class="number" name="keep_history" id="keep_history" required="required"><?php - 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) { - echo '<option value="' . $v . ($this->flux->keepHistory() === $v ? '" selected="selected' : '') . '">' . $t . '</option>'; - } - ?></select> - </div> - </div> - <div class="form-group"> - <label class="group-name" for="ttl"><?php echo Minz_Translate::t('ttl'); ?></label> - <div class="group-controls"> - <select class="number" name="ttl" id="ttl" required="required"><?php - $found = false; - foreach (array(-2 => Minz_Translate::t('by_default'), 900 => '15min', 1200 => '20min', 1500 => '25min', 1800 => '30min', 2700 => '45min', - 3600 => '1h', 5400 => '1.5h', 7200 => '2h', 10800 => '3h', 14400 => '4h', 18800 => '5h', 21600 => '6h', 25200 => '7h', 28800 => '8h', - 36000 => '10h', 43200 => '12h', 64800 => '18h', - 86400 => '1d', 129600 => '1.5d', 172800 => '2d', 259200 => '3d', 345600 => '4d', 432000 => '5d', 518400 => '6d', - 604800 => '1wk', 1209600 => '2wk', 1814400 => '3wk', 2419200 => '4wk', 2629744 => '1mo', -1 => '∞') as $v => $t) { - echo '<option value="' . $v . ($this->flux->ttl() === $v ? '" selected="selected' : '') . '">' . $t . '</option>'; - if ($this->flux->ttl() == $v) { - $found = true; - } - } - if (!$found) { - echo '<option value="' . intval($this->flux->ttl()) . '" selected="selected">' . intval($this->flux->ttl()) . 's</option>'; - } - ?></select> - </div> - </div> - <div class="form-group form-actions"> - <div class="group-controls"> - <button class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button> - <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> - </div> - </div> - - <legend><?php echo Minz_Translate::t ('login_configuration'); ?></legend> - <?php $auth = $this->flux->httpAuth (false); ?> - <div class="form-group"> - <label class="group-name" for="http_user"><?php echo Minz_Translate::t ('http_username'); ?></label> - <div class="group-controls"> - <input type="text" name="http_user" id="http_user" class="extend" value="<?php echo $auth['username']; ?>" autocomplete="off" /> - <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t ('access_protected_feeds'); ?> - </div> - - <label class="group-name" for="http_pass"><?php echo Minz_Translate::t ('http_password'); ?></label> - <div class="group-controls"> - <input type="password" name="http_pass" id="http_pass" class="extend" value="<?php echo $auth['password']; ?>" autocomplete="off" /> - </div> - </div> - - <div class="form-group form-actions"> - <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button> - <button type="reset" class="btn"><?php echo Minz_Translate::t ('cancel'); ?></button> - </div> - </div> - - <legend><?php echo Minz_Translate::t ('advanced'); ?></legend> - <div class="form-group"> - <label class="group-name" for="path_entries"><?php echo Minz_Translate::t ('css_path_on_website'); ?></label> - <div class="group-controls"> - <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'); ?>" /> - <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t ('retrieve_truncated_feeds'); ?> - </div> - </div> - - <div class="form-group form-actions"> - <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button> - <button type="reset" class="btn"><?php echo Minz_Translate::t ('cancel'); ?></button> - </div> - </div> - </form> +if ($this->feed) { + $this->renderHelper('feed/update'); +} else { +?> +<div class="alert alert-warn"> + <span class="alert-head"><?php echo _t('no_selected_feed'); ?></span> + <?php echo _t('think_to_add'); ?> </div> - -<?php } else { ?> -<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> <?php } ?> diff --git a/app/views/subscription/index.phtml b/app/views/subscription/index.phtml index 444dc9d9b..bce9eacf1 100644 --- a/app/views/subscription/index.phtml +++ b/app/views/subscription/index.phtml @@ -129,4 +129,9 @@ </div> <div id="slider"> +<?php + if (isset($this->feed) && $this->feed) { + $this->renderHelper('feed/update'); + } +?> </div> |
