/[docman]/include_php/tree.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

Contents of /include_php/tree.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations)
Sun Dec 16 10:33:10 2001 UTC (22 years, 4 months ago) by dpavlin
Branch: MAIN
Changes since 1.1: +4 -2 lines
display file note and filename

1 <?php
2
3 /*
4 this is a demo include file which displays all documents with links to
5 their detail pages
6
7 Usage:
8
9 1) copy tree.php into .tree.php in root directory of
10 your docman's repository
11
12 2) write in .info.inc file:
13
14 <a href="?A=I&F=tree">tree</a>
15
16 and you will get tree view of your whole repository with links
17 to file details
18
19 Written by Dobrica Pavlinusic <dpavlin@rot13.org> 2001-12-15
20 */
21
22 global $title,$text;
23
24 $title = "Overview of all documents";
25 $text = "Here is general overview of all documents stored here";
26
27 class tree {
28 var $h;
29 var $out;
30
31 function recurse($path) {
32 $this->out.="<ul>\n";
33 $this->h=opendir($path);
34 while ($file = readdir($this->h)) {
35 if (substr($file,0,1) != ".") {
36 if (is_dir("$path/$file")) {
37 $link="<b>".$file."</b> <small>".ReadNote("$path/$file")."</small>";
38 $this->out.="<li> $link";
39 $new_t=new tree();
40 $new_t->recurse("$path/$file");
41 $this->out.=$new_t->out;
42 } else {
43 //$this->out.="<li> $file\n";
44 $dir=substr($path,strlen($GLOBALS[gblFsRoot]),strlen($path)-strlen($GLOBALS[gblFsRoot]));
45 $link=$file." <small>".ReadNote("$path/$file")."</small>";
46 $this->out.="<li> <a href=\"?A=E&F=".urlencode($file)."&D=".urlencode($dir)."\">$link</a>\n";
47 }
48 }
49 }
50 closedir($this->h);
51 $this->out.="</ul>\n";
52 }
53 }
54
55 $t=new tree();
56 $t->recurse($gblFsRoot);
57 $text .= "<hr>\n".$t->out;
58
59 ?>

  ViewVC Help
Powered by ViewVC 1.1.26