Commit 1393fd5e authored by Eugene Venter's avatar Eugene Venter Committed by Richard Mansfield
Browse files

artefact/blog: Append 'view' param onto URL for inline image files and file...

artefact/blog: Append 'view' param onto URL for inline image files and file attachments on blog posts (bug #530656)
parent 4a47b821
......@@ -672,8 +672,8 @@ class ArtefactTypeBlogPost extends ArtefactType {
$commentcounts = ArtefactTypeComment::count_comments($viewids, array_keys($data));
}
// Format dates properly
foreach ($data as &$post) {
// Format dates properly
if (is_null($viewoptions)) {
// My Blogs area: create forms for publishing & deleting posts.
if (!$post->published) {
......@@ -690,6 +690,12 @@ class ArtefactTypeBlogPost extends ArtefactType {
}
$post->ctime = format_date($post->ctime, 'strftimedaydatetime');
$post->mtime = format_date($post->mtime);
// Ensure images in the post have the right viewid associated with them
if (!empty($viewoptions['viewid'])) {
safe_require('artefact', 'file');
$post->description = ArtefactTypeFolder::append_view_url($post->description, $viewoptions['viewid']);
}
}
$results['data'] = array_values($data);
......
......@@ -15,7 +15,7 @@
<td>
<a href="{$WWWROOT}view/artefact.php?artefact={$file->attachment}&view={$options.viewid}">{$file->title}</a>
({$file->size|display_size})
- <strong><a href="{$WWWROOT}artefact/file/download.php?file={$file->attachment}">{str tag=Download section=artefact.file}</a></strong>
- <strong><a href="{$WWWROOT}artefact/file/download.php?file={$file->attachment}&view={$options.viewid}">{str tag=Download section=artefact.file}</a></strong>
</td>
</tr>
{/foreach}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment