1: # The LearningOnline Network with CAPA
2: # Directory Indexer
3: #
4: # $Id: lonindexer.pm,v 1.97 2004/03/30 02:50:27 www Exp $
5: #
6: # Copyright Michigan State University Board of Trustees
7: #
8: # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
9: #
10: # LON-CAPA is free software; you can redistribute it and/or modify
11: # it under the terms of the GNU General Public License as published by
12: # the Free Software Foundation; either version 2 of the License, or
13: # (at your option) any later version.
14: #
15: # LON-CAPA is distributed in the hope that it will be useful,
16: # but WITHOUT ANY WARRANTY; without even the implied warranty of
17: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18: # GNU General Public License for more details.
19: #
20: # You should have received a copy of the GNU General Public License
21: # along with LON-CAPA; if not, write to the Free Software
22: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23: #
24: # /home/httpd/html/adm/gpl.txt
25: #
26: # http://www.lon-capa.org/
27: #
28: ###
29:
30: ###############################################################################
31: ## ##
32: ## ORGANIZATION OF THIS PERL MODULE ##
33: ## ##
34: ## 1. Description of functions ##
35: ## 2. Modules used by this module ##
36: ## 3. Choices for different output views (detailed, summary, xml, etc) ##
37: ## 4. BEGIN block (to be run once after compilation) ##
38: ## 5. Handling routine called via Apache and mod_perl ##
39: ## 6. Other subroutines ##
40: ## ##
41: ###############################################################################
42:
43: package Apache::lonindexer;
44:
45: # ------------------------------------------------- modules used by this module
46: use strict;
47: use Apache::lonnet();
48: use Apache::loncommon();
49: use Apache::lonhtmlcommon();
50: use Apache::lonsequence();
51: use Apache::Constants qw(:common);
52: use Apache::lonmeta;
53: use Apache::File;
54: use Apache::lonlocal;
55: use GDBM_File;
56:
57: # ---------------------------------------- variables used throughout the module
58: my %hash; # global user-specific gdbm file
59: my %dirs; # keys are directories, values are the open/close status
60: my %language; # has the reference information present in language.tab
61:
62: # ----- Values which are set by the handler subroutine and are accessible to
63: # ----- other methods.
64: my $extrafield; # default extra table cell
65: my $fnum; # file counter
66: my $dnum; # directory counter
67:
68: # ----- Used to include or exclude files with certain extensions.
69: my @Only = ();
70: my @Omit = ();
71:
72:
73: # ----------------------------- Handling routine called via Apache and mod_perl
74: sub handler {
75: my $r = shift;
76: my $c = $r->connection();
77: &Apache::loncommon::content_type($r,'text/html');
78: &Apache::loncommon::no_cache($r);
79: $r->send_http_header;
80: return OK if $r->header_only;
81: $fnum=0;
82: $dnum=0;
83:
84: # Deal with stupid global variables (is there a way around making
85: # these global to this package? It is just so wrong....)
86: undef (@Only);
87: undef (@Omit);
88:
89: # ------------------------------------- read in machine configuration variables
90: my $iconpath= $r->dir_config('lonIconsURL') . "/";
91: my $domain = $r->dir_config('lonDefDomain');
92: my $role = $r->dir_config('lonRole');
93: my $loadlim = $r->dir_config('lonLoadLim');
94: my $servadm = $r->dir_config('lonAdmEMail');
95: my $sysadm = $r->dir_config('lonSysEMail');
96: my $lonhost = $r->dir_config('lonHostID');
97: my $tabdir = $r->dir_config('lonTabDir');
98:
99: my $fileclr='#ffffe6';
100: my $line;
101: my (@attrchk,@openpath);
102: my $uri=$r->uri;
103:
104: # -------------------------------------- see if called from an interactive mode
105: # Get the parameters from the query string
106: &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
107: ['catalogmode','launch','acts','mode','form','element',
108: 'only','omit','titleelement']);
109: #-------------------------------------------------------------------
110: my $closebutton='';
111: my $groupimportbutton='';
112: my $colspan='';
113:
114: $extrafield='';
115: my $diropendb =
116: "/home/httpd/perl/tmp/$ENV{'user.domain'}_$ENV{'user.name'}_indexer.db";
117: %hash = ();
118: {
119: my %dbfile;
120: if (tie(%dbfile,'GDBM_File',$diropendb,&GDBM_READER(),0640)) {
121: while(my($key,$value)=each(%dbfile)) {
122: $hash{$key}=$value;
123: }
124: untie(%dbfile);
125: }
126: }
127: {
128: if ($ENV{'form.launch'} eq '1') {
129: &start_fresh_session();
130: }
131: # -------------------- refresh environment with user database values (in %hash)
132: &setvalues(\%hash,'form.catalogmode',\%ENV,'form.catalogmode' );
133:
134: # --------------------- define extra fields and buttons in case of special mode
135: if ($ENV{'form.catalogmode'} eq 'interactive') {
136: $extrafield='<td bgcolor="'.$fileclr.'" valign="bottom">'.
137: '<a name="$anchor"><img src="'.$iconpath.'whitespace1.gif"'.
138: ' border="0" /></td>';
139: $colspan=" colspan='2' ";
140: my $cl=&mt('Close');
141: $closebutton=<<END;
142: <input type="button" name="close" value='$cl' onClick="self.close()">
143: END
144: }
145: elsif ($ENV{'form.catalogmode'} eq 'groupimport') {
146: $extrafield='<td bgcolor="'.$fileclr.'" valign="bottom">'.
147: '<a name="$anchor"><img src="'.$iconpath.'whitespace1.gif"'.
148: ' border="0" /></td>';
149: $colspan=" colspan='2' ";
150: my $cl=&mt('Close');
151: my $gi=&mt('Group Import');
152: $closebutton=<<END;
153: <input type="button" name="close" value='$cl' onClick="self.close()">
154: END
155: $groupimportbutton=<<END;
156: <input type="button" name="groupimport" value='$gi'
157: onClick="javascript:select_group()">
158: END
159: }
160: # Additions made by Matthew to make the browser a little easier to deal
161: # with in the future.
162: #
163: # $mode (at this time) indicates if we are in edit mode.
164: # $form is the name of the form that the URL is placed when the
165: # selection is made.
166: # $element is the name of the element in $formname which receives
167: # the URL.
168: #&Apache::lonxml::debug('Checking mode, form, element');
169: &setvalues(\%hash,'form.mode' ,\%ENV,'form.mode' );
170: &setvalues(\%hash,'form.form' ,\%ENV,'form.form' );
171: &setvalues(\%hash,'form.element' ,\%ENV,'form.element');
172: &setvalues(\%hash,'form.titleelement',\%ENV,'form.titleelement');
173: &setvalues(\%hash,'form.only' ,\%ENV,'form.only' );
174: &setvalues(\%hash,'form.omit' ,\%ENV,'form.omit' );
175:
176: # Deal with 'omit' and 'only'
177: if (exists $ENV{'form.omit'}) {
178: @Omit = split(',',$ENV{'form.omit'});
179: }
180: if (exists $ENV{'form.only'}) {
181: @Only = split(',',$ENV{'form.only'});
182: }
183:
184: my $mode = $ENV{'form.mode'};
185: my ($form,$element,$titleelement);
186: if ($mode eq 'edit' || $mode eq 'parmset') {
187: $form = $ENV{'form.form'};
188: $element = $ENV{'form.element'};
189: $titleelement = $ENV{'form.titleelement'};
190: }
191: #&Apache::lonxml::debug("mode=$mode form=$form element=$element titleelement=$titleelement");
192: # ------ set catalogmodefunctions to have extra needed javascript functionality
193: my $catalogmodefunctions='';
194: if ($ENV{'form.catalogmode'} eq 'interactive' or
195: $ENV{'form.catalogmode'} eq 'groupimport') {
196: # The if statement below sets us up to use the old version
197: # by default (ie. if $mode is undefined). This is the easy
198: # way out. Hopefully in the future I'll find a way to get
199: # the calls dealt with in a more comprehensive manner.
200:
201: #
202: # There is now also mode "simple", which is for the simple version of the rat
203: #
204: #
205: if (!defined($mode) || ($mode ne 'edit' && $mode ne 'parmset')) {
206: my $location = "/adm/groupsort?catalogmode=groupimport&";
207: $location .= "mode=".$mode."&";
208: $location .= "acts=";
209: $catalogmodefunctions=<<"END";
210: function select_data(title,url) {
211: changeTitle(title);
212: changeURL(url);
213: self.close();
214: }
215: function select_group() {
216: window.location="$location"+document.forms.fileattr.acts.value;
217: }
218: function changeTitle(val) {
219: if (opener.inf) {
220: if (opener.inf.document.forms.resinfo.elements.t) {
221: opener.inf.document.forms.resinfo.elements.t.value=val;
222: }
223: }
224: }
225: function changeURL(val) {
226: if (opener.inf) {
227: if (opener.inf.document.forms.resinfo.elements.u) {
228: opener.inf.document.forms.resinfo.elements.u.value=val;
229: }
230: }
231: }
232: END
233: } elsif ($mode eq 'edit') { # we are in 'edit' mode
234: my $location = "/adm/groupsort?catalogmode=interactive&";
235: $location .= "form=$form&element=$element&mode=edit&acts=";
236: $catalogmodefunctions=<<END;
237: // mode = $mode
238: function select_data(title,url) {
239: changeURL(url);
240: changeTitle(title);
241: self.close();
242: }
243:
244: function select_group() {
245: window.location="$location"+document.forms.fileattr.acts.value;
246: }
247:
248: function changeURL(val) {
249: if (window.opener.document) {
250: window.opener.document.forms["$form"].elements["$element"].value=val;
251: } else {
252: alert("The file you selected is: "+val);
253: }
254: }
255: END
256: if (!$titleelement) {
257: $catalogmodefunctions.='function changeTitle(val) {}';
258: } else {
259: $catalogmodefunctions.=<<END;
260: function changeTitle(val) {
261: if (window.opener.document) {
262: window.opener.document.forms["$form"].elements["$titleelement"].value=val;
263: } else {
264: alert("The title of the file you selected is: "+val);
265: }
266: }
267: END
268: }
269: } elsif ($mode eq 'parmset') {
270: my $location = "/adm/groupsort?catalogmode=interactive&";
271: $location .= "form=$form&element=$element&mode=parmset&acts=";
272: $catalogmodefunctions=<<END;
273: // mode = $mode
274: function select_data(title,url) {
275: changeURL(url);
276: self.close();
277: }
278:
279: function select_group() {
280: window.location="$location"+document.forms.fileattr.acts.value;
281: }
282:
283: function changeURL(val) {
284: if (window.opener.document) {
285: var elementname = "$element"+"_value";
286: var checkboxname = "$element"+"_setparmval";
287: window.opener.document.forms["$form"].elements[elementname].value=val;
288: window.opener.document.forms["$form"].elements[checkboxname].checked=true;
289: } else {
290: alert("The file you selected is: "+val);
291: }
292: }
293:
294: END
295: }
296: }
297: $catalogmodefunctions.=<<END;
298: var acts='';
299: function rep_dirpath(suffix,val) {
300: eval("document.forms.dirpath"+suffix+".acts.value=val");
301: }
302: END
303: if ($ENV{'form.catalogmode'} eq 'groupimport') {
304: $catalogmodefunctions.=<<END;
305: function queue(val) {
306: if (eval("document.forms."+val+".filelink.checked")) {
307: var l=val.length;
308: var v=val.substring(4,l);
309: document.forms.fileattr.acts.value+='1a'+v+'b';
310: }
311: else {
312: var l=val.length;
313: var v=val.substring(4,l);
314: document.forms.fileattr.acts.value+='0a'+v+'b';
315: }
316: }
317: END
318: }
319:
320: # ---------------------------------------------------------------- Print Header
321: $r->print(<<ENDHEADER);
322: <html>
323: <head>
324: <title>The LearningOnline Network With CAPA Directory Browser</title>
325:
326: <script type="text/javascript">
327: $catalogmodefunctions
328: function openWindow(url, wdwName, w, h, toolbar,scrollbar,locationbar) {
329: var xpos = (screen.width-w)/2;
330: xpos = (xpos < 0) ? '0' : xpos;
331: var ypos = (screen.height-h)/2-30;
332: ypos = (ypos < 0) ? '0' : ypos;
333: var options = "width=" + w + ",height=" + h + ",screenx="+xpos+",screeny="+ypos+",";
334: options += "resizable=yes,scrollbars="+scrollbar+",status=no,";
335: options += "menubar=no,toolbar="+toolbar+",location="+locationbar+",directories=no";
336: var newWin = window.open(url, wdwName, options);
337: newWin.focus();
338: }
339: function gothere(val) {
340: window.location=val+'?acts='+document.forms.fileattr.acts.value;
341: }
342: </script>
343:
344: </head>
345: ENDHEADER
346: my ($headerdom)=($uri=~/^\/res\/(\w+)\//);
347: $r->print(&Apache::loncommon::bodytag('Browse Resources',undef,undef,undef,
348: $headerdom));
349: # - Evaluate actions from previous page (both cumulatively and chronologically)
350: if ($ENV{'form.catalogmode'} eq 'groupimport') {
351: my $acts=$ENV{'form.acts'};
352: my @Acts=split(/b/,$acts);
353: my %ahash;
354: my %achash;
355: my $ac=0;
356: # some initial hashes for working with data
357: foreach (@Acts) {
358: my ($state,$ref)=split(/a/);
359: $ahash{$ref}=$state;
360: $achash{$ref}=$ac;
361: $ac++;
362: }
363: # sorting through the actions and changing the global database hash
364: foreach (sort {$achash{$a}<=>$achash{$b}} (keys %ahash)) {
365: my $key=$_;
366: if ($ahash{$key} eq '1') {
367: $hash{'store_'.$hash{'pre_'.$key.'_link'}}=
368: $hash{'pre_'.$key.'_title'};
369: $hash{'storectr_'.$hash{'pre_'.$key.'_link'}}=
370: $hash{'storectr'}+0;
371: $hash{'storectr'}++;
372: }
373: if ($ahash{$key} eq '0') {
374: if ($hash{'store_'.$hash{'pre_'.$key.'_link'}}) {
375: delete $hash{'store_'.$hash{'pre_'.$key.'_link'}};
376: }
377: }
378: }
379: # deleting the previously cached listing
380: foreach (keys %hash) {
381: if ($_ =~ /^pre_/ && $_ =~/link$/) {
382: my $key = $_;
383: $key =~ s/^pre_//;
384: $key =~ s/_[^_]*$//;
385: delete $hash{'pre_'.$key.'_title'};
386: delete $hash{'pre_'.$key.'_link'};
387: }
388: }
389: }
390:
391: # ---------------------------------- get state of file attributes to be showing
392: if ($ENV{'form.attrs'}) {
393: for (my $i=0; $i<=9; $i++) {
394: delete $hash{'display_attrs_'.$i};
395: if ($ENV{'form.attr'.$i} == 1) {
396: $attrchk[$i] = 'checked';
397: $hash{'display_attrs_'.$i} = 1;
398: }
399: }
400: } else {
401: for (my $i=0; $i<=9; $i++) {
402: $attrchk[$i] = 'checked' if $hash{'display_attrs_'.$i} == 1;
403: }
404: }
405:
406: # ------------------------------- output state of file attributes to be showing
407: # All versions has to the last item
408: # since it does not take an extra col
409: my %lt=&Apache::lonlocal::texthash(
410: 'ti' => 'Title',
411: 'si' => 'Size',
412: 'la' => 'Last access',
413: 'lm' => 'Last modified',
414: 'st' => 'Statistics',
415: 'au' => 'Author',
416: 'kw' => 'Keywords',
417: 'ln' => 'Language',
418: 'sr' => 'Show resource',
419: 'av' => 'All versions',
420: 'ud' => 'Update Display'
421: );
422: my $Displayfileattributes=&mt('Display file attributes');
423: $r->print(<<END);
424: <form method="post" name="fileattr" action="$uri"
425: enctype="application/x-www-form-urlencoded">
426: <b><font color="#666666">$Displayfileattributes</font></b><br />
427: <table border=0><tr>
428: <td><input type="checkbox" name="attr0" value="1" $attrchk[0] onClick="this.form.submit();" /> $lt{'ti'}</td>
429: <td><input type="checkbox" name="attr1" value="1" $attrchk[1] onClick="this.form.submit();" /> $lt{'si'}</td>
430: <td><input type="checkbox" name="attr2" value="1" $attrchk[2] onClick="this.form.submit();" /> $lt{'la'}</td>
431: <td><input type="checkbox" name="attr3" value="1" $attrchk[3] onClick="this.form.submit();" /> $lt{'lm'}</td>
432: <td><input type="checkbox" name="attr8" value="1" $attrchk[8] onClick="this.form.submit();" /> $lt{'st'}</td>
433: </tr><tr>
434: <td><input type="checkbox" name="attr4" value="1" $attrchk[4] onClick="this.form.submit();" /> $lt{'au'}</td>
435: <td><input type="checkbox" name="attr5" value="1" $attrchk[5] onClick="this.form.submit();" /> $lt{'kw'}</td>
436: <td><input type="checkbox" name="attr6" value="1" $attrchk[6] onClick="this.form.submit();" /> $lt{'ln'}</td>
437: <td><input type="checkbox" name="attr7" value="1" $attrchk[7] onClick="this.form.submit();" /> $lt{'sr'}</td>
438: <td><input type="checkbox" name="attr9" value="1" $attrchk[9] onClick="this.form.submit();" /> $lt{'av'}</td>
439: <td> </td>
440: </tr></table>
441: <input type="hidden" name="attrs" value="1" />
442: <input type="submit" name="updatedisplay" value="$lt{'ud'}" />
443: <input type="hidden" name="acts" value="" />
444: $closebutton $groupimportbutton
445: END
446: # -------------- Filter out sequence containment in crumbs and "recent folders"
447: my $storeuri=$uri;
448: $storeuri='/'.(split(/\.(page|sequence)\/\//,$uri))[-1];
449: $storeuri=~s/\/+/\//g;
450: # ---------------------------------------------------------------- Bread crumbs
451: $r->print(&Apache::lonhtmlcommon::crumbs($storeuri,'','',
452: (($ENV{'form.catalogmode'} eq 'groupimport')?
453: 'document.forms.fileattr':'')).
454: &Apache::lonhtmlcommon::select_recent('residx','resrecent',
455: 'this.form.action=this.form.resrecent.options[this.form.resrecent.selectedIndex].value;this.form.submit();').
456: '</form>');
457: # ------------------------------------------------------ Remember where we were
458: &Apache::loncommon::storeresurl($storeuri);
459: &Apache::lonhtmlcommon::store_recent('residx',$storeuri,$storeuri);
460: # ----------------- output starting row to the indexed file/directory hierarchy
461: my $titleclr="#ddffff";
462: # $r->print(&initdebug());
463: # $r->print(&writedebug("Omit:@Omit")) if (@Omit);
464: # $r->print(&writedebug("Only:@Only")) if (@Only);
465: $r->print("<table width='100\%' border=0><tr><td bgcolor=#777777>\n");
466: $r->print("<table width='100\%' border=0><tr bgcolor=$titleclr>\n");
467: $r->print("<td $colspan><b>".&mt('Name')."</b></td>\n");
468: $r->print("<td><b>".&mt('Title')."</b></td>\n")
469: if ($hash{'display_attrs_0'} == 1);
470: $r->print("<td align=right><b>".&mt("Size")." (".&mt("bytes").") ".
471: "</b></td>\n") if ($hash{'display_attrs_1'} == 1);
472: $r->print("<td><b>".&mt("Last accessed")."</b></td>\n")
473: if ($hash{'display_attrs_2'} == 1);
474: $r->print("<td><b>".&mt("Last modified")."</b></td>\n")
475: if ($hash{'display_attrs_3'} == 1);
476: $r->print("<td><b>".&mt("Author(s)")."</b></td>\n")
477: if ($hash{'display_attrs_4'} == 1);
478: $r->print("<td><b>".&mt("Keywords")."</b></td>\n")
479: if ($hash{'display_attrs_5'} == 1);
480: $r->print("<td><b>".&mt("Language")."</b></td>\n")
481: if ($hash{'display_attrs_6'} == 1);
482: $r->print("<td><b>".&mt("Resource")."</b></td>\n")
483: if ($hash{'display_attrs_7'} == 1);
484: $r->print("<td><b>".&mt("Usage Statistics")." <br />(".
485: &mt("Courses/Network Hits").")</b></td>\n")
486: if ($hash{'display_attrs_8'} == 1);
487: $r->print('</tr>');
488:
489: # ----------------- read in what directories have previously been set to "open"
490: foreach (keys %hash) {
491: if ($_ =~ /^diropen_status_/) {
492: my $key = $_;
493: $key =~ s/^diropen_status_//;
494: $dirs{$key} = $hash{$_};
495: }
496: }
497:
498: if ($ENV{'form.openuri'}) { # take care of review and refresh options
499: my $uri=$ENV{'form.openuri'};
500: if (exists($hash{'diropen_status_'.$uri})) {
501: my $cursta = $hash{'diropen_status_'.$uri};
502: $dirs{$uri} = 'open';
503: $hash{'diropen_status_'.$uri} = 'open';
504: if ($cursta eq 'open') {
505: $dirs{$uri} = 'closed';
506: $hash{'diropen_status_'.$uri} = 'closed';
507: }
508: } else {
509: $hash{'diropen_status_'.$uri} = 'open';
510: $dirs{$uri} = 'open';
511: }
512: }
513:
514: my $toplevel;
515: my $indent = 0;
516: $uri = $uri.'/' if $uri !~ /.*\/$/;
517:
518: if ($ENV{'form.dirPointer'} ne 'on') {
519: $hash{'top.level'} = $uri;
520: $toplevel = $uri;
521: } else {
522: $toplevel = $hash{'top.level'};
523: }
524:
525: # -------------------------------- if not at top level, provide an uplink arrow
526: if ($toplevel ne '/res/'){
527: my (@uri_com) = split(/\//,$uri);
528: pop @uri_com;
529: my $upone = join('/',@uri_com);
530: my @list = qw (0);
531: &display_line ($r,'opened',$upone.'&viewOneUp',0,$upone,@list);
532: $indent = 1;
533: }
534:
535: # -------- recursively go through all the directories and output as appropriate
536: &scanDir ($r,$toplevel,$indent,\%hash);
537:
538: # ---------------------------- embed hidden information useful for group import
539: $r->print("<form name='fnum'>");
540: $r->print("<input type='hidden' name='fnum' value='$fnum'></form>");
541:
542: # -------------------------------------------------------------- end the tables
543: $r->print('</table>');
544: $r->print('</td></tr></table>');
545:
546: # --------------------------------------------------- end the output and return
547: $r->print('</body></html>'."\n");
548: }
549: if(! $c->aborted()) {
550: # write back into the temporary file
551: my %dbfile;
552: if (tie(%dbfile,'GDBM_File',$diropendb,&GDBM_NEWDB(),0640)) {
553: while (my($key,$value) = each(%hash)) {
554: $dbfile{$key}=$value;
555: }
556: untie(%dbfile);
557: }
558: }
559:
560: return OK;
561: }
562:
563: # ----------------------------------------------- recursive scan of a directory
564: sub scanDir {
565: my ($r,$startdir,$indent,$hashref)=@_;
566: my $c = $r->connection();
567: my ($compuri,$curdir);
568: my $dirptr=16384;
569: my $obs;
570: $indent++;
571: my %dupdirs = %dirs;
572: my @list=&get_list($r,$startdir);
573: foreach my $line (@list) {
574: return if ($c->aborted());
575: #This is a kludge, sorry aboot this
576: my ($strip,$dom,undef,$testdir,undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,$obs,undef)=split(/\&/,$line,16);
577: next if($strip =~ /.*\.meta$/ | $obs eq '1');
578: my (@fileparts) = split(/\./,$strip);
579: if ($hash{'display_attrs_9'} != 1) {
580: # if not all versions to be shown
581: if (scalar(@fileparts) >= 3) {
582: my $fext = pop @fileparts;
583: my $ov = pop @fileparts;
584: my $fname = join ('.',@fileparts,$fext);
585: next if (grep /\Q$fname\E/,@list and $ov =~ /^\d+$/);
586: }
587: }
588:
589: if ($dom eq 'domain') {
590: # dom list has full path /res/<domain name>/ already
591: $curdir='';
592: $compuri = (split(/\&/,$line))[0];
593: } else {
594: # user, dir & file have name only, i.e., w/o path
595: $compuri = join('',$startdir,$strip,'/');
596: $curdir = $startdir;
597: }
598: my $diropen = 'closed';
599: if (($dirptr&$testdir) or ($dom =~ /^(domain|user)$/) or ($compuri=~/\.(sequence|page)\/$/)) {
600: while (my ($key,$val)= each %dupdirs) {
601: if ($key eq $compuri and $val eq "open") {
602: $diropen = "opened";
603: delete($dupdirs{$key});
604: delete($dirs{$key});
605: }
606: }
607: }
608: &display_line($r,$diropen,$line,$indent,$curdir,$hashref,@list);
609: &scanDir ($r,$compuri,$indent) if $diropen eq 'opened';
610: }
611: $indent--;
612: }
613:
614: # --------------- get complete matched list based on the uri (returns an array)
615: sub get_list {
616: my ($r,$uri)=@_;
617: my @list=();
618: (my $luri = $uri) =~ s/\//_/g;
619: if ($ENV{'form.updatedisplay'}) {
620: foreach (keys %hash) {
621: delete $hash{$_} if ($_ =~ /^dirlist_files_/);
622: }
623: }
624:
625: if ($hash{'dirlist_files_'.$luri}) {
626: @list = split(/\n/,$hash{'dirlist_files_'.$luri});
627: } elsif ($uri=~/\.(page|sequence)\/$/) {
628: # is a page or a sequence
629: $uri=~s/\/$//;
630: $uri='/'.(split(/\.(page|sequence)\/\//,$uri))[-1];
631: $uri=~s/\/+/\//g;
632: foreach (&Apache::lonsequence::attemptread(&Apache::lonnet::filelocation('',$uri))) {
633: my @ratpart=split(/\:/,$_);
634: push @list,$ratpart[1];
635: }
636: $hash{'dirlist_files_'.$luri} = join("\n",@list);
637: } else {
638: # is really a directory
639: @list = &Apache::lonnet::dirlist($uri);
640: $hash{'dirlist_files_'.$luri} = join("\n",@list);
641: }
642: return @list=&match_ext($r,@list);
643: }
644:
645: sub initdebug {
646: return <<ENDJS;
647: <script>
648: var debugging = true;
649: if (debugging) {
650: var debuggingWindow = window.open('','Debug','width=400,height=300',true);
651: }
652:
653: function output(text) {
654: if (debugging) {
655: debuggingWindow.document.writeln(text);
656: }
657: }
658: output("<html><head><title>Debugging Window</title></head><body><pre>");
659: </script>
660: ENDJS
661: }
662:
663: sub writedebug {
664: my $text = shift;
665: return "<script>output('$text');</script>";
666: }
667:
668: # -------------------- filters out files based on extensions (returns an array)
669: sub match_ext {
670: my ($r,@packlist)=@_;
671: my @trimlist;
672: my $nextline;
673: my @fileext;
674: my $dirptr=16384;
675:
676: foreach my $line (@packlist) {
677: chomp $line;
678: $line =~ s/^\/home\/httpd\/html//;
679: my @unpackline = split (/\&/,$line);
680: next if ($unpackline[0] eq '.');
681: next if ($unpackline[0] eq '..');
682: my @filecom = split (/\./,$unpackline[0]);
683: my $fext = pop(@filecom);
684: my $fnptr = ($unpackline[3]&$dirptr) || ($fext=~/\.(page|sequence)$/);
685: if ($fnptr == 0 and $unpackline[3] ne "") {
686: my $embstyle = &Apache::loncommon::fileembstyle($fext);
687: push @trimlist,$line if (defined($embstyle) &&
688: ($embstyle ne 'hdn' or $fext eq 'meta'));
689: } else {
690: push @trimlist,$line;
691: }
692: }
693: @trimlist = sort {uc($a) cmp uc($b)} (@trimlist);
694: return @trimlist;
695: }
696:
697: # ------------------------------- displays one line in appropriate table format
698: sub display_line {
699: my ($r,$diropen,$line,$indent,$startdir,$hashref,@list)=@_;
700: my (@pathfn, $fndir);
701: # there could be relative paths (files actually belonging into this directory)
702: # or absolute paths (for example, from sequences)
703: my $absolute;
704: my $pathprefix;
705: if ($line=~/^\/res\//) {
706: $absolute=1;
707: $pathprefix='';
708: } else {
709: $absolute=0;
710: $pathprefix=$startdir;
711: }
712: my $dirptr=16384;
713: my $fileclr="#ffffe6";
714: my $iconpath= $r->dir_config('lonIconsURL') . '/';
715:
716: my @filecom = split (/\&/,$line);
717: my @pathcom = split (/\//,$filecom[0]);
718: my $listname = $pathcom[scalar(@pathcom)-1];
719: my $fnptr = $filecom[3]&$dirptr;
720: my $msg = &mt('View').' '.$filecom[0].' '.&mt('resources');
721: $msg = &mt('Close').' '.$filecom[0].' '.&mt('directory') if $diropen eq 'opened';
722:
723: my $tabtag='</td>';
724: my $i=0;
725: while ($i<=8) {
726: $tabtag=join('',$tabtag,"<td> </td>")
727: if $hash{'display_attrs_'.$i} == 1;
728: $i++;
729: }
730:
731: my $valign = ($hash{'display_attrs_7'} == 1 ? 'top' : 'bottom');
732:
733: # display uplink arrow
734: if ($filecom[1] eq 'viewOneUp') {
735: $r->print("<tr valign='$valign' bgcolor=$fileclr>$extrafield");
736: $r->print("<td>\n");
737: $r->print ('<form method="post" name="dirpathUP" action="'.$startdir.
738: '/" '.
739: 'onSubmit="return rep_dirpath(\'UP\','.
740: 'document.forms.fileattr.acts.value)" '.
741: 'enctype="application/x-www-form-urlencoded"'.
742: '>'."\n");
743: $r->print ('<input type=hidden name=openuri value="'.
744: $startdir.'">'."\n");
745: $r->print ('<input type="hidden" name="acts" value="">'."\n");
746: $r->print ('<input src="'.$iconpath.'arrow_up.gif"');
747: $r->print (' name="'.$msg.'" height="22" type="image" border="0">'.
748: "\n");
749: $r->print(&mt("Up")." $tabtag</tr></form>\n");
750: return OK;
751: }
752: # Do we have permission to look at this?
753:
754: if($filecom[15] ne '1') { return OK if (!&Apache::lonnet::allowed('bre',$pathprefix.$filecom[0])); }
755:
756: # make absolute links appear on different background
757: if ($absolute) { $fileclr='#aaaa88'; }
758:
759: # display domain
760: if ($filecom[1] eq 'domain') {
761: $r->print ('<input type="hidden" name="dirPointer" value="on">'."\n")
762: if ($ENV{'form.dirPointer'} eq "on");
763: $r->print("<tr valign='$valign' bgcolor=$fileclr>$extrafield");
764: $r->print("<td>");
765: &begin_form ($r,$filecom[0]);
766: my $anchor = $filecom[0];
767: $anchor =~ s/\///g;
768: $r->print ('<a name="'.$anchor.'">');
769: $r->print ('<input type="hidden" name="acts" value="">');
770: $r->print ('<input src="'.$iconpath.'folder_pointer_'.
771: $diropen.'.gif"');
772: $r->print (' name="'.$msg.'" height="22" type="image" border="0">'.
773: "\n");
774: $r->print ('<a href="javascript:gothere(\''.$filecom[0].
775: '\')"><img src="'.$iconpath.'server.gif"');
776: $r->print (' border="0" /></a>'."\n");
777: $r->print (&mt("Domain")." - $listname ");
778: if ($Apache::lonnet::domaindescription{$listname}) {
779: $r->print("(".$Apache::lonnet::domaindescription{$listname}.
780: ")");
781: }
782: $r->print (" $tabtag</tr></form>\n");
783: return OK;
784:
785: # display user directory
786: }
787: if ($filecom[1] eq 'user') {
788: $r->print("<tr valign=$valign bgcolor=$fileclr>$extrafield");
789: $r->print("<td nowrap>\n");
790: my $curdir = $startdir.$filecom[0].'/';
791: my $anchor = $curdir;
792: $anchor =~ s/\///g;
793: &begin_form ($r,$curdir);
794: $r->print ('<a name="'.$anchor.'"><img src="'.$iconpath.
795: 'whitespace1.gif" border="0" />'."\n");
796: $r->print ('<input type="hidden" name="acts" value="">');
797: $r->print ('<input src="'.$iconpath.'folder_pointer_'.$diropen.
798: '.gif"');
799: $r->print (' name="'.$msg.'" height="22" type="image" border="0">'.
800: "\n");
801: $r->print ('<a href="javascript:gothere(\''.$curdir.'\')"><img src='.
802: $iconpath.'quill.gif border="0" name="'.$msg.
803: '" height="22" /></a>');
804: my $domain=(split(m|/|,$startdir))[2];
805: my $plainname=&Apache::loncommon::plainname($listname,$domain);
806: $r->print ($listname);
807: if (defined($plainname) && $plainname) { $r->print(" ($plainname) "); }
808: $r->print ($tabtag.'</tr></form>'."\n");
809: return OK;
810: }
811:
812: # display file
813: if (($fnptr == 0 and $filecom[3] ne '') or $absolute) {
814: my $filelink = $pathprefix.$filecom[0];
815: my @file_ext = split (/\./,$listname);
816: my $curfext = $file_ext[-1];
817: if (@Omit) {
818: foreach (@Omit) { return OK if ($curfext eq $_); }
819: }
820: if (@Only) {
821: my $skip = 1;
822: foreach (@Only) { $skip = 0 if ($curfext eq $_); }
823: return OK if ($skip > 0);
824: }
825: # Set the icon for the file
826: my $iconname = &Apache::loncommon::icon($listname);
827: $r->print("<tr valign='$valign' bgcolor=$fileclr><td nowrap>");
828: my $metafile = grep /^\Q$filecom[0]\E\.meta\&/, @list;
829: my $title;
830: if ($ENV{'form.catalogmode'} eq 'interactive') {
831: $title=$listname;
832: $title = &Apache::lonnet::metadata($filelink,'title')
833: if ($metafile == 1);
834: $title=$listname unless $title;
835: my $titleesc=HTML::Entities::encode($title);
836: $titleesc=~s/\'/\\'/; #' (clean up this spare quote)
837: $r->print("<a href=\"javascript:select_data(\'",
838: $titleesc,"','",$filelink,"')\">");
839: $r->print("<img src='",$iconpath,"select.gif' border='0' /></a>".
840: "\n");
841: $r->print("</td><td nowrap>");
842: } elsif ($ENV{'form.catalogmode'} eq 'groupimport') {
843: $title=$listname;
844: #$title = &Apache::lonnet::metadata($filelink,'title')
845: #if ($metafile == 1);
846: $title=$listname unless $title;
847: my $titleesc=&HTML::Entities::encode($title);
848: $r->print("<form name='form$fnum'>\n");
849: $r->print("<input type='checkbox' name='filelink"."' ".
850: "value='$filelink' onClick='".
851: "javascript:queue(\"form$fnum\")' ");
852: if ($hash{'store_'.$filelink}) {
853: $r->print("checked");
854: }
855: $r->print(">\n");
856: $r->print("<input type='hidden' name='title"."' ".
857: "value='$titleesc'>\n");
858: $r->print("</form>\n");
859: $r->print("</td><td nowrap>");
860: $hash{"pre_${fnum}_link"}=$filelink;
861: $hash{"pre_${fnum}_title"}=$titleesc;
862: $fnum++;
863: }
864: # Form to open or close sequences
865: if ($filelink=~/\.(page|sequence)$/) {
866: my $curdir = $startdir.$filecom[0].'/';
867: my $anchor = $curdir;
868: $anchor =~ s/\///g;
869: &begin_form($r,$curdir);
870: $indent--;
871: }
872: # General indentation
873: if ($indent > 0 and $indent < 11) {
874: $r->print("<img src=",$iconpath,"whitespace",$indent,
875: ".gif border='0' />\n");
876: } elsif ($indent >0) {
877: my $ten = int($indent/10.);
878: my $rem = $indent%10.0;
879: my $count = 0;
880: while ($count < $ten) {
881: $r->print("<img src=",$iconpath,
882: "whitespace10.gif border='0' />\n");
883: $count++;
884: }
885: $r->print("<img src=",$iconpath,"whitespace",$rem,
886: ".gif border='0' />\n") if $rem > 0;
887: }
888: # Sequence open/close icon
889: if ($filelink=~/\.(page|sequence)$/) {
890: my $curdir = $startdir.$filecom[0].'/';
891: my $anchor = $curdir;
892: $anchor =~ s/\///g;
893: $r->print ('<input type="hidden" name="acts" value="">');
894: $r->print ('<a name="'.$anchor.'"><input src="'.$iconpath.
895: 'folder_pointer_'.$diropen.'.gif"');
896: $r->print (' name="'.$msg.'" height="22" type="image" border="0">'.
897: "\n");
898: }
899: # Filetype icons
900: $r->print("<img src='$iconname' border='0' />\n");
901: # Close form to open/close sequence
902: if ($filelink=~/\.(page|sequence)$/) {
903: $r->print('</form>');
904: }
905: $r->print (" <a href=\"javascript:openWindow('".$filelink.
906: "', 'previewfile', '450', '500', 'no', 'yes','yes')\";".
907: " TARGET=_self>$listname</a> ");
908:
909: $r->print (" (<a href=\"javascript:openWindow('".$filelink.
910: ".meta', 'metadatafile', '500', '550', 'no', 'yes','no')\"; ".
911: "TARGET=_self>metadata</a>) ") if ($metafile == 1);
912:
913: $r->print("</td>\n");
914: if ($hash{'display_attrs_0'} == 1) {
915: my $title = &Apache::lonnet::gettitle($filelink,'title')
916: if ($metafile == 1);
917: $r->print('<td> '.($title eq '' ? ' ' : $title).
918: ' </td>'."\n");
919: }
920: $r->print('<td align=right> ',
921: $filecom[8]," </td>\n")
922: if $hash{'display_attrs_1'} == 1;
923: $r->print('<td> '.
924: (localtime($filecom[9]))." </td>\n")
925: if $hash{'display_attrs_2'} == 1;
926: $r->print('<td> '.
927: (localtime($filecom[10]))." </td>\n")
928: if $hash{'display_attrs_3'} == 1;
929:
930: if ($hash{'display_attrs_4'} == 1) {
931: my $author = &Apache::lonnet::metadata($filelink,'author')
932: if ($metafile == 1);
933: $r->print('<td> '.($author eq '' ? ' ' : $author).
934: " </td>\n");
935: }
936: if ($hash{'display_attrs_5'} == 1) {
937: my $keywords = &Apache::lonnet::metadata($filelink,'keywords')
938: if ($metafile == 1);
939: # $keywords = ' ' if (!$keywords);
940: $r->print('<td> '.($keywords eq '' ? ' ' : $keywords).
941: " </td>\n");
942: }
943: if ($hash{'display_attrs_6'} == 1) {
944: my $lang = &Apache::lonnet::metadata($filelink,'language')
945: if ($metafile == 1);
946: $lang = &Apache::loncommon::languagedescription($lang);
947: $r->print('<td> '.($lang eq '' ? ' ' : $lang).
948: " </td>\n");
949: }
950: if ($hash{'display_attrs_7'} == 1) {
951: my $output='';
952: my $embstyle=&Apache::loncommon::fileembstyle($curfext);
953: if ($embstyle eq 'ssi') {
954: my $cache=$Apache::lonnet::perlvar{'lonDocRoot'}.$filelink.
955: '.tmp';
956: if ((!$ENV{'form.updatedisplay'}) &&
957: (-e $cache)) {
958: open(FH,$cache);
959: $output=join("\n",<FH>);
960: close(FH);
961: } else {
962: $output=&Apache::lonnet::ssi_body($filelink);
963: open(FH,">$cache");
964: print FH $output;
965: close(FH);
966: }
967: $output='<font size="-2">'.$output.'</font>';
968: } elsif ($embstyle eq 'img') {
969: $output='<img src="'.$filelink.'" />';
970: } elsif ($filelink=~/^\/res\/(\w+)\/(\w+)\//) {
971: $output='<img src="http://'.
972: $Apache::lonnet::hostname{&Apache::lonnet::homeserver($2,$1)}.
973: '/cgi-bin/thumbnail.gif?url='.$filelink.'" />';
974: }
975: $r->print('<td> '.($output eq '' ? ' ':$output).
976: " </td>\n");
977: }
978: if ($hash{'display_attrs_8'} == 1) {
979: my (%stat) = &Apache::lonmeta::dynamicmeta($filelink) if ($metafile == 1);
980: my $stat = (exists($stat{'course'}) ? $stat{'course'} : '').
981: ((exists($stat{'course'}) || exists($stat{'count'})) ? '/' : '').
982: (exists($stat{'count'}) ? $stat{'count'} : '');
983: $r->print('<td align=center> '.($stat eq '' ? ' ' : $stat).
984: ' </td>'."\n");
985: }
986:
987: $r->print("</tr>\n");
988: }
989:
990: # -- display directory
991: if ($fnptr == $dirptr) {
992: my $curdir = $startdir.$filecom[0].'/';
993: my $anchor = $curdir;
994: $anchor =~ s/\///g;
995: $r->print("<tr bgcolor=$fileclr>$extrafield<td valign=$valign>");
996: &begin_form ($r,$curdir);
997: my $indentm1 = $indent-1;
998: if ($indentm1 < 11 and $indentm1 > 0) {
999: $r->print("<img src=",$iconpath,"whitespace",$indentm1,
1000: ".gif border='0' />\n");
1001: } else {
1002: my $ten = int($indentm1/10.);
1003: my $rem = $indentm1%10.0;
1004: my $count = 0;
1005: while ($count < $ten) {
1006: $r->print ("<img src=",$iconpath
1007: ,"whitespace10.gif border='0' />\n");
1008: $count++;
1009: }
1010: $r->print ("<img src=",$iconpath,"whitespace",$rem,
1011: ".gif border='0' />\n") if $rem > 0;
1012: }
1013: $r->print ('<input type="hidden" name="acts" value="">');
1014: $r->print ('<a name="'.$anchor.'"><input src="'.$iconpath.
1015: 'folder_pointer_'.$diropen.'.gif"');
1016: $r->print (' name="'.$msg.'" height="22" type="image" border="0">'.
1017: "\n");
1018: $r->print ('<a href="javascript:gothere(\''.$curdir.'\')"><img src="'.
1019: $iconpath.'folder_'.$diropen.'.gif" border="0" /></a>'.
1020: "\n");
1021: $r->print ("$listname</td>\n");
1022: # Attributes
1023: my $filelink = $startdir.$filecom[0].'/default';
1024:
1025: if ($hash{'display_attrs_0'} == 1) {
1026: my $title = &Apache::lonnet::gettitle($filelink,'title');
1027: $r->print('<td> '.($title eq '' ? ' ' : $title).
1028: ' </td>'."\n");
1029: }
1030: $r->print('<td align=right> ',
1031: $filecom[8]," </td>\n")
1032: if $hash{'display_attrs_1'} == 1;
1033: $r->print('<td> '.
1034: (localtime($filecom[9]))." </td>\n")
1035: if $hash{'display_attrs_2'} == 1;
1036: $r->print('<td> '.
1037: (localtime($filecom[10]))." </td>\n")
1038: if $hash{'display_attrs_3'} == 1;
1039:
1040: if ($hash{'display_attrs_4'} == 1) {
1041: my $author = &Apache::lonnet::metadata($filelink,'author');
1042: $r->print('<td> '.($author eq '' ? ' ' : $author).
1043: " </td>\n");
1044: }
1045: if ($hash{'display_attrs_5'} == 1) {
1046: my $keywords = &Apache::lonnet::metadata($filelink,'keywords');
1047: # $keywords = ' ' if (!$keywords);
1048: $r->print('<td> '.($keywords eq '' ? ' ' : $keywords).
1049: " </td>\n");
1050: }
1051: if ($hash{'display_attrs_6'} == 1) {
1052: my $lang = &Apache::lonnet::metadata($filelink,'language');
1053: $lang = &Apache::loncommon::languagedescription($lang);
1054: $r->print('<td> '.($lang eq '' ? ' ' : $lang).
1055: " </td>\n");
1056: }
1057: if ($hash{'display_attrs_7'} == 1) {
1058: $r->print('<td> </td>');
1059: }
1060: if ($hash{'display_attrs_8'} == 1) {
1061: $r->print('<td> </td>');
1062: }
1063: $r->print('</form></tr>');
1064: }
1065:
1066: }
1067:
1068: # ------------------- prints the beginning of a form for directory or file link
1069: sub begin_form {
1070: my ($r,$uri) = @_;
1071: my $anchor = $uri;
1072: $anchor =~ s/\///g;
1073: $r->print ('<form method="post" name="dirpath'.$dnum.'" action="'.$uri.
1074: '#'.$anchor.
1075: '" onSubmit="return rep_dirpath(\''.$dnum.'\''.
1076: ',document.forms.fileattr.acts.value)" '.
1077: 'enctype="application/x-www-form-urlencoded">'."\n");
1078: $r->print ('<input type="hidden" name="openuri" value="'.$uri.'">'.
1079: "\n");
1080: $r->print ('<input type="hidden" name="dirPointer" value="on">'."\n");
1081: $dnum++;
1082: }
1083:
1084: # --------- settings whenever the user causes the indexer window to be launched
1085: sub start_fresh_session {
1086: delete $hash{'form.catalogmode'};
1087: delete $hash{'form.mode'};
1088: delete $hash{'form.form'};
1089: delete $hash{'form.element'};
1090: delete $hash{'form.omit'};
1091: delete $hash{'form.only'};
1092: foreach (keys %hash) {
1093: delete $hash{$_} if (/^(pre_|store)/);
1094: }
1095: }
1096:
1097: # ------------------------------------------------------------------- setvalues
1098: sub setvalues {
1099: # setvalues is used in registerurl to synchronize the database
1100: # hash and environment hashes
1101: my ($H1,$h1key,$H2,$h2key) =@_;
1102: #
1103: if (exists $H2->{$h2key}) {
1104: $H1->{$h1key} = $H2->{$h2key};
1105: } elsif (exists $H1->{$h1key}) {
1106: $H2->{$h2key} = $H1->{$h1key};
1107: }
1108: }
1109:
1110: 1;
1111:
1112: sub cleanup {
1113: if (tied(%hash)){
1114: &Apache::lonnet::logthis('Cleanup indexer: hash');
1115: }
1116: }
1117:
1118: =head1 NAME
1119:
1120: Apache::lonindexer - mod_perl module for cross server filesystem browsing
1121:
1122: =head1 SYNOPSIS
1123:
1124: Invoked by /etc/httpd/conf/srm.conf:
1125:
1126: <LocationMatch "^/res.*/$">
1127: SetHandler perl-script
1128: PerlHandler Apache::lonindexer
1129: </LocationMatch>
1130:
1131: =head1 INTRODUCTION
1132:
1133: This module enables a scheme of browsing across a cross server.
1134:
1135: This is part of the LearningOnline Network with CAPA project
1136: described at http://www.lon-capa.org.
1137:
1138: =head1 BEGIN SUBROUTINE
1139:
1140: This routine is only run once after compilation.
1141:
1142: =over 4
1143:
1144: =item *
1145:
1146: Initializes %language hash table.
1147:
1148: =back
1149:
1150: =head1 HANDLER SUBROUTINE
1151:
1152: This routine is called by Apache and mod_perl.
1153:
1154: =over 4
1155:
1156: =item *
1157:
1158: read in machine configuration variables
1159:
1160: =item *
1161:
1162: see if called from an interactive mode
1163:
1164: =item *
1165:
1166: refresh environment with user database values (in %hash)
1167:
1168: =item *
1169:
1170: define extra fields and buttons in case of special mode
1171:
1172: =item *
1173:
1174: set catalogmodefunctions to have extra needed javascript functionality
1175:
1176: =item *
1177:
1178: print header
1179:
1180: =item *
1181:
1182: evaluate actions from previous page (both cumulatively and chronologically)
1183:
1184: =item *
1185:
1186: output title
1187:
1188: =item *
1189:
1190: get state of file attributes to be showing
1191:
1192: =item *
1193:
1194: output state of file attributes to be showing
1195:
1196: =item *
1197:
1198: output starting row to the indexed file/directory hierarchy
1199:
1200: =item *
1201:
1202: read in what directories have previously been set to "open"
1203:
1204: =item *
1205:
1206: if not at top level, provide an uplink arrow
1207:
1208: =item *
1209:
1210: recursively go through all the directories and output as appropriate
1211:
1212: =item *
1213:
1214: information useful for group import
1215:
1216: =item *
1217:
1218: end the tables
1219:
1220: =item *
1221:
1222: end the output and return
1223:
1224: =back
1225:
1226: =head1 OTHER SUBROUTINES
1227:
1228: =over 4
1229:
1230: =item *
1231:
1232: scanDir - recursive scan of a directory
1233:
1234: =item *
1235:
1236: get_list - get complete matched list based on the uri (returns an array)
1237:
1238: =item *
1239:
1240: match_ext - filters out files based on extensions (returns an array)
1241:
1242: =item *
1243:
1244: display_line - displays one line in appropriate table format
1245:
1246: =item *
1247:
1248: begin_form - prints the beginning of a form for directory or file link
1249:
1250: =item *
1251:
1252: start_fresh_session - settings whenever the user causes the indexer window
1253: to be launched
1254:
1255: =back
1256:
1257: =cut
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>