Commit 34025e76 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review

Adding comment display to image gallery artefact (Bug #1037531)

This is only for the displaying of a folder as a gallery
in either the thumbs, square thumbs, or slideshow.

The allow comments is based on the allowing the folder to have
comments so this means any folder comments will display whether they
have been added following the link in gallery block or the folder
block as both end up at the same artefact on artefact/artefact.php page

Change-Id: I787a730861823ef3f731fb5209bf3470b00a7ed3
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 5d1f6511
......@@ -402,7 +402,17 @@ class PluginBlocktypeGallery extends PluginBlocktype {
}
$smarty->assign('frame', get_config_plugin('blocktype', 'gallery', 'photoframe'));
$smarty->assign('copyright', $copyright);
if (!empty($configdata['artefactid'])) {
$artefact = $instance->get_artefact_instance($configdata['artefactid']);
require_once(get_config('docroot') . 'artefact/comment/lib.php');
require_once(get_config('docroot') . 'lib/view.php');
$view = new View($configdata['viewid']);
list($commentcount, $comments) = ArtefactTypeComment::get_artefact_comments_for_view($artefact, $view, $instance->get('id'));
$smarty->assign('commentcount', $commentcount);
$smarty->assign('comments', $comments);
}
return $smarty->fetch('blocktype:gallery:' . $template . '.tpl');
}
......
......@@ -32,4 +32,7 @@ $j(function() {
</script>
{else}
{str tag=noimagesfound section=artefact.file}
{/if}
\ No newline at end of file
{/if}
{if $commentcount || $commentcount === 0}
{$comments|safe}
{/if}
......@@ -27,3 +27,6 @@ $j(function() {
});
</script>
{if isset($copyright)}<div class="cb" id="lbBottom">{$copyright|safe}</div>{/if}
{if $commentcount || $commentcount === 0}
{$comments|safe}
{/if}
......@@ -27,3 +27,6 @@ $j(function() {
});
</script>
{if isset($copyright)}<div class="cb" id="lbBottom">{$copyright|safe}</div>{/if}
{if $commentcount || $commentcount === 0}
{$comments|safe}
{/if}
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