--- loncom/interface/lonhelper.pm 2005/10/17 19:46:12 1.124
+++ loncom/interface/lonhelper.pm 2006/01/17 18:39:50 1.129
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# .helper XML handler to implement the LON-CAPA helper
#
-# $Id: lonhelper.pm,v 1.124 2005/10/17 19:46:12 albertel Exp $
+# $Id: lonhelper.pm,v 1.129 2006/01/17 18:39:50 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -576,6 +576,7 @@ sub display {
my $html=&Apache::lonxml::xmlbegin();
my $stateTitle=&mt($state->title());
my $helperTitle = &mt($self->{TITLE});
+ my $browser_searcher_js = &Apache::loncommon::browser_and_searcher_javascript();
my $bodytag = &Apache::loncommon::bodytag($helperTitle,'','');
my $previous = HTML::Entities::encode(&mt("<- Previous"), '<>&"');
my $next = HTML::Entities::encode(&mt("Next ->"), '<>&"');
@@ -586,6 +587,9 @@ sub display {
$html
$loncapaHelper: $helperTitle
+
$bodytag
HEADER
@@ -2017,18 +2021,19 @@ BUTTONS
$mapUrl = $self->{MAP_URL};
}
- my @defaultSymbs;
+ my %defaultSymbs;
if (defined($self->{DEFAULT_VALUE})) {
my $valueFunc = eval($self->{DEFAULT_VALUE});
die 'Error in default value code for variable ' .
$self->{'variable'} . ', Perl said: ' . $@ if $@;
- @defaultSymbs = &$valueFunc($helper, $self);
- if (!$multichoice) { # only allowed 1
+ my @defaultSymbs = &$valueFunc($helper, $self);
+ if (!$multichoice && @defaultSymbs) { # only allowed 1
@defaultSymbs = ($defaultSymbs[0]);
}
+ %defaultSymbs = map { if ($_) {($_,1) } } @defaultSymbs;
+ delete($defaultSymbs{''});
}
-
# Create the composite function that renders the column on the nav map
# have to admit any language that lets me do this can't be all bad
# - Jeremy (Pythonista) ;-)
@@ -2076,9 +2081,9 @@ BUTTONS
}
$col .= "