Commit 1d0345f9 authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie
Browse files
parents 6533b217 68ceb67f
......@@ -453,6 +453,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>
......@@ -294,6 +294,7 @@ $smarty = smarty(array('tablerenderer'));
$smarty->assign('INLINEJAVASCRIPT', $javascript);
$smarty->assign('member', $membership);
$smarty->assign('tutor', $tutor);
$smarty->assign('controlled', $controlled);
$smarty->assign('canjoin', $canjoin);
$smarty->assign('canrequestjoin', $canrequestjoin);
$smarty->assign('canleave', $canleave);
......
......@@ -20,7 +20,7 @@
{if $member}
<div class="communityviews">
<h5>{str tag='views'}</h5>
{if $tutor}
{if $tutor && $controlled}
<form>
<select name="submitted" onChange="viewlist.submitted=this.options[this.selectedIndex].value;viewlist.doupdate();">
<option value="0">{str tag='allviews'}</option>
......
......@@ -86,10 +86,14 @@
swapDOM(
div,
LABEL(null,
INPUT({'type': 'radio', 'name': '{{$name}}_selected', 'value': email}),
INPUT({'type': 'hidden', 'name': '{{$name}}_valid[]' , 'value': email}),
' ' + email,
DIV(
{'class': 'validated'},
LABEL(null,
INPUT({'type': 'radio', 'name': '{{$name}}_selected', 'value': email}),
INPUT({'type': 'hidden', 'name': '{{$name}}_valid[]' , 'value': email}),
' ' + email
),
' ',
A({'href': '', 'onclick': '{{$name}}_remove(this); return false'}, '[x]')
)
);
......
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