[LON-CAPA-cvs] cvs: modules /gerd/harvesting lonindexer.pm
www
www at source.lon-capa.org
Wed Jul 11 14:59:54 EDT 2012
www Wed Jul 11 18:59:54 2012 EDT
Modified files:
/modules/gerd/harvesting lonindexer.pm
Log:
Cleanup
-------------- next part --------------
Index: modules/gerd/harvesting/lonindexer.pm
diff -u modules/gerd/harvesting/lonindexer.pm:1.9 modules/gerd/harvesting/lonindexer.pm:1.10
--- modules/gerd/harvesting/lonindexer.pm:1.9 Wed Jul 11 18:04:04 2012
+++ modules/gerd/harvesting/lonindexer.pm Wed Jul 11 18:59:54 2012
@@ -5,7 +5,7 @@
#
# MODIFY $datapath VARIABLE FOR LOCATION OF DATA FILES
#
-# $Id: lonindexer.pm,v 1.9 2012/07/11 18:04:04 www Exp $
+# $Id: lonindexer.pm,v 1.10 2012/07/11 18:59:54 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -752,26 +752,7 @@
<form method="post" name="fileattr" action="'.$uri.'" enctype="application/x-www-form-urlencoded">
<fieldset>
<legend>'.$lt{'hd'}.'</legend>
-<table style=" border-collapse: collapse; border-style: none;">'."\n");
- foreach my $item (@disp_order) {
- my $style = 'padding-left: 12px; padding-right: 8px;';
- if ($cell%$numinrow == 0) {
- $r->print('<tr>');
- }
- $cell ++;
- if ($cell > 3 * $numinrow) {
- $style .= ' padding-bottom: 6px;';
- }
- if (defined($disp_options{$item})) {
- $r->print('<td style="'.$style.'"><span class="LC_nobreak">'.
- '<label><input type="checkbox" name="attr'.$item.'" value="1" '.
- $attrchk[$item].' onclick="this.form.submit();" /> '.$disp_options{$item}.
- '</label></span></td>'."\n");
- }
- if ($cell > 1 && $cell%$numinrow == 0) {
- $r->print('</tr>');
- }
- }
+<table style=" border-collapse: collapse; border-style: none;">');
$r->print(<<END);
<tr>
<td style="font-style: italic; border-top: 1px solid black; padding-top: 6px">
@@ -828,46 +809,13 @@
$r->print('<input type="button" value="'.&mt("Uncheck All").'" id="uncheckallbutton" onclick="javascript:uncheckAll()" /></p>');
}
# ----------------- output starting row to the indexed file/directory hierarchy
- #$r->print(&initdebug());
- #$r->print(&writedebug("Omit:@Omit")) if (@Omit);
- #$r->print(&writedebug("Only:@Only")) if (@Only);
$r->print(&Apache::loncommon::start_data_table("LC_tableBrowseRes")
.&Apache::loncommon::start_data_table_header_row());
$r->print("<th $colspan>".&mt('Name')."</th>\n");
- $r->print("<th></th>\n");
- $r->print("<th>".&mt('Title')."</th>\n")
- if ($hash{'display_attrs_0'} == 1);
- $r->print('<th class="LC_right">'.&mt("Size")." (".&mt("bytes").") ".
- "</th>\n") if ($hash{'display_attrs_1'} == 1);
- $r->print("<th>".&mt("Last accessed")."</th>\n")
- if ($hash{'display_attrs_2'} == 1);
- $r->print("<th>".&mt("Last modified")."</th>\n")
- if ($hash{'display_attrs_3'} == 1);
- $r->print("<th>".&mt("Author(s)")."</th>\n")
- if ($hash{'display_attrs_4'} == 1);
- $r->print("<th>".&mt("Keywords")."</th>\n")
- if ($hash{'display_attrs_5'} == 1);
- $r->print("<th>".&mt("Language")."</th>\n")
- if ($hash{'display_attrs_6'} == 1);
- $r->print("<th>".&mt("Usage Statistics")." <br />(".
- &mt("Courses/Network Hits").") ".&mt('updated periodically')."</th>\n")
- if ($hash{'display_attrs_8'} == 1);
- $r->print("<th>".&mt("Source Available")."</th>\n")
- if ($hash{'display_attrs_10'} == 1);
- $r->print("<th>".&mt("Linked/Related Resources")."</th>\n")
- if ($hash{'display_attrs_11'} == 1);
- $r->print("<th>".&mt("Resource")."</th>\n")
- 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("<th>".&mt("Grade Level")."</th>\n")
- if ($hash{'display_attrs_15'} == 1);
- $r->print("<th>".&mt("Standards")."</th>\n")
- if ($hash{'display_attrs_16'} == 1);
+ $r->print("<th>".&mt('Title')."</th>\n");
+ $r->print("<th>".&mt("Author(s)")."</th>\n");
+ $r->print("<th>".&mt("Source Available")."</th>\n");
+ $r->print("<th>".&mt("Resource")."</th>\n");
$r->print(&Apache::loncommon::end_data_table_header_row());
@@ -1127,14 +1075,7 @@
my $nowOpen = ($diropen eq 'opened' ? 1 : 0);
my $tabtag='</td>';
- my $i=0;
- while ($i<=16) {
- $tabtag=join('',$tabtag,"<td> </td>")
- if ($i != 9 &&
- $hash{'display_attrs_'.$i} == 1);
- $i++;
- }
- my $valign = ($hash{'display_attrs_7'} == 1 ? 'top' : 'bottom');
+ my $valign = 'top';
# display uplink arrow
if ($filecom[1] eq 'viewOneUp') {
@@ -1235,11 +1176,8 @@
# display file
if (($fnptr == 0 and $filecom[3] ne '') or $absolute) {
- my $title;
my $filelink = $pathprefix.$filecom[0];
- if ($hash{'display_attrs_0'} == 1) {
- $title = &Apache::lonnet::gettitle($filelink);
- }
+ my $title = &Apache::lonnet::gettitle($filelink);
my @file_ext = split (/\./,$listname);
my $curfext = $file_ext[-1];
if (@Omit) {
@@ -1319,54 +1257,12 @@
$r->print('</form>');
}
$r->print("</td>\n");
- if ($hash{'display_attrs_0'} == 1) {
$r->print('<td> '.($title eq '' ? ' ' : $title).
' </td>'."\n");
- }
- $r->print('<td class="LC_right"> ',
- $filecom[8]," </td>\n")
- if $hash{'display_attrs_1'} == 1;
- $r->print('<td class="LC_nobreak"> '.
- (&Apache::lonlocal::locallocaltime($filecom[9]))." </td>\n")
- if $hash{'display_attrs_2'} == 1;
- $r->print('<td class="LC_nobreak"> '.
- (&Apache::lonlocal::locallocaltime($filecom[10]))." </td>\n")
- if $hash{'display_attrs_3'} == 1;
-
- if ($hash{'display_attrs_4'} == 1) {
- my $author = &Apache::lonnet::metadata($filelink,'author');
- $r->print('<td class="LC_nobreak"> '.($author eq '' ? ' ' : $author).
+ my $author = &Apache::lonnet::metadata($filelink,'author');
+ $r->print('<td class="LC_nobreak"> '.($author eq '' ? ' ' : $author).
" </td>\n");
- }
- if ($hash{'display_attrs_5'} == 1) {
- my $keywords = &Apache::lonnet::metadata($filelink,'keywords');
- # $keywords = ' ' if (!$keywords);
- $r->print('<td> '.($keywords eq '' ? ' ' : $keywords).
- " </td>\n");
- }
-
- if ($hash{'display_attrs_6'} == 1) {
- my $lang = &Apache::lonnet::metadata($filelink,'language');
- $lang = &Apache::loncommon::languagedescription($lang);
- $r->print('<td> '.($lang eq '' ? ' ' : $lang).
- " </td>\n");
- }
- if ($hash{'display_attrs_8'} == 1) {
-# statistics
- &dynmetaread($filelink);
- $r->print("<td>");
-
- for (qw(count course stdno avetries difficulty disc clear technical
- correct helpful depth)) {
-
- dynmetaprint($r,$filelink,$_);
- }
-
- $r->print(" </td>\n");
-
- }
- if ($hash{'display_attrs_10'} == 1) {
- my $source = &Apache::lonnet::metadata($filelink,'sourceavail');
+ my $source = &Apache::lonnet::metadata($filelink,'sourceavail');
if($source eq 'open') {
my $sourcelink = &Apache::lonsource::make_link($filelink,$listname);
my $quotable_sourcelink = &Apache::loncommon::escape_single($sourcelink);
@@ -1378,56 +1274,10 @@
} else { #A cuddled else. :P
$r->print("<td> </td>\n");
}
- }
- if ($hash{'display_attrs_11'} == 1) {
-# links
- &dynmetaread($filelink);
- $r->print('<td>');
- &coursecontext($r,$filelink);
- for (qw(goto_list comefrom_list sequsage_list dependencies course_list)) {
- dynmetaprint($r,$filelink,$_);
- }
- $r->print('</td>');
- }
-
-
-
- if ($hash{'display_attrs_7'} == 1) {
# Show resource
my $output=&showpreview($filelink);
$r->print('<td class="LC_fontsize_medium">'.($output eq '' ? ' ':$output).
" </td>\n");
- }
-
- if ($hash{'display_attrs_12'} == 1) {
- my $subject = &Apache::lonnet::metadata($filelink,'subject');
- $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");
- }
-
- if ($hash{'display_attrs_15'} == 1) {
- my $gradelevel = &Apache::lonnet::metadata($filelink,'gradelevel');
- $r->print('<td> '.($gradelevel eq '' ? ' ' : $gradelevel).
- " </td>\n");
- }
-
- if ($hash{'display_attrs_16'} == 1) {
- my $standards = &Apache::lonnet::metadata($filelink,'standards');
- $r->print('<td> '.($standards eq '' ? ' ' : $standards).
- " </td>\n");
- }
$r->print(&Apache::loncommon::end_data_table_row());
}
More information about the LON-CAPA-cvs
mailing list