Explorar el Código

Fix bug with new file organisation

entry_bottom.phtml didn't find $feed variable. It's fixed now.
Marien Fressinaud hace 11 años
padre
commit
930026df21

+ 2 - 2
app/views/helpers/index/normal/entry_bottom.phtml

@@ -36,7 +36,7 @@
 	<li class="item"><?php
 	<li class="item"><?php
 			if ($bottomline_sharing) {
 			if ($bottomline_sharing) {
 				$link = urlencode($this->entry->link());
 				$link = urlencode($this->entry->link());
-				$title = urlencode($this->entry->title() . ' · ' . $feed->name());
+				$title = urlencode($this->entry->title() . ' · ' . $this->feed->name());
 		?><div class="dropdown">
 		?><div class="dropdown">
 			<div id="dropdown-share-<?php echo $this->entry->id();?>" class="dropdown-target"></div>
 			<div id="dropdown-share-<?php echo $this->entry->id();?>" class="dropdown-target"></div>
 			<a class="dropdown-toggle" href="#dropdown-share-<?php echo $this->entry->id();?>">
 			<a class="dropdown-toggle" href="#dropdown-share-<?php echo $this->entry->id();?>">
@@ -48,7 +48,7 @@
 				<li class="dropdown-close"><a href="#close">❌</a></li>
 				<li class="dropdown-close"><a href="#close">❌</a></li>
 				<?php foreach ($sharing as $share) :?>
 				<?php foreach ($sharing as $share) :?>
 					<li class="item share">
 					<li class="item share">
-						<a target="_blank" href="<?php echo FreshRSS_Share::generateUrl(FreshRSS_Context::$conf->shares, $share, $this->entry->link(), $this->entry->title() . ' . ' . $feed->name())?>">
+						<a target="_blank" href="<?php echo FreshRSS_Share::generateUrl(FreshRSS_Context::$conf->shares, $share, $this->entry->link(), $this->entry->title() . ' . ' . $this->feed->name())?>">
 							<?php echo _t($share['name']);?>
 							<?php echo _t($share['name']);?>
 						</a>
 						</a>
 					</li>
 					</li>

+ 1 - 8
app/views/helpers/index/normal/entry_header.phtml

@@ -26,14 +26,7 @@
 			?></li><?php
 			?></li><?php
 		}
 		}
 	}
 	}
-	$feed = FreshRSS_CategoryDAO::findFeed($this->categories, $this->entry->feed());	//We most likely already have the feed object in cache
-	if ($feed == null) {
-		$feed = $this->entry->feed(true);
-		if ($feed == null) {
-			$feed = FreshRSS_Feed::example();
-		}
-	}
-	?><li class="item website"><a href="<?php echo _url('index', 'index', 'get', 'f_' . $feed->id()); ?>"><img class="favicon" src="<?php echo $feed->favicon(); ?>" alt="✇" /> <span><?php echo $feed->name(); ?></span></a></li>
+	?><li class="item website"><a href="<?php echo _url('index', 'index', 'get', 'f_' . $this->feed->id()); ?>"><img class="favicon" src="<?php echo $this->feed->favicon(); ?>" alt="✇" /> <span><?php echo $this->feed->name(); ?></span></a></li>
 	<li class="item title"><a target="_blank" href="<?php echo $this->entry->link(); ?>"><?php echo $this->entry->title(); ?></a></li>
 	<li class="item title"><a target="_blank" href="<?php echo $this->entry->link(); ?>"><?php echo $this->entry->title(); ?></a></li>
 	<?php if ($topline_date) { ?><li class="item date"><?php echo $this->entry->date(); ?> </li><?php } ?>
 	<?php if ($topline_date) { ?><li class="item date"><?php echo $this->entry->date(); ?> </li><?php } ?>
 	<?php if ($topline_link) { ?><li class="item link"><a target="_blank" href="<?php echo $this->entry->link(); ?>"><?php echo _i('link'); ?></a></li><?php } ?>
 	<?php if ($topline_link) { ?><li class="item link"><a target="_blank" href="<?php echo $this->entry->link(); ?>"><?php echo _i('link'); ?></a></li><?php } ?>

+ 9 - 0
app/views/index/normal.phtml

@@ -25,6 +25,15 @@ if (!empty($this->entries)) {
 			continue;
 			continue;
 		}
 		}
 
 
+		// We most likely already have the feed object in cache
+		$this->feed = FreshRSS_CategoryDAO::findFeed($this->categories, $this->entry->feed());
+		if ($this->feed == null) {
+			$this->feed = $this->entry->feed(true);
+			if ($this->feed == null) {
+				$this->feed = FreshRSS_Feed::example();
+			}
+		}
+
 		if ($display_today && $this->entry->isDay(FreshRSS_Days::TODAY, $today)) {
 		if ($display_today && $this->entry->isDay(FreshRSS_Days::TODAY, $today)) {
 			?><div class="day" id="day_today"><?php
 			?><div class="day" id="day_today"><?php
 				echo _t('today');
 				echo _t('today');