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

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

parents 1b10ff90 f95dc9b4
...@@ -49,8 +49,15 @@ class PluginBlocktypeImage extends PluginBlocktype { ...@@ -49,8 +49,15 @@ class PluginBlocktypeImage extends PluginBlocktype {
if (!empty($configdata['width'])) { if (!empty($configdata['width'])) {
$src .= '&maxwidth=' . $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 = smarty_core();
$smarty->assign('commentcount', $commentcount);
$smarty->assign('comments', $comments);
$smarty->assign('url', $wwwroot . 'artefact/artefact.php?artefact=' . $id . '&view=' . $viewid); $smarty->assign('url', $wwwroot . 'artefact/artefact.php?artefact=' . $id . '&view=' . $viewid);
$smarty->assign('src', $src); $smarty->assign('src', $src);
$smarty->assign('description', $description); $smarty->assign('description', $description);
......
<div class="center imageblock" itemscope itemtype="http://schema.org/ImageObject"> <div class="center imageblock" itemscope itemtype="http://schema.org/ImageObject">
<div class="image"><a href="{$url}"><img src="{$src}" alt="{$description}" itemprop="contentURL"></a></div> <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 $showdescription}<div class="detail" itemprop="description">{$description}</div>{/if}
{if $commentcount || $commentcount === 0}
{$comments|safe}
{/if}
</div> </div>
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