version 1.183, 2008/09/19 09:08:53
|
version 1.185, 2009/02/02 19:38:12
|
Line 420 ENDHEADER
|
Line 420 ENDHEADER
|
|
|
# ---------------------------------- get state of file attributes to be showing |
# ---------------------------------- get state of file attributes to be showing |
if ($env{'form.attrs'}) { |
if ($env{'form.attrs'}) { |
for (my $i=0; $i<=11; $i++) { |
for (my $i=0; $i<=12; $i++) { |
delete $hash{'display_attrs_'.$i}; |
delete $hash{'display_attrs_'.$i}; |
if ($env{'form.attr'.$i} == 1) { |
if ($env{'form.attr'.$i} == 1) { |
$attrchk[$i] = 'checked'; |
$attrchk[$i] = 'checked'; |
Line 428 ENDHEADER
|
Line 428 ENDHEADER
|
} |
} |
} |
} |
} else { |
} else { |
for (my $i=0; $i<=11; $i++) { |
for (my $i=0; $i<=12; $i++) { |
$attrchk[$i] = 'checked' if $hash{'display_attrs_'.$i} == 1; |
$attrchk[$i] = 'checked' if $hash{'display_attrs_'.$i} == 1; |
} |
} |
} |
} |
Line 444 ENDHEADER
|
Line 444 ENDHEADER
|
'st' => 'Statistics', |
'st' => 'Statistics', |
'au' => 'Author', |
'au' => 'Author', |
'kw' => 'Keywords', |
'kw' => 'Keywords', |
|
'sb' => 'Subject', |
'ln' => 'Language', |
'ln' => 'Language', |
'sa' => 'Source Available', |
'sa' => 'Source Available', |
'sr' => 'Show resource', |
'sr' => 'Show resource', |
Line 478 ENDHEADER
|
Line 479 ENDHEADER
|
<td><label><input type="checkbox" name="attr8" value="1" $attrchk[8] onClick="this.form.submit();" /> $lt{'st'}</label></td> |
<td><label><input type="checkbox" name="attr8" value="1" $attrchk[8] onClick="this.form.submit();" /> $lt{'st'}</label></td> |
<td><label><input type="checkbox" name="attr11" value="1" $attrchk[11] onClick="this.form.submit();" /> $lt{'li'}</label></td> |
<td><label><input type="checkbox" name="attr11" value="1" $attrchk[11] onClick="this.form.submit();" /> $lt{'li'}</label></td> |
<td><label><input type="checkbox" name="attr7" value="1" $attrchk[7] onClick="this.form.submit();" /> $lt{'sr'}</label></td> |
<td><label><input type="checkbox" name="attr7" value="1" $attrchk[7] onClick="this.form.submit();" /> $lt{'sr'}</label></td> |
|
<td><label><input type="checkbox" name="attr12" value="1" $attrchk[12] onClick="this.form.submit();" /> $lt{'sb'}</label></td> |
<td> </td> |
<td> </td> |
</tr> |
</tr> |
</table> |
</table> |
Line 569 END
|
Line 571 END
|
if ($hash{'display_attrs_11'} == 1); |
if ($hash{'display_attrs_11'} == 1); |
$r->print("<th>".&mt("Resource")."</th>\n") |
$r->print("<th>".&mt("Resource")."</th>\n") |
if ($hash{'display_attrs_7'} == 1); |
if ($hash{'display_attrs_7'} == 1); |
$r->print(&Apache::loncommon::end_data_table_header_row()); |
$r->print("<th>".&mt("Subject")."</th>\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" |
# ----------------- read in what directories have previously been set to "open" |
foreach (keys %hash) { |
foreach (keys %hash) { |
Line 834 sub display_line {
|
Line 841 sub display_line {
|
|
|
my $tabtag='</td>'; |
my $tabtag='</td>'; |
my $i=0; |
my $i=0; |
while ($i<=11) { |
while ($i<=12) { |
$tabtag=join('',$tabtag,"<td> </td>") |
$tabtag=join('',$tabtag,"<td> </td>") |
if ($i != 9 && |
if ($i != 9 && |
$hash{'display_attrs_'.$i} == 1); |
$hash{'display_attrs_'.$i} == 1); |
Line 957 sub display_line {
|
Line 964 sub display_line {
|
} |
} |
# Set the icon for the file |
# Set the icon for the file |
my $iconname = &Apache::loncommon::icon($listname); |
my $iconname = &Apache::loncommon::icon($listname); |
#SB $r->print("<tr valign='$valign' bgcolor=\"$fileclr\"><td nowrap='nowrap' valign='top'>"); |
#SB $r->print("<tr valign='$valign' bgcolor=\"$fileclr\">); |
$r->print(&Apache::loncommon::start_data_table_row()); # valign="$valign" ?!?" |
$r->print(&Apache::loncommon::start_data_table_row()); #SB valign="$valign" ?!? |
$r->print('<td nowrap="nowrap" valign="top">'); |
$r->print('<td valign="top"><span class="LC_nobreak">'); |
|
|
if ($env{'form.catalogmode'} eq 'interactive') { |
if ($env{'form.catalogmode'} eq 'interactive') { |
my $quotable_filelink = &Apache::loncommon::escape_single($filelink); |
my $quotable_filelink = &Apache::loncommon::escape_single($filelink); |
Line 967 sub display_line {
|
Line 974 sub display_line {
|
$quotable_filelink,"')\">"); |
$quotable_filelink,"')\">"); |
$r->print("<img alt=\"\" src='",$iconpath,"select.gif' class='LC_icon' /></a>". |
$r->print("<img alt=\"\" src='",$iconpath,"select.gif' class='LC_icon' /></a>". |
"\n"); |
"\n"); |
$r->print("</td><td nowrap='nowrap' valign='top'>"); |
$r->print('</span></td><td valign="top"><span class="LC_nobreak">'); |
} elsif ($env{'form.catalogmode'} eq 'import') { |
} elsif ($env{'form.catalogmode'} eq 'import') { |
$r->print("<form name='form$fnum' action=''>\n"); |
$r->print("<form name='form$fnum' action=''>\n"); |
$r->print("<input type='checkbox' name='filelink"."' ". |
$r->print("<input type='checkbox' name='filelink"."' ". |
Line 977 sub display_line {
|
Line 984 sub display_line {
|
$r->print("checked"); |
$r->print("checked"); |
} |
} |
$r->print(" />\n"); |
$r->print(" />\n"); |
$r->print("</form></td><td nowrap='nowrap' valign='top'>"); |
$r->print('</form></span></td><td valign="top"><span class="LC_nobreak">'); |
$hash{"pre_${fnum}_link"}=$filelink; |
$hash{"pre_${fnum}_link"}=$filelink; |
$hash{"pre_${fnum}_title"}=$title; |
$hash{"pre_${fnum}_title"}=$title; |
if (!$hash{"pre_${fnum}_title"}) { |
if (!$hash{"pre_${fnum}_title"}) { |
Line 992 sub display_line {
|
Line 999 sub display_line {
|
$indent--; |
$indent--; |
} |
} |
# General indentation |
# General indentation |
if ($indent > 0 and $indent < 11) { |
if ($indent > 0 and $indent < 12) { |
$r->print("<img alt=\"\" src='",$iconpath,"whitespace",$indent, |
$r->print("<img alt=\"\" src='",$iconpath,"whitespace",$indent, |
".gif' class='LC_icon' />\n"); |
".gif' class='LC_icon' />\n"); |
} elsif ($indent >0) { |
} elsif ($indent >0) { |
Line 1034 sub display_line {
|
Line 1041 sub display_line {
|
if ($filelink=~/\.(page|sequence)$/) { |
if ($filelink=~/\.(page|sequence)$/) { |
$r->print('</form>'); |
$r->print('</form>'); |
} |
} |
$r->print("</td>\n"); |
$r->print("</span></td>\n"); |
if ($hash{'display_attrs_0'} == 1) { |
if ($hash{'display_attrs_0'} == 1) { |
$r->print('<td> '.($title eq '' ? ' ' : $title). |
$r->print('<td> '.($title eq '' ? ' ' : $title). |
' </td>'."\n"); |
' </td>'."\n"); |
} |
} |
$r->print('<td align=right> ', |
$r->print('<td align="right"> ', |
$filecom[8]," </td>\n") |
$filecom[8]," </td>\n") |
if $hash{'display_attrs_1'} == 1; |
if $hash{'display_attrs_1'} == 1; |
$r->print('<td> '. |
$r->print('<td> '. |
Line 1060 sub display_line {
|
Line 1067 sub display_line {
|
$r->print('<td> '.($keywords eq '' ? ' ' : $keywords). |
$r->print('<td> '.($keywords eq '' ? ' ' : $keywords). |
" </td>\n"); |
" </td>\n"); |
} |
} |
#' |
|
|
|
if ($hash{'display_attrs_6'} == 1) { |
if ($hash{'display_attrs_6'} == 1) { |
my $lang = &Apache::lonnet::metadata($filelink,'language'); |
my $lang = &Apache::lonnet::metadata($filelink,'language'); |
Line 1112 sub display_line {
|
Line 1118 sub display_line {
|
&dynmetaprint($r,$filelink,'course_list'); |
&dynmetaprint($r,$filelink,'course_list'); |
$r->print('</td>'); |
$r->print('</td>'); |
} |
} |
if ($hash{'display_attrs_7'} == 1) { |
|
|
|
|
|
|
if ($hash{'display_attrs_7'} == 1) { |
# Show resource |
# Show resource |
my $output=&showpreview($filelink); |
my $output=&showpreview($filelink); |
$r->print('<td> '.($output eq '' ? ' ':$output). |
$r->print('<td> '.($output eq '' ? ' ':$output). |
" </td>\n"); |
" </td>\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('<td> '.($subject eq '' ? ' ' : $subject). |
|
" </td>\n"); |
|
} |
|
|
|
$r->print(&Apache::loncommon::end_data_table_row()); |
|
} |
|
|
|
|
|
|
# -- display directory |
# -- display directory |
if ($fnptr == $dirptr) { |
if ($fnptr == $dirptr) { |
Line 1132 sub display_line {
|
Line 1151 sub display_line {
|
$r->print($extrafield.'<td valign="'.$valign.'">'); |
$r->print($extrafield.'<td valign="'.$valign.'">'); |
&begin_form ($r,$curdir); |
&begin_form ($r,$curdir); |
my $indentm1 = $indent-1; |
my $indentm1 = $indent-1; |
if ($indentm1 < 11 and $indentm1 > 0) { |
if ($indentm1 < 12 and $indentm1 > 0) { |
$r->print("<img alt=\"\" src=",$iconpath,"whitespace",$indentm1, |
$r->print("<img alt=\"\" src=",$iconpath,"whitespace",$indentm1, |
".gif class='LC_icon' />\n"); |
".gif class='LC_icon' />\n"); |
} else { |
} else { |
Line 1194 sub display_line {
|
Line 1213 sub display_line {
|
$r->print('<td> '.($lang eq '' ? ' ' : $lang). |
$r->print('<td> '.($lang eq '' ? ' ' : $lang). |
" </td>\n"); |
" </td>\n"); |
} |
} |
|
|
if ($hash{'display_attrs_8'} == 1) { |
if ($hash{'display_attrs_8'} == 1) { |
$r->print('<td> </td>'); |
$r->print('<td> </td>'); |
} |
} |
if ($hash{'display_attrs_10'} == 1) { |
if ($hash{'display_attrs_10'} == 1) { |
$r->print('<td> </td>'); |
$r->print('<td> </td>'); |
} |
} |
if ($hash{'display_attrs_11'} == 1) { |
|
$r->print('<td> </td>'); |
|
} |
|
if ($hash{'display_attrs_7'} == 1) { |
if ($hash{'display_attrs_7'} == 1) { |
$r->print('<td> </td>'); |
$r->print('<td> </td>'); |
} |
} |
$r->print(&Apache::loncommon::end_data_table_row()); |
if ($hash{'display_attrs_11'} == 1) { |
|
$r->print('<td> </td>'); |
|
} |
|
if ($hash{'display_attrs_12'} == 1) { |
|
my $subject = &Apache::lonnet::metadata($filelink,'subject'); |
|
# $keywords = ' ' if (!$keywords); |
|
$r->print('<td> '.($subject eq '' ? ' ' : $subject). |
|
" </td>\n"); |
|
} |
|
|
|
$r->print(&Apache::loncommon::end_data_table_row()); |
} |
} |
|
|
} |
} |