cvs: phd(PHD_ENTERPRISE) /formats xhtml.php

From: Date: Sat, 09 Aug 2008 15:08:06 +0000
Subject: cvs: phd(PHD_ENTERPRISE) /formats xhtml.php
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-2011@lists.php.net to get a copy of this message
loudi Sat Aug 9 15:08:06 2008 UTC Modified files: (Branch: PHD_ENTERPRISE) /phd/formats xhtml.php Log: * fixed a bug in xhtml navbar (now ancestors appear in the right order) http://cvs.php.net/viewvc.cgi/phd/formats/xhtml.php?r1=1.68.2.8&r2=1.68.2.9&diff_format=u Index: phd/formats/xhtml.php diff -u phd/formats/xhtml.php:1.68.2.8 phd/formats/xhtml.php:1.68.2.9 --- phd/formats/xhtml.php:1.68.2.8 Sun Aug 3 22:06:39 2008 +++ phd/formats/xhtml.php Sat Aug 9 15:08:06 2008 @@ -1,5 +1,5 @@ <?php -/* $Id: xhtml.php,v 1.68.2.8 2008/08/03 22:06:39 loudi Exp $ */ +/* $Id: xhtml.php,v 1.68.2.9 2008/08/09 15:08:06 loudi Exp $ */ class PhDXHTMLFormat extends PhDFormat { private $simpleName = "XHTML"; private $myelementmap = array( /* {{{ */ @@ -591,12 +591,19 @@ <ul class="toc"> <li class="header home"><a href="index.'.$this->ext.'">PHP Manual</a></li> '; + // Fetch ancestors of the current node + $ancestors = array(); $currentId = $id; while (($currentId = $this->getParent($currentId)) && $currentId != "index") { $desc = ""; $link = $this->createLink($currentId, $desc); - $navBar .= " <li class=\"header up\"><a href=\"$link\">$desc</a></li>\n"; + $ancestors[] = array("desc" => $desc, "link" => $link); } + // Show them from the root to the closest parent + foreach (array_reverse($ancestors) as $ancestor) { + $navBar .= " <li class=\"header up\"><a href=\"{$ancestor["link"]}\">{$ancestor["desc"]}</a></li>\n"; + } + // Fetch siblings of the current node $parent = $this->getParent($id); $childrens = $this->sqlite->query("SELECT docbook_id FROM ids WHERE parent_id='$parent'"); while ($child = $childrens->fetchArray(SQLITE3_ASSOC)) {

« previous php.doc.cvs (#2011) next »