--- loncom/interface/lonindexer.pm 2008/12/05 10:23:56 1.184 +++ loncom/interface/lonindexer.pm 2009/02/02 19:38:12 1.185 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Directory Indexer # -# $Id: lonindexer.pm,v 1.184 2008/12/05 10:23:56 bisitz Exp $ +# $Id: lonindexer.pm,v 1.185 2009/02/02 19:38:12 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<=12; $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<=12; $i++) { $attrchk[$i] = 'checked' if $hash{'display_attrs_'.$i} == 1; } } @@ -444,6 +444,7 @@ ENDHEADER 'st' => 'Statistics', 'au' => 'Author', 'kw' => 'Keywords', + 'sb' => 'Subject', 'ln' => 'Language', 'sa' => 'Source Available', 'sr' => 'Show resource', @@ -478,6 +479,7 @@ ENDHEADER +   @@ -569,7 +571,12 @@ 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(&Apache::loncommon::end_data_table_header_row()); + + # ----------------- read in what directories have previously been set to "open" foreach (keys %hash) { @@ -834,7 +841,7 @@ sub display_line { my $tabtag=''; my $i=0; - while ($i<=11) { + while ($i<=12) { $tabtag=join('',$tabtag," ") if ($i != 9 && $hash{'display_attrs_'.$i} == 1); @@ -992,7 +999,7 @@ sub display_line { $indent--; } # General indentation - if ($indent > 0 and $indent < 11) { + if ($indent > 0 and $indent < 12) { $r->print("\"\"\n"); } elsif ($indent >0) { @@ -1060,7 +1067,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 +1118,27 @@ 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'); + # $keywords = ' ' if (!$keywords); + $r->print(' '.($subject eq '' ? ' ' : $subject). + " \n"); + } + + $r->print(&Apache::loncommon::end_data_table_row()); +} + + # -- display directory if ($fnptr == $dirptr) { @@ -1132,7 +1151,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 +1213,27 @@ 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'); + # $keywords = ' ' if (!$keywords); + $r->print(' '.($subject eq '' ? ' ' : $subject). + " \n"); + } + + $r->print(&Apache::loncommon::end_data_table_row()); } }