File:  [LON-CAPA] / loncom / interface / lonindexer.pm
Revision 1.73: download - view: text, annotated - select for diffs
Mon Aug 11 17:27:24 2003 UTC (20 years, 10 months ago) by albertel
Branches: MAIN
CVS tags: version_0_99_5, HEAD
- Fixes BUG#2033, can rotate the arrows at the domain level again

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

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>