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

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

parents 57b89080 34025e76
......@@ -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