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

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

parents ca3c2d92 318c7051
...@@ -47,13 +47,24 @@ class PluginBlocktypeFolder extends PluginBlocktype { ...@@ -47,13 +47,24 @@ class PluginBlocktypeFolder extends PluginBlocktype {
// This can be either an image or profileicon. They both implement // This can be either an image or profileicon. They both implement
// render_self // render_self
$result = ''; $result = '';
if (isset($configdata['artefactid'])) { $artefactid = isset($configdata['artefactid']) ? $configdata['artefactid'] : null;
$folder = $instance->get_artefact_instance($configdata['artefactid']); if ($artefactid) {
$result = $folder->render_self($configdata); $artefact = $instance->get_artefact_instance($artefactid);
$result = $artefact->render_self($configdata);
$result = $result['html']; $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() { public static function has_config() {
......
{$html|safe}
{if $commentcount || $commentcount === 0}
{$comments|safe}
{/if}
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