Commit 22e83877 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Put view nav list into smarty template

parent 7d4b0b89
...@@ -2,7 +2,14 @@ ...@@ -2,7 +2,14 @@
{include file="columnfullstart.tpl"} {include file="columnfullstart.tpl"}
<div id="view"> <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} {if $VIEWCONTENT}
{$VIEWCONTENT} {$VIEWCONTENT}
......
...@@ -52,21 +52,19 @@ if ($artefactid) { ...@@ -52,21 +52,19 @@ if ($artefactid) {
$hierarchy = $view->get_artefact_hierarchy(); $hierarchy = $view->get_artefact_hierarchy();
$artefact = $hierarchy['refs'][$artefactid]; $artefact = $hierarchy['refs'][$artefactid];
$ancestorid = $artefact->parent; $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])) { while ($ancestorid && isset($hierarchy['refs'][$ancestorid])) {
$ancestor = $hierarchy['refs'][$ancestorid]; $ancestor = $hierarchy['refs'][$ancestorid];
$link = '<a href="view.php?view=' . $viewid . '&amp;artefact=' . $ancestorid . '">' $link = '<a href="view.php?view=' . $viewid . '&amp;artefact=' . $ancestorid . '">'
. $ancestor->title . "</a>\n"; . $ancestor->title . "</a>\n";
array_push($links, $link); array_push($navlist, $link);
$ancestorid = $ancestor->parent; $ancestorid = $ancestor->parent;
} }
array_push($links, $artefact->title); array_push($navlist, $artefact->title);
$title = implode(' - ', $links);
//$title .= $artefact->title;
$jsartefact = $artefactid; $jsartefact = $artefactid;
} }
else { else {
$title = $view->get('title'); $navlist = array($view->get('title'));
$jsartefact = 'undefined'; $jsartefact = 'undefined';
$content = $view->render(); $content = $view->render();
} }
...@@ -201,7 +199,7 @@ EOF; ...@@ -201,7 +199,7 @@ EOF;
$smarty = smarty(array('tablerenderer')); $smarty = smarty(array('tablerenderer'));
$smarty->assign('INLINEJAVASCRIPT', $javascript); $smarty->assign('INLINEJAVASCRIPT', $javascript);
$smarty->assign('TITLE', $title); $smarty->assign('VIEWNAV', $navlist);
if (isset($content)) { if (isset($content)) {
$smarty->assign('VIEWCONTENT', $content); $smarty->assign('VIEWCONTENT', $content);
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment