Ver Fonte

Refresh page after getting new articles.

Change the URL to the refresh link. Before it was redirecting to the home page.
Now it is redirecting to the same page, which make more sense.

See #457
Alexis Degrugillier há 12 anos atrás
pai
commit
f31747ee7b

+ 1 - 3
app/Controllers/indexController.php

@@ -25,16 +25,14 @@ class FreshRSS_index_Controller extends Minz_ActionController {
 			}
 			}
 		}
 		}
 
 
-		// construction of RSS url of this feed
 		$params = Minz_Request::params ();
 		$params = Minz_Request::params ();
-		$params['output'] = 'rss';
 		if (isset ($params['search'])) {
 		if (isset ($params['search'])) {
 			$params['search'] = urlencode ($params['search']);
 			$params['search'] = urlencode ($params['search']);
 		}
 		}
 		if (!Minz_Configuration::allowAnonymous()) {
 		if (!Minz_Configuration::allowAnonymous()) {
 			$params['token'] = $token;
 			$params['token'] = $token;
 		}
 		}
-		$this->view->rss_url = array (
+		$this->view->url = array (
 			'c' => 'index',
 			'c' => 'index',
 			'a' => 'index',
 			'a' => 'index',
 			'params' => $params
 			'params' => $params

+ 5 - 15
app/layout/nav_menu.phtml

@@ -99,17 +99,6 @@
 	</div>
 	</div>
 	<?php } ?>
 	<?php } ?>
 
 
-	<?php
-		$params = Minz_Request::params ();
-		if (isset ($params['search'])) {
-			$params['search'] = urlencode ($params['search']);
-		}
-		$url = array (
-			'c' => 'index',
-			'a' => 'index',
-			'params' => $params
-		);
-	?>
 	<div class="dropdown" id="nav_menu_views">
 	<div class="dropdown" id="nav_menu_views">
 		<div id="dropdown-views" class="dropdown-target"></div>
 		<div id="dropdown-views" class="dropdown-target"></div>
 		<a class="dropdown-toggle btn" href="#dropdown-views"><?php echo Minz_Translate::t ('display'); ?> <?php echo FreshRSS_Themes::icon('down'); ?></a>
 		<a class="dropdown-toggle btn" href="#dropdown-views"><?php echo Minz_Translate::t ('display'); ?> <?php echo FreshRSS_Themes::icon('down'); ?></a>
@@ -117,7 +106,7 @@
 			<li class="dropdown-close"><a href="#close">❌</a></li>
 			<li class="dropdown-close"><a href="#close">❌</a></li>
 
 
 			<?php
 			<?php
-				$url_output = $url;
+				$url_output = $this->url;
 				if ($actual_view !== 'normal') { ?>
 				if ($actual_view !== 'normal') { ?>
 			<li class="item">
 			<li class="item">
 				<?php $url_output['params']['output'] = 'normal'; ?>
 				<?php $url_output['params']['output'] = 'normal'; ?>
@@ -144,7 +133,7 @@
 			<li class="separator"></li>
 			<li class="separator"></li>
 
 
 			<?php
 			<?php
-				$url_state = $url;
+				$url_state = $this->url;
 				$url_state['params']['state'] = 'all';
 				$url_state['params']['state'] = 'all';
 			?>
 			?>
 			<li class="item" role="checkbox" aria-checked="<?php echo ($this->state === 'all') ? 'true' :'false'; ?>">
 			<li class="item" role="checkbox" aria-checked="<?php echo ($this->state === 'all') ? 'true' :'false'; ?>">
@@ -181,7 +170,7 @@
 
 
 			<li class="item">
 			<li class="item">
 				<?php
 				<?php
-					$url_order = $url;
+					$url_order = $this->url;
 					if ($this->order === 'DESC') {
 					if ($this->order === 'DESC') {
 						$url_order['params']['order'] = 'ASC';
 						$url_order['params']['order'] = 'ASC';
 				?>
 				?>
@@ -201,7 +190,8 @@
 			<li class="separator"></li>
 			<li class="separator"></li>
 
 
 			<li class="item">
 			<li class="item">
-				<a class="view_rss" target="_blank" href="<?php echo Minz_Url::display ($this->rss_url); ?>">
+				<?php $url_output['params']['output'] = 'rss'; ?>
+				<a class="view_rss" target="_blank" href="<?php echo Minz_Url::display ($url_output); ?>">
 					<?php echo Minz_Translate::t ('rss_view'); ?>
 					<?php echo Minz_Translate::t ('rss_view'); ?>
 				</a>
 				</a>
 			</li>
 			</li>

+ 1 - 1
app/views/helpers/view/normal_view.phtml

@@ -28,7 +28,7 @@ if (!empty($this->entries)) {
 
 
 <div id="stream" class="normal<?php echo $hidePosts ? ' hide_posts' : ''; ?>"><?php
 <div id="stream" class="normal<?php echo $hidePosts ? ' hide_posts' : ''; ?>"><?php
 	?><div id="new-article">
 	?><div id="new-article">
-		<a href="<?php echo _url('index', 'index'); ?>"><?php echo Minz_Translate::t ('new_article'); ?></a>
+		<a href="<?php echo Minz_Url::display ($this->url); ?>"><?php echo Minz_Translate::t ('new_article'); ?></a>
 	</div><?php
 	</div><?php
 	foreach ($this->entries as $item) {
 	foreach ($this->entries as $item) {
 		if ($display_today && $item->isDay (FreshRSS_Days::TODAY, $this->today)) {
 		if ($display_today && $item->isDay (FreshRSS_Days::TODAY, $this->today)) {