version 1.109, 2004/06/12 01:08:11
|
version 1.111, 2004/06/16 23:39:01
|
Line 53 use Apache::lonmeta;
|
Line 53 use Apache::lonmeta;
|
use Apache::File; |
use Apache::File; |
use Apache::lonlocal; |
use Apache::lonlocal; |
use Apache::lonsource(); |
use Apache::lonsource(); |
|
use LONCAPA::lonmetadata(); |
use GDBM_File; |
use GDBM_File; |
|
|
# ---------------------------------------- variables used throughout the module |
# ---------------------------------------- variables used throughout the module |
my %hash; # global user-specific gdbm file |
my %hash; # global user-specific gdbm file |
my %dirs; # keys are directories, values are the open/close status |
my %dirs; # keys are directories, values are the open/close status |
my %language; # has the reference information present in language.tab |
my %language; # has the reference information present in language.tab |
|
my %dynhash; # hash of hashes for dynamic metadata |
|
|
# ----- Values which are set by the handler subroutine and are accessible to |
# ----- Values which are set by the handler subroutine and are accessible to |
# ----- other methods. |
# ----- other methods. |
Line 407 $r->print(&Apache::loncommon::bodytag('B
|
Line 409 $r->print(&Apache::loncommon::bodytag('B
|
|
|
# ---------------------------------- 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<=10; $i++) { |
for (my $i=0; $i<=11; $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 415 $r->print(&Apache::loncommon::bodytag('B
|
Line 417 $r->print(&Apache::loncommon::bodytag('B
|
} |
} |
} |
} |
} else { |
} else { |
for (my $i=0; $i<=10; $i++) { |
for (my $i=0; $i<=11; $i++) { |
$attrchk[$i] = 'checked' if $hash{'display_attrs_'.$i} == 1; |
$attrchk[$i] = 'checked' if $hash{'display_attrs_'.$i} == 1; |
} |
} |
} |
} |
Line 434 $r->print(&Apache::loncommon::bodytag('B
|
Line 436 $r->print(&Apache::loncommon::bodytag('B
|
'ln' => 'Language', |
'ln' => 'Language', |
'sa' => 'Source Available', |
'sa' => 'Source Available', |
'sr' => 'Show resource', |
'sr' => 'Show resource', |
|
'li' => 'Linked/Related Resources', |
'av' => 'All versions', |
'av' => 'All versions', |
'ud' => 'Update Display' |
'ud' => 'Update Display' |
); |
); |
Line 455 $r->print(&Apache::loncommon::bodytag('B
|
Line 458 $r->print(&Apache::loncommon::bodytag('B
|
<td><input type="checkbox" name="attr6" value="1" $attrchk[6] onClick="this.form.submit();" /> $lt{'ln'}</td> |
<td><input type="checkbox" name="attr6" value="1" $attrchk[6] onClick="this.form.submit();" /> $lt{'ln'}</td> |
<td><input type="checkbox" name="attr7" value="1" $attrchk[7] onClick="this.form.submit();" /> $lt{'sr'}</td> |
<td><input type="checkbox" name="attr7" value="1" $attrchk[7] onClick="this.form.submit();" /> $lt{'sr'}</td> |
<td><input type="checkbox" name="attr9" value="1" $attrchk[9] onClick="this.form.submit();" /> $lt{'av'}</td> |
<td><input type="checkbox" name="attr9" value="1" $attrchk[9] onClick="this.form.submit();" /> $lt{'av'}</td> |
<td> </td> |
<td><input type="checkbox" name="attr11" value="1" $attrchk[11] onClick="this.form.submit();" /> $lt{'li'}</td> |
</tr></table> |
</tr></table> |
<input type="hidden" name="attrs" value="1" /> |
<input type="hidden" name="attrs" value="1" /> |
<input type="submit" name="updatedisplay" value="$lt{'ud'}" /> |
<input type="submit" name="updatedisplay" value="$lt{'ud'}" /> |
Line 516 END
|
Line 519 END
|
if ($hash{'display_attrs_8'} == 1); |
if ($hash{'display_attrs_8'} == 1); |
$r->print("<td><b>".&mt("Source Available")."</b></td>\n") |
$r->print("<td><b>".&mt("Source Available")."</b></td>\n") |
if ($hash{'display_attrs_10'} == 1); |
if ($hash{'display_attrs_10'} == 1); |
|
$r->print("<td><b>".&mt("Linked/Related Resources")."</b></td>\n") |
|
if ($hash{'display_attrs_11'} == 1); |
$r->print('</tr>'); |
$r->print('</tr>'); |
|
|
# ----------------- read in what directories have previously been set to "open" |
# ----------------- read in what directories have previously been set to "open" |
Line 1001 sub display_line {
|
Line 1006 sub display_line {
|
" </td>\n"); |
" </td>\n"); |
} |
} |
if ($hash{'display_attrs_8'} == 1) { |
if ($hash{'display_attrs_8'} == 1) { |
my (%stat) = &Apache::lonmeta::dynamicmeta($filelink); |
# statistics |
my $stat = (exists($stat{'course'}) ? $stat{'course'} : ''). |
$r->print("<td> </td>\n"); |
((exists($stat{'course'}) || exists($stat{'count'})) ? '/' : ''). |
|
(exists($stat{'count'}) ? $stat{'count'} : ''); |
|
$r->print('<td align=center> '.($stat eq '' ? ' ' : $stat). |
|
' </td>'."\n"); |
|
} |
} |
if ($hash{'display_attrs_10'} == 1) { |
if ($hash{'display_attrs_10'} == 1) { |
my $source = &Apache::lonnet::metadata($filelink,'sourceavail'); |
my $source = &Apache::lonnet::metadata($filelink,'sourceavail'); |
if($source eq 'open') { |
if($source eq 'open') { |
my $sourcelink = &Apache::lonsource::make_link($filelink); |
my $sourcelink = &Apache::lonsource::make_link($filelink); |
$r->print('<td>'."<a href=\"javascript:openWindow('".$sourcelink. |
$r->print('<td>'."<a href=\"javascript:openWindow('".$sourcelink. |
"', 'previewsource', '700', '700', 'no', 'yes','yes')\";". |
"', 'previewsource', '700', '700', 'no', 'yes','yes')\";". |
" TARGET=_self>Yes</a> "."</td>\n"); |
" TARGET=_self>Yes</a> "."</td>\n"); |
} else { #A cuddled else. :P |
} else { #A cuddled else. :P |
$r->print('<td>'."</td>\n"); |
$r->print("<td> </td>\n"); |
} |
} |
|
} |
|
if ($hash{'display_attrs_11'} == 1) { |
|
# links |
|
$r->print("<td> </td>\n"); |
} |
} |
$r->print("</tr>\n"); |
$r->print("</tr>\n"); |
} |
} |
Line 1098 sub display_line {
|
Line 1104 sub display_line {
|
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>'); |
|
} |
$r->print('</form></tr>'); |
$r->print('</form></tr>'); |
} |
} |
|
|