[LON-CAPA-cvs] cvs: loncom /interface lonindexer.pm
www
lon-capa-cvs@mail.lon-capa.org
Sun, 28 Mar 2004 21:01:06 -0000
www Sun Mar 28 16:01:06 2004 EDT
Modified files:
/loncom/interface lonindexer.pm
Log:
Work on making sequences and pages browse- and groupimportable
Index: loncom/interface/lonindexer.pm
diff -u loncom/interface/lonindexer.pm:1.94 loncom/interface/lonindexer.pm:1.95
--- loncom/interface/lonindexer.pm:1.94 Fri Mar 26 14:35:59 2004
+++ loncom/interface/lonindexer.pm Sun Mar 28 16:01:06 2004
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Directory Indexer
#
-# $Id: lonindexer.pm,v 1.94 2004/03/26 19:35:59 www Exp $
+# $Id: lonindexer.pm,v 1.95 2004/03/28 21:01:06 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -573,6 +573,7 @@
next if($strip =~ /.*\.meta$/ | $obs eq '1');
my (@fileparts) = split(/\./,$strip);
if ($hash{'display_attrs_9'} != 1) {
+# if not all versions to be shown
if (scalar(@fileparts) >= 3) {
my $fext = pop @fileparts;
my $ov = pop @fileparts;
@@ -591,7 +592,7 @@
$curdir = $startdir;
}
my $diropen = 'closed';
- if (($dirptr&$testdir) or ($dom =~ /^(domain|user)$/)) {
+ if (($dirptr&$testdir) or ($dom =~ /^(domain|user)$/) || ($compuri=~/\.(sequence|page)$/)) {
while (my ($key,$val)= each %dupdirs) {
if ($key eq $compuri and $val eq "open") {
$diropen = "opened";
@@ -813,8 +814,7 @@
$r->print("<img src='",$iconpath,"select.gif' border='0' /></a>".
"\n");
$r->print("</td><td nowrap>");
- }
- elsif ($ENV{'form.catalogmode'} eq 'groupimport') {
+ } elsif ($ENV{'form.catalogmode'} eq 'groupimport') {
$title=$listname;
#$title = &Apache::lonnet::metadata($filelink,'title')
#if ($metafile == 1);
@@ -836,7 +836,15 @@
$hash{"pre_${fnum}_title"}=$titleesc;
$fnum++;
}
-
+# Form to open or close sequences
+ if ($filelink=~/\.(page|sequence)$/) {
+ my $curdir = $startdir.$filecom[0].'/';
+ my $anchor = $curdir;
+ $anchor =~ s/\///g;
+ &begin_form($r,$curdir);
+ $indent--;
+ }
+# General indentation
if ($indent > 0 and $indent < 11) {
$r->print("<img src=",$iconpath,"whitespace",$indent,
".gif border='0' />\n");
@@ -852,8 +860,23 @@
$r->print("<img src=",$iconpath,"whitespace",$rem,
".gif border='0' />\n") if $rem > 0;
}
-
+# Sequence open/close icon
+ if ($filelink=~/\.(page|sequence)$/) {
+ my $curdir = $startdir.$filecom[0].'/';
+ my $anchor = $curdir;
+ $anchor =~ s/\///g;
+ $r->print ('<input type="hidden" name="acts" value="">');
+ $r->print ('<a name="'.$anchor.'"><input src="'.$iconpath.
+ 'folder_pointer_'.$diropen.'.gif"');
+ $r->print (' name="'.$msg.'" height="22" type="image" border="0">'.
+ "\n");
+ }
+# Filetype icons
$r->print("<img src='$iconname' border='0' />\n");
+# Close form to open/close sequence
+ if ($filelink=~/\.(page|sequence)$/) {
+ $r->print('</form>');
+ }
$r->print (" <a href=\"javascript:openWindow('".$filelink.
"', 'previewfile', '450', '500', 'no', 'yes','yes')\";".
" TARGET=_self>$listname</a> ");