/[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.9 by dpavlin, Fri Aug 4 10:43:23 2000 UTC revision 1.13 by dpavlin, Wed Sep 6 10:49:15 2000 UTC
# Line 66  TODO: Line 66  TODO:
66          mixed file/directory output (add type to each entry,          mixed file/directory output (add type to each entry,
67                  real support for links)                  real support for links)
68          retrieve old versions of files (overwritten)          retrieve old versions of files (overwritten)
69            show last lock date
70            
71  */  */
72    
73  //////////////////////////////////////////////////////////////////  //////////////////////////////////////////////////////////////////
# Line 362  echo($fstr) ; ?></TEXTAREA> Line 364  echo($fstr) ; ?></TEXTAREA>
364    
365  <?php  <?php
366                    
367            $name=basename("$fsDir/$fn");
368          $logname=dirname("$fsDir/$fn")."/.log/".basename("$fsDir/$fn");          $logname=dirname("$fsDir/$fn")."/.log/$name";
369            $bakdir=dirname("$fsDir/$fn")."/.bak";
370          if (file_exists($logname)) {          if (file_exists($logname)) {
                 print "<hr><br><b>CHANGES TO THIS FILE</b><br><table border=0 width=100%>\n";  
371                  $log=fopen($logname,"r");                  $log=fopen($logname,"r");
372                  $cl1=" class=lst"; $cl2="";                  $cl1=" class=lst"; $cl2="";
373                    $logarr = array();
374                  while($line = fgetcsv($log,255,"\t")) {                  while($line = fgetcsv($log,255,"\t")) {
375                          $cl=$cl1; $cl1=$cl2; $cl2=$cl;                          $cl=$cl1; $cl1=$cl2; $cl2=$cl;
376                          print "<tr><td$cl>$line[0]</td><td$cl>$line[1]</td><td$cl>$line[2]</td><td$cl>$line[3]</td></tr>\n";                          array_unshift($logarr,array($cl,$line[0],$line[1],$line[2],$line[3]));
377                  }                  }
378                  fclose($log);                  fclose($log);
379                    print "<hr><br><b>CHANGES TO THIS FILE</b><br><table border=0 width=100%>\n";
380                    $bakcount = 0;  // start from 0, skip fist backup (it's current)
381                    while ($e = array_shift($logarr)) {
382                            if (strstr($e[4],"upload")) {
383                                    if (file_exists("$bakdir/$bakcount/$name")) {
384                                            $e[4]="<a href=\"".dirname($relPath)."/.bak/$bakcount/$name\">$e[4]</a>";
385                                    }
386                                    $bakcount++;
387                            }
388                            print "<tr><td$e[0]>$e[1]</td><td$e[0]>$e[2]</td><td$e[0]>$e[3]</td><td$e[0]>$e[4]</td></tr>\n";
389                    }
390                  print "</table>";                  print "</table>";
391          }          }
392    
# Line 831  function Navigate($fsRoot,$relDir) { Line 845  function Navigate($fsRoot,$relDir) {
845  <TR><TD></TD><TD COLSPAN=5><HR></TD></TR>  <TR><TD></TD><TD COLSPAN=5><HR></TD></TR>
846    
847  <TR><TD></TD><TD COLSPAN=5>  <TR><TD></TD><TD COLSPAN=5>
848  To just view file without editing, select it's filename (<b>don't edit files which are opened this way!</b>)<br>  <?
849  To <b>edit</b> file select <?= $gblIcon("checkout") ?> to check-out  if (file_exists(".info.inc")) {
850  and edit it locally. After editing is over, select filename or <?= $gblIcon("checkin") ?> to check-in (update copy of file on server).<br>          include(".info.inc");
851  <by>If you select icon left from filename, you will get detailed information  }
852  about file, as well as delete, rename and annotation options.  ?>
853  </TD></TR>  </TD></TR>
854    
855  <TR><TD></TD><TD COLSPAN=5><HR></TD></TR>  <TR><TD></TD><TD COLSPAN=5><HR></TD></TR>
# Line 1287  function safe_rename($from,$to) { Line 1301  function safe_rename($from,$to) {
1301                  safe_rename("$fsDir/.log/$FN","$fsDir/.log/$NEWNAME");                  safe_rename("$fsDir/.log/$FN","$fsDir/.log/$NEWNAME");
1302                  safe_rename("$fsDir/.note/$FN","$fsDir/.note/$NEWNAME");                  safe_rename("$fsDir/.note/$FN","$fsDir/.note/$NEWNAME");
1303                  safe_rename("$fsDir/.lock/$FN","$fsDir/.lock/$NEWNAME");                  safe_rename("$fsDir/.lock/$FN","$fsDir/.lock/$NEWNAME");
1304                    for($i=0;$i<=$GLOBALS[gblNumBackups];$i++) {
1305                            safe_rename("$fsDir/.bak/$i/$FN","$fsDir/.bak/$i/$NEWNAME");
1306                    }
1307    
1308                  break ;                  break ;
1309    
# Line 1341  function safe_rename($from,$to) { Line 1358  function safe_rename($from,$to) {
1358          case "Co" :          case "Co" :
1359                  // checkout                  // checkout
1360                  Lock("$gblFsRoot/$relDir/$F");                  Lock("$gblFsRoot/$relDir/$F");
1361                    header("Content-Disposition: attachment; filename=$F" );
1362                  Header("Location: ".urlpath("$relDir/$F"));                  Header("Location: ".urlpath("$relDir/$F"));
1363                  exit;                  exit;
1364          case "Ci" :          case "Ci" :
# Line 1356  function safe_rename($from,$to) { Line 1374  function safe_rename($from,$to) {
1374          case "V" :          case "V" :
1375                  // view                  // view
1376                  LogIt("$gblFsRoot/$relDir/$F","viewed");                  LogIt("$gblFsRoot/$relDir/$F","viewed");
1377                    header("Content-Disposition: attachment; filename=$F" );
1378                  Header("Location: ".urlpath("$relDir/$F"));                  Header("Location: ".urlpath("$relDir/$F"));
1379                  exit;                  exit;
1380          }          }

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.26