[LON-CAPA-cvs] cvs: loncom /interface lonindexer.pm
jms
jms@source.lon-capa.org
Tue, 03 Feb 2009 15:58:11 -0000
jms Tue Feb 3 15:58:11 2009 EDT
Modified files:
/loncom/interface lonindexer.pm
Log:
Added Notes and Abstract view options to Import table
Index: loncom/interface/lonindexer.pm
diff -u loncom/interface/lonindexer.pm:1.185 loncom/interface/lonindexer.pm:1.186
--- loncom/interface/lonindexer.pm:1.185 Mon Feb 2 19:38:12 2009
+++ loncom/interface/lonindexer.pm Tue Feb 3 15:58:11 2009
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Directory Indexer
#
-# $Id: lonindexer.pm,v 1.185 2009/02/02 19:38:12 jms Exp $
+# $Id: lonindexer.pm,v 1.186 2009/02/03 15:58:11 jms Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -420,7 +420,7 @@
# ---------------------------------- get state of file attributes to be showing
if ($env{'form.attrs'}) {
- for (my $i=0; $i<=12; $i++) {
+ for (my $i=0; $i<=14; $i++) {
delete $hash{'display_attrs_'.$i};
if ($env{'form.attr'.$i} == 1) {
$attrchk[$i] = 'checked';
@@ -428,7 +428,7 @@
}
}
} else {
- for (my $i=0; $i<=12; $i++) {
+ for (my $i=0; $i<=14; $i++) {
$attrchk[$i] = 'checked' if $hash{'display_attrs_'.$i} == 1;
}
}
@@ -445,6 +445,8 @@
'au' => 'Author',
'kw' => 'Keywords',
'sb' => 'Subject',
+ 'nt' => 'Notes ',
+ 'ab' => 'Abstract ',
'ln' => 'Language',
'sa' => 'Source Available',
'sr' => 'Show resource',
@@ -468,12 +470,14 @@
<td><label><input type="checkbox" name="attr4" value="1" $attrchk[4] onClick="this.form.submit();" /> $lt{'au'}</label></td>
<td><label><input type="checkbox" name="attr5" value="1" $attrchk[5] onClick="this.form.submit();" /> $lt{'kw'}</label></td>
<td><label><input type="checkbox" name="attr6" value="1" $attrchk[6] onClick="this.form.submit();" /> $lt{'ln'}</label></td>
+<td><label><input type="checkbox" name="attr13" value="1" $attrchk[13] onClick="this.form.submit();" /> $lt{'nt'}</label></td>
</tr>
<tr>
<td><label><input type="checkbox" name="attr1" value="1" $attrchk[1] onClick="this.form.submit();" /> $lt{'si'}</label></td>
<td><label><input type="checkbox" name="attr2" value="1" $attrchk[2] onClick="this.form.submit();" /> $lt{'la'}</label></td>
<td><label><input type="checkbox" name="attr3" value="1" $attrchk[3] onClick="this.form.submit();" /> $lt{'lm'}</label></td>
<td><label><input type="checkbox" name="attr10" value="1" $attrchk[10] onClick="this.form.submit();" /> $lt{'sa'}</label></td>
+<td><label><input type="checkbox" name="attr14" value="1" $attrchk[14] onClick="this.form.submit();" /> $lt{'ab'}</label></td>
</tr>
<tr>
<td><label><input type="checkbox" name="attr8" value="1" $attrchk[8] onClick="this.form.submit();" /> $lt{'st'}</label></td>
@@ -573,6 +577,10 @@
if ($hash{'display_attrs_7'} == 1);
$r->print("<th>".&mt("Subject")."</th>\n")
if ($hash{'display_attrs_12'} == 1);
+ $r->print("<th>".&mt("Notes")."</th>\n")
+ if ($hash{'display_attrs_13'} == 1);
+ $r->print("<th>".&mt("Abstract")."</th>\n")
+ if ($hash{'display_attrs_14'} == 1);
$r->print(&Apache::loncommon::end_data_table_header_row());
@@ -841,7 +849,7 @@
my $tabtag='</td>';
my $i=0;
- while ($i<=12) {
+ while ($i<=14) {
$tabtag=join('',$tabtag,"<td> </td>")
if ($i != 9 &&
$hash{'display_attrs_'.$i} == 1);
@@ -999,7 +1007,7 @@
$indent--;
}
# General indentation
- if ($indent > 0 and $indent < 12) {
+ if ($indent > 0 and $indent < 14) {
$r->print("<img alt=\"\" src='",$iconpath,"whitespace",$indent,
".gif' class='LC_icon' />\n");
} elsif ($indent >0) {
@@ -1130,11 +1138,22 @@
if ($hash{'display_attrs_12'} == 1) {
my $subject = &Apache::lonnet::metadata($filelink,'subject');
- # $keywords = ' ' if (!$keywords);
$r->print('<td> '.($subject eq '' ? ' ' : $subject).
" </td>\n");
}
+ if ($hash{'display_attrs_13'} == 1) {
+ my $notes = &Apache::lonnet::metadata($filelink,'notes');
+ $r->print('<td> '.($notes eq '' ? ' ' : $notes).
+ " </td>\n");
+ }
+
+ if ($hash{'display_attrs_14'} == 1) {
+ my $abstract = &Apache::lonnet::metadata($filelink,'abstract');
+ $r->print('<td> '.($abstract eq '' ? ' ' : $abstract).
+ " </td>\n");
+ }
+
$r->print(&Apache::loncommon::end_data_table_row());
}
@@ -1228,10 +1247,20 @@
}
if ($hash{'display_attrs_12'} == 1) {
my $subject = &Apache::lonnet::metadata($filelink,'subject');
- # $keywords = ' ' if (!$keywords);
$r->print('<td> '.($subject eq '' ? ' ' : $subject).
" </td>\n");
}
+ if ($hash{'display_attrs_13'} == 1) {
+ my $notes = &Apache::lonnet::metadata($filelink,'notes');
+ $r->print('<td> '.($notes eq '' ? ' ' : $notes).
+ " </td>\n");
+ }
+
+ if ($hash{'display_attrs_14'} == 1) {
+ my $abstract = &Apache::lonnet::metadata($filelink,'abstract');
+ $r->print('<td> '.($abstract eq '' ? ' ' : $abstract).
+ " </td>\n");
+ }
$r->print(&Apache::loncommon::end_data_table_row());
}