Skip to content
Snippets Groups Projects
Commit d6abf164 authored by uhensler's avatar uhensler
Browse files

OO-4031: Show images in blog description

parent 2a5d8d7f
No related branches found
No related tags found
No related merge requests found
......@@ -121,6 +121,20 @@ public class FeedFileStorge {
public LocalFolderImpl getResourceContainer(OLATResourceable ores) {
return fileResourceManager.getFileResourceRootImpl(ores);
}
public VFSContainer getOrCreateResourceMediaContainer(OLATResourceable ores) {
VFSContainer mediaContainer = null;
if (ores != null) {
VFSContainer resourceDir = getResourceContainer(ores);
mediaContainer = (VFSContainer) resourceDir.resolve(MEDIA_DIR);
if (mediaContainer == null) {
mediaContainer = resourceDir.createChildContainer(MEDIA_DIR);
}
}
return mediaContainer;
}
/**
* Get the top most folder of a feed.
......
......@@ -653,6 +653,10 @@ public class FeedManagerImpl extends FeedManager {
try {
VFSItem item =feedFileStorage.getOrCreateFeedMediaContainer(feed);
item = item.resolve(fileName);
if (item == null) {
item = feedFileStorage.getOrCreateResourceMediaContainer(feed);
item = item.resolve(fileName);
}
if (thumbnailSize != null && thumbnailSize.getHeight() > 0 && thumbnailSize.getWidth() > 0
&& item.canMeta() == VFSConstants.YES) {
item = item.getMetaInfo().getThumbnail(thumbnailSize.getWidth(),
......
......@@ -9,13 +9,13 @@
#if ($helper.getImageUrl($feed) && $helper.getImageUrl($feed) != "")
<img class="o_media" src="$helper.getImageUrl($feed)?thumbnail=180x121{$!supressCache}" alt="Blog Image" />
#end
<div class="o_block">
<div class="o_block ">
#if ($!feed.getAuthor())
<div class="o_author">$r.translate("feed.author"): $r.escapeHtml($feed.getAuthor())</div>
#end
<div class="o_date">$r.translate("feed.last.change") $!helper.getLastModified($feed)</div>
#if ($!feed.getDescription() && $feed.getDescription() != "")
<div class="o_desc o_info">$!helper.getFeedDescriptionForBrowser($feed)</div>
<div class="o_desc o_info clearfix">$!helper.getFeedDescriptionForBrowser($feed)</div>
#end
#if (!$feed.isUndefined())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment