--- loncom/interface/lonhelper.pm 2003/05/07 18:22:43 1.21
+++ loncom/interface/lonhelper.pm 2003/05/07 18:48:15 1.22
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# .helper XML handler to implement the LON-CAPA helper
#
-# $Id: lonhelper.pm,v 1.21 2003/05/07 18:22:43 bowersj2 Exp $
+# $Id: lonhelper.pm,v 1.22 2003/05/07 18:48:15 bowersj2 Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1835,6 +1835,10 @@ sub render {
my $filterFunc = $self->{FILTER_FUNC};
my $buttons = '';
+ my $type = 'radio';
+ if ($self->{'multichoice'}) {
+ $type = 'checkbox';
+ }
if ($self->{'multichoice'}) {
$result = <
-
-
+
+
BUTTONS
}
@@ -1892,10 +1896,6 @@ BUTTONS
# Keeps track if there are no choices, prints appropriate error
# if there are none.
my $choices = 0;
- my $type = 'radio';
- if ($self->{'multichoice'}) {
- $type = 'checkbox';
- }
# Print each legitimate file choice.
for my $file (@fileList) {
$file = (split(/&/, $file))[0];
@@ -1905,8 +1905,28 @@ BUTTONS
my $fileName = $subdir .'/'. $file;
if (&$filterFunc($file)) {
(my $status, my $color) = @{fileState($subdir, $file)};
+
+ # Netscape 4 is stupid and there's nowhere to put the
+ # information on the input tag that the file is Published,
+ # Unpublished, etc. In *real* browsers we can just say
+ # "class='Published'" and check the className attribute of
+ # the input tag, but Netscape 4 is too stupid to understand
+ # that attribute, and un-comprehended attributes are not
+ # reflected into the object model. So instead, what I do
+ # is either have or don't have an "onclick" handler that
+ # does nothing, give Published files the onclick handler, and
+ # have the checker scripts check for that. Stupid and clumsy,
+ # and only gives us binary "yes/no" information (at least I
+ # couldn't figure out how to reach into the event handler's
+ # actual code to retreive a value), but it works well enough
+ # here.
+
+ my $onclick = '';
+ if ($status eq 'Published') {
+ $onclick = 'onclick="a=1" ';
+ }
$result .= '