Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
86299da6
Commit
86299da6
authored
Jan 18, 2007
by
Richard Mansfield
Browse files
Blogpost render metadata
parent
b1e0d07e
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/blog/lang/en.utf8/artefact.blog.php
View file @
86299da6
...
...
@@ -33,6 +33,7 @@ $string['alignment'] = 'Alignment';
$string
[
'attach'
]
=
'Attach'
;
$string
[
'attachedfilelistloaded'
]
=
'Attached file list loaded'
;
$string
[
'attachedfiles'
]
=
'Attached files'
;
$string
[
'attachments'
]
=
'Attachments'
;
$string
[
'blogdesc'
]
=
'Description'
;
$string
[
'blogdescdesc'
]
=
'e.g., ‘A record of Jill\'s experiences and reflections’.'
;
$string
[
'blogfilesdirdescription'
]
=
'Files uploaded as blog post attachments'
;
...
...
htdocs/artefact/blog/lib.php
View file @
86299da6
...
...
@@ -265,7 +265,6 @@ class ArtefactTypeBlog extends ArtefactType {
protected
function
render_metadata
(
$options
)
{
$smarty
=
smarty
();
$smarty
->
assign
(
'PROPERTIES'
,
$this
->
get_metadata
());
log_debug
(
$smarty
);
return
$smarty
->
fetch
(
'artefact:blog:render/blog_rendermetadata.tpl'
);
}
...
...
@@ -457,6 +456,32 @@ class ArtefactTypeBlogPost extends ArtefactType {
return
$smarty
->
fetch
(
'artefact:blog:render/blogpost_renderfull.tpl'
);
}
protected
function
count_attachments
()
{
return
count_records
(
'artefact_blog_blogpost_file'
,
'blogpost'
,
$this
->
get
(
'id'
));
}
protected
function
get_metadata
()
{
$data
=
parent
::
get_metadata
();
unset
(
$data
[
'description'
]);
unset
(
$data
[
'size'
]);
$data
[
'type'
][
'value'
]
=
get_string
(
$this
->
get
(
'artefacttype'
),
'artefact.blog'
);
$data
[
'attachments'
]
=
array
(
'name'
=>
get_string
(
'attachments'
,
'artefact.blog'
),
'value'
=>
$this
->
count_attachments
()
.
' '
.
get_string
(
'files'
,
'artefact.file'
));
return
$data
;
}
protected
function
render_metadata
(
$options
)
{
$smarty
=
smarty
();
$smarty
->
assign
(
'PROPERTIES'
,
$this
->
get_metadata
());
return
$smarty
->
fetch
(
'artefact:blog:render/blog_rendermetadata.tpl'
);
}
public
function
get_icon
()
{
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment