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
ef3a9547
Commit
ef3a9547
authored
Dec 13, 2006
by
Alastair Pharo
Committed by
Alastair Pharo
Dec 13, 2006
Browse files
Some fixes for blog functionality. Blog posts can now render themselves
parent
705c8898
Changes
6
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/blog/lib.php
View file @
ef3a9547
...
...
@@ -154,7 +154,7 @@ class ArtefactTypeBlog extends ArtefactType {
}
/**
*
*
This function adds the ability to render a blog as a list of posts
*/
public
function
render
(
$format
,
$options
)
{
switch
(
$format
)
{
...
...
@@ -181,6 +181,13 @@ class ArtefactTypeBlog extends ArtefactType {
}
public
static
function
get_render_list
()
{
return
array_merge
(
array
(
FORMAT_ARTEFACT_LISTCHILDREN
,
FORMAT_ARTEFACT_RENDERFULL
),
parent
::
get_render_list
()
);
}
public
static
function
is_0_or_1
()
{
...
...
@@ -332,6 +339,20 @@ class ArtefactTypeBlogPost extends ArtefactType {
}
public
function
render
(
$format
,
$options
)
{
switch
(
$format
)
{
case
FORMAT_ARTEFACT_LISTSELF
:
$smarty
=
smarty
();
$smarty
->
assign
(
'arefact'
,
$this
);
return
$smarty
->
fetch
(
'artefact:blog:render/blogpost_listself.tpl'
);
case
FORMAT_ARTEFACT_RENDERFULL
:
$smarty
=
smarty
();
$smarty
->
assign
(
'arefact'
,
$this
);
return
$smarty
->
fetch
(
'artefact:blog:render/blogpost_renderfull.tpl'
);
default
:
return
parent
::
render
(
$format
,
$options
);
}
}
public
function
get_icon
()
{
...
...
htdocs/artefact/blog/list/index.php
View file @
ef3a9547
...
...
@@ -46,7 +46,11 @@ var bloglist = new TableRenderer(
A({'href':'{$wwwroot}artefact/blog/view/?id=' + r.id}, r.title)
);
},
'description'
function(r) {
var td = TD();
td.innerHTML = r.description;
return td;
}
]
);
...
...
htdocs/artefact/blog/theme/default/render/blogpost_listself.tpl
0 → 100644
View file @
ef3a9547
{**
* This template displays a blog post.
*}
<div>
<span>
{
$artefact
->
get
(
'title'
)|
escape
}
</span>
<span>
{
$artefact
->
get
(
'description'
)|
escape
}
</span>
</div>
htdocs/artefact/blog/theme/default/render/blogpost_renderfull.tpl
0 → 100644
View file @
ef3a9547
{**
* This template displays a blog post.
*}
<div>
<span>
{
$artefact
->
get
(
'title'
)|
escape
}
</span>
<span>
{
$artefact
->
get
(
'description'
)|
escape
}
</span>
</div>
htdocs/artefact/blog/view/indexjs.php
View file @
ef3a9547
...
...
@@ -98,6 +98,9 @@ postlist.rowfunction = function(d, n, gd) {
{ 'type' : 'button' },
{$enc_delete}
);
var desctd = TD();
desctd.innerHTML = d.description;
var rows = [
TR(
...
...
@@ -112,7 +115,7 @@ postlist.rowfunction = function(d, n, gd) {
del
)
),
TR(null,
TD(null, d.description)
),
TR(null,
desctd
),
TR(null, TD(null, d.ctime)),
];
...
...
htdocs/artefact/lib.php
View file @
ef3a9547
...
...
@@ -469,7 +469,6 @@ abstract class ArtefactType {
/**
* returns array of formats can render to (constants)
* @abstract
*/
public
static
function
get_render_list
()
{
return
array
(
...
...
Write
Preview
Markdown
is supported
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