Commit f95dc9b4 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Changing the image block to show hide comments (Bug #1037531)

- similar to the changes done for textbox

Change-Id: I7419a50b6790d11ee5e4d48b2d1bbd2b134f2126
Signed-off-by: Robert Lyon's avatarRobert Lyon <>
parent e03327b0
......@@ -49,8 +49,15 @@ class PluginBlocktypeImage extends PluginBlocktype {
if (!empty($configdata['width'])) {
$src .= '&maxwidth=' . $configdata['width'];
$artefact = new ArtefactTypeImage($id);
require_once(get_config('docroot') . 'artefact/comment/lib.php');
require_once(get_config('docroot') . 'lib/view.php');
$view = new View($viewid);
list($commentcount, $comments) = ArtefactTypeComment::get_artefact_comments_for_view($artefact, $view, $instance->get('id'));
$smarty = smarty_core();
$smarty->assign('commentcount', $commentcount);
$smarty->assign('comments', $comments);
$smarty->assign('url', $wwwroot . 'artefact/artefact.php?artefact=' . $id . '&view=' . $viewid);
$smarty->assign('src', $src);
$smarty->assign('description', $description);
<div class="center imageblock" itemscope itemtype="">
<div class="image"><a href="{$url}"><img src="{$src}" alt="{$description}" itemprop="contentURL"></a></div>
{if $showdescription}<div class="detail" itemprop="description">{$description}</div>{/if}
{if $commentcount || $commentcount === 0}
Supports Markdown
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