Logo Search packages:      
Sourcecode: bamboo version File versions  Download package

leftnav.php

<?php

/**
some definitions:

 branchdepth = how many levels of the tree to show at any given time.
    if we are more levels deep than we can show at any given time, then 
    we show the higher levels in a kind of vertical breadcrumb path.

 depth = how deep in the tree the current page is.

 startlevel = what level in the tree to we start with when 
    extracting part of the tree using the current page as the anchor. 

**/
$spaces=false; // ie has some bugs which make it not work right with whitespace, but this sucks for debugging.

if (isset($nav_hide) && $nav_hide) {
      echo "<div id=root><div>" . alink($page->path,"Login","class='nav home'") . "</div></div>";
      return;
}

$path = $nav->getPathInfo($page);
            
$branchdepth = 2; // how much of the tree to show.
$depth = count($path);

echo("<div id=root>\n");
if ($page->path != '' || get('s')) {
      echo "<div>" . alink('/',"&#8756;&nbsp;Home","class='nav home'") . "</div>";  
}
if ($depth > $branchdepth) {
      $startlevel = $depth-$branchdepth;
      $path = array_reverse($path);
      while(count($path) > $branchdepth) {
            $pathpart = array_pop($path);
            echo("<div>" . alink($pathpart['path'] . '/',"&#8743;&nbsp;" . $pathpart['title'],"class='nav up'") . "</div>");
      }
}
else {
      $startlevel = 0;
}
echo("</div>");

$tree = $nav->getTree($page,$startlevel);
echo "<div id='list'><ol>\n";
foreach($tree as $entry) {    
      if ($spaces) echo (str_repeat('  ', $entry['level']+1));
      if ($entry['level'] === 'push')
            echo "<ol>";
      elseif ($entry['level'] === 'pop')
            echo "</ol>";
      else {      
            $class = "nav";
            if ($entry['selected']) $class .= " selected";
            $link = alink($entry['path'] . '/',$entry['title'],"class='$class'");
            echo "<li>$link</li>"; 
      }
}
echo "</ol></div>\n";

if (!$robot && false) {
      echo "<p><form action=\"$root\" method=get>search:<br><input name=s size=15 value=\"" . get('s') . "\"></form></p>";
}

return;
?>

Generated by  Doxygen 1.6.0   Back to index