'; - if ($no_mt) { - $Str .= $component; - } else { - $Str .= &mt($component); - } - if ($icons ne '') { - $Str .= ' '.$icons; - } - $Str .= ' |
'.$$codetitles[0].' '."\n". - ' | ';
for (my $i=1; $i<$numtitles; $i++) {
$output .= ''.$$codetitles[$i].' '."\n". - ''."\n". @@ -1687,7 +1942,7 @@ sub course_selection { $output .= ' |
'.&mt('No context provided.').'
'; + } + return $return; + +} + ############################################## ############################################## # topic_bar # -# Generates a div containing a numbered (static image) followed by a title -# with a background color defined in the corresponding CSS: LC_topic_bar -# +# Generates a div containing an (optional) number with a white background followed by a +# title with a background color defined in the corresponding CSS: LC_topic_bar +# Inputs: +# 1. number to display. +# If input for number is empty only the title will be displayed. +# 2. title text to display. +# Outputs - a scalar containing html mark-up for the div. + sub topic_bar { - my ($imgnum,$title) = @_; - return ' - -'; + my ($num,$title) = @_; + my $number = ''; + if ($num ne '') { + $number = ''.$num.''; + } + return ' '; } ############################################## ############################################## - # echo_form_input # # Generates html markup to add form elements from the referrer page @@ -1857,7 +2136,6 @@ sub echo_form_input { ############################################## ############################################## - # set_form_elements # # Generates javascript to set form elements to values based on @@ -1922,7 +2200,7 @@ sub set_form_elements { $values{$name}[$i] =~ s/([\r\n\f]+)/\\n/g; $values{$name}[$i] =~ s/"/\\"/g; } - if ($$elements{$name} eq 'text') { + if (($$elements{$name} eq 'text') || ($$elements{$name} eq 'hidden')) { my $numvalues = @{$values{$name}}; if ($numvalues > 1) { my $valuestring = join('","',@{$values{$name}}); @@ -1957,6 +2235,8 @@ sub set_form_elements { $output .= qq| if (courseForm.elements['$name'].value == "$value") { courseForm.elements['$name'].checked = true; + } else { + courseForm.elements['$name'].checked = false; }|; } } @@ -1998,6 +2278,7 @@ sub set_form_elements { } } $output .= " + return; }\n"; return $output; } @@ -2039,6 +2320,121 @@ END return $scripttag; } + +# USAGE: htmltag(element, content, {attribute => value,...}); +# +# EXAMPLES: +# - htmltag('a', 'this is an anchor', {href => 'www.example.com', +# title => 'this is a title'}) +# +# - You might want to set up needed tags like: +# +# my $h3 = sub { return htmltag( "h3", @_ ) }; +# +# ... and use them: $h3->("This is a headline") +# +# - To set up a couple of tags, see sub inittags +# +# NOTES: +# - Empty elements, such as