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

Adding comment display to folder artefact (Bug #1037531)

Change-Id: I2ca1392ca92c248ce1c752cda640b2ce39e89367
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 66a0a7ca
......@@ -47,13 +47,24 @@ class PluginBlocktypeFolder extends PluginBlocktype {
// This can be either an image or profileicon. They both implement
// render_self
$result = '';
if (isset($configdata['artefactid'])) {
$folder = $instance->get_artefact_instance($configdata['artefactid']);
$result = $folder->render_self($configdata);
$artefactid = isset($configdata['artefactid']) ? $configdata['artefactid'] : null;
if ($artefactid) {
$artefact = $instance->get_artefact_instance($artefactid);
$result = $artefact->render_self($configdata);
$result = $result['html'];
}
return $result;
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 = smarty_core();
if ($artefactid) {
$smarty->assign('commentcount', $commentcount);
$smarty->assign('comments', $comments);
}
$smarty->assign('html', $result);
return $smarty->fetch('blocktype:folder:folder.tpl');
}
public static function has_config() {
......
{$html|safe}
{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