Commit b0f75c70 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

List attachments in blog renderfull

parent eb49f878
......@@ -448,6 +448,14 @@ class ArtefactTypeBlogPost extends ArtefactType {
protected function render_full($options) {
$smarty = smarty();
$smarty->assign('artefact', $this);
$attachments = $this->get_attached_files();
if ($attachments) {
foreach ($attachments as &$attachment) {
$f = new ArtefactTypeFile($attachment->id);
$attachment->content = $f->render(FORMAT_ARTEFACT_LISTSELF, $options);
}
$smarty->assign('attachments', $attachments);
}
$smarty->assign('postedbyon', get_string('postedbyon', 'artefact.blog',
display_name($this->owner),
format_date($this->ctime)));
......
......@@ -37,7 +37,8 @@ $offset = param_integer('offset', 0);
$id = param_integer('id');
$options = json_decode(param_variable('options'));
list($count, $data) = ArtefactTypeBlogPost::render_posts(FORMAT_ARTEFACT_RENDERFULL, $options, $id, $limit, $offset);
list($count, $data) = ArtefactTypeBlogPost::render_posts(FORMAT_ARTEFACT_RENDERFULL,
$options, $id, $limit, $offset);
if (!$count) {
$count = 1;
......
......@@ -4,5 +4,17 @@
<div>
<h3>{$artefact->get('title')|escape}</h3>
<div>{$artefact->get('description')}</div>
{if isset($attachments)}
<table>
<tbody>
<tr><th>{str tag=attachedfiles section=artefact.blog}:</th></tr>
{foreach from=$attachments item=item}
<tr>
<td>{$item->content}</td>
</tr>
{/foreach}
</tbody>
</table>
{/if}
<div>{$postedbyon}</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