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
22e83877
Commit
22e83877
authored
Jan 18, 2007
by
Richard Mansfield
Browse files
Put view nav list into smarty template
parent
7d4b0b89
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/theme/default/templates/view/view.tpl
View file @
22e83877
...
...
@@ -2,7 +2,14 @@
{
include
file
=
"columnfullstart.tpl"
}
<div
id=
"view"
>
<h2>
{
$TITLE
}
</h2>
<h3>
{
foreach
name
=
viewnav
from
=
$VIEWNAV
item
=
item
}
{
$item
}
{
if
!
$smarty.foreach.viewnav.last
}
:
{/
if
}
{/
foreach
}
</h3>
{
if
$VIEWCONTENT
}
{
$VIEWCONTENT
}
...
...
htdocs/view/view.php
View file @
22e83877
...
...
@@ -52,21 +52,19 @@ if ($artefactid) {
$hierarchy
=
$view
->
get_artefact_hierarchy
();
$artefact
=
$hierarchy
[
'refs'
][
$artefactid
];
$ancestorid
=
$artefact
->
parent
;
$
links
=
array
(
'<a href="view.php?view='
.
$viewid
.
'">'
.
$view
->
get
(
'title'
)
.
'</a>'
);
$
navlist
=
array
(
'<a href="view.php?view='
.
$viewid
.
'">'
.
$view
->
get
(
'title'
)
.
'</a>'
);
while
(
$ancestorid
&&
isset
(
$hierarchy
[
'refs'
][
$ancestorid
]))
{
$ancestor
=
$hierarchy
[
'refs'
][
$ancestorid
];
$link
=
'<a href="view.php?view='
.
$viewid
.
'&artefact='
.
$ancestorid
.
'">'
.
$ancestor
->
title
.
"</a>
\n
"
;
array_push
(
$
links
,
$link
);
array_push
(
$
navlist
,
$link
);
$ancestorid
=
$ancestor
->
parent
;
}
array_push
(
$links
,
$artefact
->
title
);
$title
=
implode
(
' - '
,
$links
);
//$title .= $artefact->title;
array_push
(
$navlist
,
$artefact
->
title
);
$jsartefact
=
$artefactid
;
}
else
{
$
title
=
$view
->
get
(
'title'
);
$
navlist
=
array
(
$view
->
get
(
'title'
)
)
;
$jsartefact
=
'undefined'
;
$content
=
$view
->
render
();
}
...
...
@@ -201,7 +199,7 @@ EOF;
$smarty
=
smarty
(
array
(
'tablerenderer'
));
$smarty
->
assign
(
'INLINEJAVASCRIPT'
,
$javascript
);
$smarty
->
assign
(
'
TITLE'
,
$title
);
$smarty
->
assign
(
'
VIEWNAV'
,
$navlist
);
if
(
isset
(
$content
))
{
$smarty
->
assign
(
'VIEWCONTENT'
,
$content
);
}
...
...
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