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
235596e8
Commit
235596e8
authored
Jan 17, 2007
by
Martyn Smith
Committed by
Martyn Smith
Jan 17, 2007
Browse files
Fix bugs and code formatting in the template render (and the view renderer)
parent
8f853116
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/template.php
View file @
235596e8
...
...
@@ -327,7 +327,9 @@ function template_render($template, $mode, $data=array()) {
$block
.
=
template_render_label_editmode
(
$t
,
$data
);
}
else
{
$block
.
=
$data
[
$t
[
'id'
]][
'value'
];
if
(
isset
(
$data
[
$t
[
'id'
]]))
{
$block
.
=
$data
[
$t
[
'id'
]][
'value'
];
}
}
break
;
case
'title'
;
...
...
@@ -336,7 +338,12 @@ function template_render($template, $mode, $data=array()) {
}
break
;
case
'author'
;
$block
.
=
template_render_author
(
$data
[
'ownerformat'
]);
if
(
isset
(
$data
[
'ownerformat'
]))
{
$block
.
=
template_render_author
(
$data
[
'ownerformat'
]);
}
else
{
$block
.
=
$data
[
'author'
];
}
break
;
case
'description'
;
if
(
isset
(
$data
[
'description'
]))
{
...
...
@@ -376,11 +383,8 @@ function template_render($template, $mode, $data=array()) {
}
if
(
$artefact
===
null
)
{
if
(
$mode
==
TEMPLATE_RENDER_EDITMODE
)
{
$block
.
=
template_render_empty_artefact_block
();
}
else
{
$block
.
=
''
;
if
(
$mode
==
TEMPLATE_RENDER_EDITMODE
)
{
$block
.
=
template_render_empty_artefact_block
();
}
}
else
{
...
...
@@ -388,21 +392,15 @@ function template_render($template, $mode, $data=array()) {
}
}
else
{
if
(
$mode
==
TEMPLATE_RENDER_EDITMODE
)
{
if
(
$mode
==
TEMPLATE_RENDER_EDITMODE
)
{
$block
.
=
template_render_empty_artefact_block
();
}
else
{
$block
.
=
''
;
}
}
break
;
}
if
(
empty
(
$block
)
&&
$mode
==
TEMPLATE_RENDER_READONLY
)
{
$html
.
=
''
;
}
else
{
if
(
$mode
!=
TEMPLATE_RENDER_READONLY
||
!
empty
(
$block
))
{
// span or div?
if
(
isset
(
$t
[
'tagtype'
])
&&
$t
[
'tagtype'
]
==
'span'
)
{
$html
.
=
'<span'
;
...
...
htdocs/lib/view.php
View file @
235596e8
...
...
@@ -280,7 +280,7 @@ class View {
);
}
foreach
(
$contents
as
$content
)
{
$data
[
$content
->
id
]
=
array
(
$data
[
$content
->
block
]
=
array
(
'value'
=>
$content
->
content
,
);
}
...
...
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