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 @@
{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}
......
......@@ -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 . '&amp;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);
}
......
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