--- loncom/interface/lonindexer.pm 2008/12/17 18:49:13 1.181.2.2
+++ loncom/interface/lonindexer.pm 2010/01/28 00:01:13 1.181.4.4
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Directory Indexer
#
-# $Id: lonindexer.pm,v 1.181.2.2 2008/12/17 18:49:13 raeburn Exp $
+# $Id: lonindexer.pm,v 1.181.4.4 2010/01/28 00:01:13 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -183,7 +183,7 @@ ENDSUBM
$colspan=" colspan='2' ";
my $cl=&mt('Close');
$closebutton=<
+
END
}
elsif ($env{'form.catalogmode'} eq 'import') {
@@ -194,11 +194,11 @@ END
my $cl=&mt('Close');
my $gi=&mt('Import');
$closebutton=<
+
END
$groupimportbutton=<
+onclick="javascript:select_group()" />
END
}
# Additions made by Matthew to make the browser a little easier to deal
@@ -407,8 +407,14 @@ function gothere(val) {
ENDHEADER
my ($headerdom)=($uri=~m{^/res/($match_domain)/});
- $r->print(&Apache::loncommon::start_page('Browse Resources',$js,
- {'domain' => $headerdom,}));
+ my %args = (
+ 'domain' => $headerdom,
+ );
+ if ($env{'form.catalogmode'}) {
+ # "Popup mode"
+ $args{'only_body'} = 1;
+ }
+ $r->print(&Apache::loncommon::start_page('Browse Resources',$js,\%args));
# ---------------------------------- get state of file types to be showing
if ($env{'form.only'}) {
$typeselect = $env{'form.only'};
@@ -418,16 +424,16 @@ ENDHEADER
# ---------------------------------- get state of file attributes to be showing
if ($env{'form.attrs'}) {
- for (my $i=0; $i<=11; $i++) {
+ for (my $i=0; $i<=16; $i++) {
delete $hash{'display_attrs_'.$i};
if ($env{'form.attr'.$i} == 1) {
- $attrchk[$i] = 'checked';
+ $attrchk[$i] = 'checked="checked"';
$hash{'display_attrs_'.$i} = 1;
}
}
} else {
- for (my $i=0; $i<=11; $i++) {
- $attrchk[$i] = 'checked' if $hash{'display_attrs_'.$i} == 1;
+ for (my $i=0; $i<=16; $i++) {
+ $attrchk[$i] = 'checked="checked"' if $hash{'display_attrs_'.$i} == 1;
}
}
@@ -442,7 +448,12 @@ ENDHEADER
'st' => 'Statistics',
'au' => 'Author',
'kw' => 'Keywords',
+ 'sb' => 'Subject',
+ 'nt' => 'Notes',
+ 'ab' => 'Abstract',
'ln' => 'Language',
+ 'gl' => 'Grade Level',
+ 'sd' => 'Standards',
'sa' => 'Source Available',
'sr' => 'Show resource',
'li' => 'Linked/Related Resources',
@@ -450,29 +461,37 @@ ENDHEADER
'ud' => 'Update Display',
'pr' => 'Problems',
'gr' => 'Graphics',
- 'at' => 'All types'
+ 'at' => 'All types',
+ 'hd' => 'Display Options',
);
$r->print(<
-
+');
$r->print(<
@@ -529,8 +551,8 @@ END
&Apache::lonhtmlcommon::store_recent('residx',$storeuri,$storeuri);
# -------------------------------------------------- Check All and Uncheck all
if ($env{'form.catalogmode'} eq 'import') {
- $r->print(' ');
- $r->print('');
+ $r->print(' ');
+ $r->print('');
}
# ----------------- output starting row to the indexed file/directory hierarchy
my $titleclr="#ddffff";
@@ -542,8 +564,8 @@ END
$r->print("
".&mt('Name')."
\n");
$r->print("
".&mt('Title')."
\n")
if ($hash{'display_attrs_0'} == 1);
- $r->print('
'.&mt('Size').' ('.&mt('bytes').') '.
- '
'."\n") if ($hash{'display_attrs_1'} == 1);
+ $r->print("
".&mt("Size")." (".&mt("bytes").") ".
+ "
\n") if ($hash{'display_attrs_1'} == 1);
$r->print("
".&mt("Last accessed")."
\n")
if ($hash{'display_attrs_2'} == 1);
$r->print("
".&mt("Last modified")."
\n")
@@ -563,6 +585,16 @@ END
if ($hash{'display_attrs_11'} == 1);
$r->print("
".&mt("Resource")."
\n")
if ($hash{'display_attrs_7'} == 1);
+ $r->print("
".&mt("Subject")."
\n")
+ if ($hash{'display_attrs_12'} == 1);
+ $r->print("
".&mt("Notes")."
\n")
+ if ($hash{'display_attrs_13'} == 1);
+ $r->print("
".&mt("Abstract")."
\n")
+ if ($hash{'display_attrs_14'} == 1);
+ $r->print("
".&mt("Grade Level")."
\n")
+ if ($hash{'display_attrs_15'} == 1);
+ $r->print("
".&mt("Standards")."
\n")
+ if ($hash{'display_attrs_16'} == 1);
$r->print('');
# ----------------- read in what directories have previously been set to "open"
@@ -830,7 +862,7 @@ sub display_line {
my $tabtag='';
my $i=0;
- while ($i<=11) {
+ while ($i<=16) {
$tabtag=join('',$tabtag,"
")
if ($i != 9 &&
$hash{'display_attrs_'.$i} == 1);
@@ -849,23 +881,23 @@ sub display_line {
$r->print("
\n");
$r->print ('$tabtag\n");
return OK;
}
# Do we have permission to look at this?
- if($filecom[15] ne '1') { return OK if (!&Apache::lonnet::allowed('bre',$pathprefix.$filecom[0])); }
+ if($filecom[15] ne '1') { return OK if ((!&Apache::lonnet::allowed('bre',$pathprefix.$filecom[0])) && (!&Apache::lonnet::allowed('bro',$pathprefix.$filecom[0]))); }
# make absolute links appear on different background
if ($absolute) { $fileclr='#ccdd99'; }
@@ -883,7 +915,7 @@ sub display_line {
$r->print ('');
$r->print ('print (' name="'.$msg.'" type="image" class="LC_indexer_icon" />'.
+ $r->print (' name="'.$msg.'" alt="'.$msg.'" type="image" class="LC_indexer_icon" />'.
"\n");
my $quotable_filecom = &Apache::loncommon::escape_single($filecom[0]);
$r->print ('');
$r->print ('print (' name="'.$msg.'" type="image" class="LC_indexer_icon" />'.
+ $r->print (' name="'.$msg.'" alt="'.$msg.'" type="image" class="LC_indexer_icon" />'.
"\n");
my $quotable_curdir = &Apache::loncommon::escape_single($curdir);
$r->print ('\n");
$r->print("print("checked");
@@ -978,7 +1010,7 @@ sub display_line {
$indent--;
}
# General indentation
- if ($indent > 0 and $indent < 11) {
+ if ($indent > 0 and $indent < 16) {
$r->print("\n");
} elsif ($indent >0) {
@@ -1001,7 +1033,7 @@ sub display_line {
$r->print ('');
$r->print ('print (' name="'.$msg.'" type="image" class="LC_indexer_icon" />'.
+ $r->print (' name="'.$msg.'" alt="'.$msg.'" type="image" class="LC_indexer_icon" />'.
"\n");
}
# Filetype icons
@@ -1058,17 +1090,11 @@ sub display_line {
# statistics
&dynmetaread($filelink);
$r->print("