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