[phpcvsview-cvs-updates] phpcvsview func_DirListing.php,1.1,1.2 utils.php,1.1,1.2
Status: Pre-Alpha
Brought to you by:
bcheesem
From: Brian C. <bch...@us...> - 2004-10-02 02:54:27
|
Update of /cvsroot/phpcvsview/phpcvsview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31228 Modified Files: func_DirListing.php utils.php Log Message: Added code to produce quick directory navigation links above the directory listing. Index: utils.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/utils.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** utils.php 2 Oct 2004 01:46:19 -0000 1.1 --- utils.php 2 Oct 2004 02:53:35 -0000 1.2 *************** *** 95,97 **** --- 95,113 ---- } + function ImplodeToPath($Dirs, $Seperator, $Number) + { + // echo "<br><br>In ImplodeToPath()...<br>\n"; + $RetVal = ""; + for ($Counter = 0; $Counter <= $Number; $Counter++) + { + // echo "Counter is at $Counter of $Number. Value is '".$Dirs[$Counter]."'.<br>\n"; + if ($Dirs[$Counter] != "") { + $RetVal .= $Seperator . $Dirs[$Counter]; + } + // echo "RetVal is '".$RetVal."'.<br>\n"; + } + // echo "Out ImplodeToPath()...<br><br>\n"; + return $RetVal; + } + ?> \ No newline at end of file Index: func_DirListing.php =================================================================== RCS file: /cvsroot/phpcvsview/phpcvsview/func_DirListing.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** func_DirListing.php 2 Oct 2004 01:46:19 -0000 1.1 --- func_DirListing.php 2 Oct 2004 02:53:35 -0000 1.2 *************** *** 40,43 **** --- 40,53 ---- $CVSServer->RLog($ModPath); + // Add the quick link navigation bar. + $Dirs = explode("/", $ModPath); + echo "Navigate to: <a href=\"$ScriptName\">Root</a> "; + $intCount = 1; + while($intCount < count($Dirs)-2){ + echo "/ <a href=\"$ScriptName?mp=".ImplodeToPath($Dirs, "/", $intCount)."/\">".$Dirs[$intCount]."</a> "; + $intCount++; + } // while + echo "/ ".$Dirs[$intCount]."<br>\n"; + // Start the output for the table. echo "<hr>\n"; |