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
7d4b0b89
Commit
7d4b0b89
authored
Jan 18, 2007
by
Richard Mansfield
Browse files
Fix empty folder display for folder renderfull and listchildren
parent
0238d622
Changes
3
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/file/lib.php
View file @
7d4b0b89
...
...
@@ -514,22 +514,23 @@ class ArtefactTypeFolder extends ArtefactTypeFileBase {
}
public
function
folder_contents
()
{
if
(
$children
=
get_records_array
(
'artefact'
,
'parent'
,
$this
->
get
(
'id'
)))
{
return
$children
;
}
return
array
();
return
get_records_array
(
'artefact'
,
'parent'
,
$this
->
get
(
'id'
));
}
public
function
render_full
(
$options
)
{
$smarty
=
smarty
();
$smarty
->
assign
(
'artefact'
,
$this
);
$smarty
->
assign
(
'children'
,
$this
->
folder_contents
());
if
(
$children
=
$this
->
folder_contents
())
{
$smarty
->
assign
(
'children'
,
$children
);
}
return
$smarty
->
fetch
(
'artefact:file:folder_renderfull.tpl'
);
}
public
function
listchildren
(
$options
)
{
$smarty
=
smarty
();
$smarty
->
assign
(
'children'
,
$this
->
folder_contents
());
if
(
$children
=
$this
->
folder_contents
())
{
$smarty
->
assign
(
'children'
,
$children
);
}
return
$smarty
->
fetch
(
'artefact:file:folder_listchildren.tpl'
);
}
...
...
htdocs/artefact/file/theme/default/folder_listchildren.tpl
View file @
7d4b0b89
<div>
{
if
empty
(
$children
)
}
{
str
tag
=
emptyfolder
section
=
artefact
.
file
}
{
else
}
{
if
isset
(
$children
)
}
<table>
<tbody>
{
foreach
from
=
$children
item
=
child
}
<tr
class=
"
{
cycle
values
=
r1
,
r0
}
"
><td>
{
$child
->
title
}
</td><td>
{
$child
->
description
}
</td></tr>
{/
foreach
}
</tbody></table>
{
else
}
{
str
tag
=
emptyfolder
section
=
artefact
.
file
}
{/
if
}
</div>
htdocs/artefact/file/theme/default/folder_renderfull.tpl
View file @
7d4b0b89
...
...
@@ -10,6 +10,8 @@
<tr
class=
"
{
cycle
values
=
r1
,
r0
}
"
><td>
{
$child
->
title
}
</td><td>
{
$child
->
description
}
</td></tr>
{/
foreach
}
</tbody></table>
{
else
}
{
str
tag
=
emptyfolder
section
=
artefact
.
file
}
{/
if
}
</div>
</div>
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