/[docman]/docman.php
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /docman.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.48 by dpavlin, Fri Dec 14 16:58:27 2001 UTC revision 1.49 by dpavlin, Fri Dec 14 17:28:06 2001 UTC
# Line 701  function Navigate($fsRoot,$relDir) { Line 701  function Navigate($fsRoot,$relDir) {
701                  CELLSPACING=3 WIDTH=\"100%\">" ;                  CELLSPACING=3 WIDTH=\"100%\">" ;
702    
703          // updir bar              // updir bar    
704          if ($fsDir != $fsRoot) {          if (chopsl($fsDir) != chopsl($fsRoot)) {
705                  $parent = dirname($relDir) ;                  $parent = dirname($relDir) ;
706                  if ($parent == "") $parent = "/" ;                  if ($parent == "") $parent = "/" ;
707  ?>  ?>
# Line 1205  function Download($path) { Line 1205  function Download($path) {
1205    
1206  //////////////////////////////////////////////////////////////////  //////////////////////////////////////////////////////////////////
1207    
1208    function chopsl($path) {
1209            if (substr($path,strlen($path)-1,1) == "/") $path=substr($path,0,strlen($path)-1);
1210            $path=str_replace("//","/",$path);
1211            return $path;
1212    }
1213    
1214    //////////////////////////////////////////////////////////////////
1215  // MAIN PROGRAM  // MAIN PROGRAM
1216  // ============  // ============
1217  // query parameters: capital letters  // query parameters: capital letters
# Line 1462  function Download($path) { Line 1469  function Download($path) {
1469          // $A=Co : checkout file $D/$F          // $A=Co : checkout file $D/$F
1470          // $A=Ci : checkin file $D/$F          // $A=Ci : checkin file $D/$F
1471          // $A=V : view file (do nothing except log)          // $A=V : view file (do nothing except log)
1472            // $A=I : include file .$F.php from $gblFsRoot
1473          // default : display directory $D          // default : display directory $D
1474    
1475          switch ($A) {          switch ($A) {
# Line 1521  function Download($path) { Line 1529  function Download($path) {
1529                  DisplayChangeLog(1);                  DisplayChangeLog(1);
1530                  EndHTML() ;                  EndHTML() ;
1531                  exit;                  exit;
1532            case "I" :
1533                    $F=stripSlashes($F);
1534                    $inc_file="${gblFsRoot}/.${F}.php";
1535                    if (!isset($F) || $F == "" || !file_exists($inc_file)) Error("Fatal error $inc_file"); // can't find file to include
1536                    if (!is_readable($inc_file))
1537                            Error("Read access to include file denied",".${F}.php");
1538                    $text  = "Your include file should define \$text variable which holds this text and \$title variable which is page title";
1539                    $title = "You should define \$title variable with page title";
1540                    include($inc_file);
1541                    StartHTML($title, $text) ;
1542                    print "<p>".GifIcon(up)." Back to <a href=$GLOBALS[PHP_SELF]>front page</a>.</p>";
1543                    EndHTML() ;
1544                    exit ;
1545          }          }
1546    
1547          // default: display directory $relDir          // default: display directory $relDir

Legend:
Removed from v.1.48  
changed lines
  Added in v.1.49

  ViewVC Help
Powered by ViewVC 1.1.26