Commit 372d8202 authored by Martyn Smith's avatar Martyn Smith Committed by Martyn Smith
Browse files
parents 531180d1 ad8e1a4a
...@@ -225,6 +225,19 @@ class ArtefactTypeBlog extends ArtefactType { ...@@ -225,6 +225,19 @@ class ArtefactTypeBlog extends ArtefactType {
return $smarty->fetch('artefact:blog:render/blog_listchildren.tpl'); return $smarty->fetch('artefact:blog:render/blog_listchildren.tpl');
} }
protected function listself($options) {
$smarty = smarty();
$smarty->assign('title', $this->get('title'));
if (isset($options['size']) && $options['size']) {
$smarty->assign('size', $this->count_children() . ' ' . get_string('posts', 'artefact.blog'));
}
return $smarty->fetch('artefact:blog:render/blog_listself.tpl');
}
/** /**
* This function implements the render_full functionality for blogs. * This function implements the render_full functionality for blogs.
* Rendering full involves rendering blog posts with render_full, and * Rendering full involves rendering blog posts with render_full, and
...@@ -440,8 +453,12 @@ class ArtefactTypeBlogPost extends ArtefactType { ...@@ -440,8 +453,12 @@ class ArtefactTypeBlogPost extends ArtefactType {
*/ */
protected function listself($options) { protected function listself($options) {
$smarty = smarty(); $smarty = smarty();
$smarty->assign('artefact', $this); $smarty->assign('title', $this->get('title'));
return $smarty->fetch('artefact:blog:render/blogpost_listself.tpl'); if (isset($options['size']) && $options['size']) {
$smarty->assign('size', $this->count_attachments() . ' '
. get_string('attachments', 'artefact.blog'));
}
return $smarty->fetch('artefact:blog:render/blog_listself.tpl');
} }
/** /**
......
<div>{$title}
{if isset($size)}
({$size})
{/if}
</div>
{**
* This template displays a blog post.
*}
<div>
<span>{$artefact->get('title')|escape}</span>
<div>{$artefact->get('description')}</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