- Patch #1268234 by derjochenmeyer: move out rendering image from aggregator parser.
parent
8df7795d56
commit
226a01e280
|
@ -507,7 +507,14 @@ function template_preprocess_aggregator_feed_source(&$variables) {
|
|||
$feed = $variables['feed'];
|
||||
|
||||
$variables['source_icon'] = theme('feed_icon', array('url' => $feed->url, 'title' => t('!title feed', array('!title' => $feed->title))));
|
||||
$variables['source_image'] = $feed->image;
|
||||
|
||||
if (!empty($feed->image) && !empty($feed->title) && !empty($feed->link)) {
|
||||
$variables['source_image'] = l(theme('image', array('path' => $feed->image, 'alt' => $feed->title)), $feed->link, array('html' => TRUE, 'attributes' => array('class' => 'feed-image')));
|
||||
}
|
||||
else {
|
||||
$variables['source_image'] = '';
|
||||
}
|
||||
|
||||
$variables['source_description'] = aggregator_filter_xss($feed->description);
|
||||
$variables['source_url'] = check_url(url($feed->link, array('absolute' => TRUE)));
|
||||
|
||||
|
|
|
@ -35,19 +35,12 @@ function aggregator_aggregator_parse($feed) {
|
|||
$image[$key] = trim($value);
|
||||
}
|
||||
|
||||
if (!empty($image['link']) && !empty($image['url']) && !empty($image['title'])) {
|
||||
$image = l(theme('image', array('path' => $image['url'], 'alt' => $image['title'])), $image['link'], array('html' => TRUE));
|
||||
}
|
||||
else {
|
||||
$image = '';
|
||||
}
|
||||
|
||||
$etag = empty($feed->http_headers['etag']) ? '' : $feed->http_headers['etag'];
|
||||
|
||||
// Add parsed data to the feed object.
|
||||
$feed->link = !empty($channel['LINK']) ? $channel['LINK'] : '';
|
||||
$feed->description = !empty($channel['DESCRIPTION']) ? $channel['DESCRIPTION'] : '';
|
||||
$feed->image = $image;
|
||||
$feed->link = !empty($channel['link']) ? $channel['link'] : '';
|
||||
$feed->description = !empty($channel['description']) ? $channel['description'] : '';
|
||||
$feed->image = !empty($image['url']) ? $image['url'] : '';
|
||||
$feed->etag = $etag;
|
||||
$feed->modified = $modified;
|
||||
|
||||
|
|
Loading…
Reference in New Issue