--- docman.php 2001/12/14 16:58:27 1.48 +++ docman.php 2001/12/14 17:28:06 1.49 @@ -701,7 +701,7 @@ CELLSPACING=3 WIDTH=\"100%\">" ; // updir bar - if ($fsDir != $fsRoot) { + if (chopsl($fsDir) != chopsl($fsRoot)) { $parent = dirname($relDir) ; if ($parent == "") $parent = "/" ; ?> @@ -1205,6 +1205,13 @@ ////////////////////////////////////////////////////////////////// +function chopsl($path) { + if (substr($path,strlen($path)-1,1) == "/") $path=substr($path,0,strlen($path)-1); + $path=str_replace("//","/",$path); + return $path; +} + +////////////////////////////////////////////////////////////////// // MAIN PROGRAM // ============ // query parameters: capital letters @@ -1462,6 +1469,7 @@ // $A=Co : checkout file $D/$F // $A=Ci : checkin file $D/$F // $A=V : view file (do nothing except log) + // $A=I : include file .$F.php from $gblFsRoot // default : display directory $D switch ($A) { @@ -1521,6 +1529,19 @@ DisplayChangeLog(1); EndHTML() ; exit; + case "I" : + $F=stripSlashes($F); + $inc_file="${gblFsRoot}/.${F}.php"; + if (!isset($F) || $F == "" || !file_exists($inc_file)) Error("Fatal error $inc_file"); // can't find file to include + if (!is_readable($inc_file)) + Error("Read access to include file denied",".${F}.php"); + $text = "Your include file should define \$text variable which holds this text and \$title variable which is page title"; + $title = "You should define \$title variable with page title"; + include($inc_file); + StartHTML($title, $text) ; + print "

".GifIcon(up)." Back to front page.

"; + EndHTML() ; + exit ; } // default: display directory $relDir