--- loncom/interface/lonindexer.pm 2008/09/19 09:08:53 1.183
+++ loncom/interface/lonindexer.pm 2009/03/18 13:47:14 1.193
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Directory Indexer
#
-# $Id: lonindexer.pm,v 1.183 2008/09/19 09:08:53 bisitz Exp $
+# $Id: lonindexer.pm,v 1.193 2009/03/18 13:47:14 jms Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -420,7 +420,7 @@ 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';
@@ -428,7 +428,7 @@ ENDHEADER
}
}
} else {
- for (my $i=0; $i<=11; $i++) {
+ for (my $i=0; $i<=16; $i++) {
$attrchk[$i] = 'checked' if $hash{'display_attrs_'.$i} == 1;
}
}
@@ -444,6 +444,11 @@ ENDHEADER
'st' => 'Statistics',
'au' => 'Author',
'kw' => 'Keywords',
+ 'sb' => 'Subject',
+ 'nt' => 'Notes',
+ 'gl' => 'Grade Level',
+ 'ab' => 'Abstract',
+ 'sd' => 'Standards',
'ln' => 'Language',
'sa' => 'Source Available',
'sr' => 'Show resource',
@@ -467,17 +472,23 @@ ENDHEADER
$lt{'au'}
$lt{'kw'}
$lt{'ln'}
+ $lt{'nt'}
+ $lt{'sd'}
$lt{'si'}
$lt{'la'}
$lt{'lm'}
$lt{'sa'}
+ $lt{'ab'}
+
$lt{'st'}
$lt{'li'}
$lt{'sr'}
+ $lt{'sb'}
+ $lt{'gl'}
@@ -569,7 +580,20 @@ END
if ($hash{'display_attrs_11'} == 1);
$r->print("".&mt("Resource")." \n")
if ($hash{'display_attrs_7'} == 1);
- $r->print(&Apache::loncommon::end_data_table_header_row());
+ $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(&Apache::loncommon::end_data_table_header_row());
+
+
# ----------------- read in what directories have previously been set to "open"
foreach (keys %hash) {
@@ -834,11 +858,11 @@ 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);
- $i++;
+ $i++;
}
my $valign = ($hash{'display_attrs_7'} == 1 ? 'top' : 'bottom');
@@ -957,9 +981,9 @@ sub display_line {
}
# Set the icon for the file
my $iconname = &Apache::loncommon::icon($listname);
-#SB $r->print("");
- $r->print(&Apache::loncommon::start_data_table_row()); # valign="$valign" ?!?"
- $r->print(' ');
+#SB $r->print(" );
+ $r->print(&Apache::loncommon::start_data_table_row()); #SB valign="$valign" ?!?
+ $r->print('');
if ($env{'form.catalogmode'} eq 'interactive') {
my $quotable_filelink = &Apache::loncommon::escape_single($filelink);
@@ -967,7 +991,7 @@ sub display_line {
$quotable_filelink,"')\">");
$r->print(" ".
"\n");
- $r->print(" ");
+ $r->print(' ');
} elsif ($env{'form.catalogmode'} eq 'import') {
$r->print(" ");
+ $r->print(' ');
$hash{"pre_${fnum}_link"}=$filelink;
$hash{"pre_${fnum}_title"}=$title;
if (!$hash{"pre_${fnum}_title"}) {
@@ -992,7 +1016,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) {
@@ -1034,12 +1058,12 @@ sub display_line {
if ($filelink=~/\.(page|sequence)$/) {
$r->print('');
}
- $r->print(" \n");
+ $r->print("\n");
if ($hash{'display_attrs_0'} == 1) {
$r->print(' '.($title eq '' ? ' ' : $title).
' '."\n");
}
- $r->print(' ',
+ $r->print(' ',
$filecom[8]," \n")
if $hash{'display_attrs_1'} == 1;
$r->print(' '.
@@ -1060,7 +1084,6 @@ sub display_line {
$r->print(' '.($keywords eq '' ? ' ' : $keywords).
" \n");
}
-#'
if ($hash{'display_attrs_6'} == 1) {
my $lang = &Apache::lonnet::metadata($filelink,'language');
@@ -1112,14 +1135,50 @@ sub display_line {
&dynmetaprint($r,$filelink,'course_list');
$r->print('');
}
- if ($hash{'display_attrs_7'} == 1) {
+
+
+
+ if ($hash{'display_attrs_7'} == 1) {
# Show resource
my $output=&showpreview($filelink);
$r->print(' '.($output eq '' ? ' ':$output).
" \n");
- }
- $r->print(&Apache::loncommon::end_data_table_row());
}
+
+ if ($hash{'display_attrs_12'} == 1) {
+ my $subject = &Apache::lonnet::metadata($filelink,'subject');
+ $r->print(' '.($subject eq '' ? ' ' : $subject).
+ " \n");
+ }
+
+ if ($hash{'display_attrs_13'} == 1) {
+ my $notes = &Apache::lonnet::metadata($filelink,'notes');
+ $r->print(' '.($notes eq '' ? ' ' : $notes).
+ " \n");
+ }
+
+ if ($hash{'display_attrs_14'} == 1) {
+ my $abstract = &Apache::lonnet::metadata($filelink,'abstract');
+ $r->print(' '.($abstract eq '' ? ' ' : $abstract).
+ " \n");
+ }
+
+ if ($hash{'display_attrs_15'} == 1) {
+ my $gradelevel = &Apache::lonnet::metadata($filelink,'gradelevel');
+ $r->print(' '.($gradelevel eq '' ? ' ' : $gradelevel).
+ " \n");
+ }
+
+ if ($hash{'display_attrs_16'} == 1) {
+ my $standards = &Apache::lonnet::metadata($filelink,'standards');
+ $r->print(' '.($standards eq '' ? ' ' : $standards).
+ " \n");
+ }
+
+ $r->print(&Apache::loncommon::end_data_table_row());
+}
+
+
# -- display directory
if ($fnptr == $dirptr) {
@@ -1132,7 +1191,7 @@ sub display_line {
$r->print($extrafield.'');
&begin_form ($r,$curdir);
my $indentm1 = $indent-1;
- if ($indentm1 < 11 and $indentm1 > 0) {
+ if ($indentm1 < 12 and $indentm1 > 0) {
$r->print(" \n");
} else {
@@ -1194,19 +1253,49 @@ sub display_line {
$r->print(' '.($lang eq '' ? ' ' : $lang).
" \n");
}
+
if ($hash{'display_attrs_8'} == 1) {
$r->print(' ');
}
if ($hash{'display_attrs_10'} == 1) {
$r->print(' ');
}
- if ($hash{'display_attrs_11'} == 1) {
- $r->print(' ');
- }
if ($hash{'display_attrs_7'} == 1) {
$r->print(' ');
- }
- $r->print(&Apache::loncommon::end_data_table_row());
+ }
+ if ($hash{'display_attrs_11'} == 1) {
+ $r->print(' ');
+ }
+ if ($hash{'display_attrs_12'} == 1) {
+ my $subject = &Apache::lonnet::metadata($filelink,'subject');
+ $r->print(' '.($subject eq '' ? ' ' : $subject).
+ " \n");
+ }
+ if ($hash{'display_attrs_13'} == 1) {
+ my $notes = &Apache::lonnet::metadata($filelink,'notes');
+ $r->print(' '.($notes eq '' ? ' ' : $notes).
+ " \n");
+ }
+
+ if ($hash{'display_attrs_14'} == 1) {
+ my $abstract = &Apache::lonnet::metadata($filelink,'abstract');
+ $r->print(' '.($abstract eq '' ? ' ' : $abstract).
+ " \n");
+ }
+
+ if ($hash{'display_attrs_15'} == 1) {
+ my $gradelevel = &Apache::lonnet::metadata($filelink,'gradelevel');
+ $r->print(' '.($gradelevel eq '' ? ' ' : $gradelevel).
+ " \n");
+ }
+
+ if ($hash{'display_attrs_16'} == 1) {
+ my $standards = &Apache::lonnet::metadata($filelink,'standards');
+ $r->print(' '.($standards eq '' ? ' ' : $standards).
+ " \n");
+ }
+
+ $r->print(&Apache::loncommon::end_data_table_row());
}
}