Commit 8f2dc04e authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie
Browse files

Added view parameters to images in blog posts and actual images. Still

broken due to artefact parent cache...
parent 25161103
......@@ -484,6 +484,13 @@ class ArtefactTypeBlogPost extends ArtefactType {
else {
$smarty->assign('artefacttitle', $this->get('title'));
}
// We need to make sure that the images in the post have the right viewid associated with them
$postcontent = $this->get('description');
if (isset($options['viewid'])) {
$postcontent = preg_replace('#(<img src=".*artefact/file/download\.php\?file=\d+)#', '\1&amp;view=' . $options['viewid'], $postcontent);
}
$smarty->assign('artefactdescription', $postcontent);
$smarty->assign('artefact', $this);
$attachments = $this->get_attached_files();
if ($attachments) {
......
......@@ -3,7 +3,7 @@
*}
<div>
<h3>{$artefacttitle}</h3>
<div>{$artefact->get('description')}</div>
<div>{$artefactdescription}</div>
{if isset($attachments)}
<table>
<tbody>
......
......@@ -880,7 +880,11 @@ class ArtefactTypeImage extends ArtefactTypeFile {
public function render_full($options) {
$smarty = smarty();
$smarty->assign('src', get_config('wwwroot') . 'artefact/file/download.php?file=' . $this->id);
$src = get_config('wwwroot') . 'artefact/file/download.php?file=' . $this->id;
if (isset($options['viewid'])) {
$src .= '&amp;view=' . $options['viewid'];
}
$smarty->assign('src', $src);
$smarty->assign('title', $this->title);
$smarty->assign('description', $this->description);
if (isset($options['width'])) {
......
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