--- loncom/interface/lonhtmlcommon.pm 2007/10/10 00:02:19 1.167 +++ loncom/interface/lonhtmlcommon.pm 2008/01/15 03:42:35 1.172 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.167 2007/10/10 00:02:19 albertel Exp $ +# $Id: lonhtmlcommon.pm,v 1.172 2008/01/15 03:42:35 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -486,8 +486,8 @@ sub build_url { my ($base, $fields)=@_; my $url; $url = $base.'?'; - foreach my $key(keys(%$fields)) { - $url.=$key.'='.$$fields{$key}.'&'; + foreach my $key (keys(%$fields)) { + $url.=&escape($key).'='.&escape($$fields{$key}).'&'; } $url =~ s/&$//; return $url; @@ -645,6 +645,8 @@ sub javascript_nothing { ############################################## ############################################## sub javascript_docopen { + my ($mimetype) = @_; + $mimetype ||= 'text/html'; # safari does not understand document.open() and loads "text/html" my $nothing = "''"; my $user_browser; @@ -658,7 +660,7 @@ sub javascript_docopen { if ($user_browser eq 'safari' && $user_os =~ 'mac') { $nothing = "document.clear()"; } else { - $nothing = "document.open('text/html','replace')"; + $nothing = "document.open('$mimetype','replace')"; } return $nothing; } @@ -868,7 +870,7 @@ sub Create_PrgWin { function openpopwin () { popwin=open(\'\',\'popwin\',\'width=400,height=100\');". "popwin.document.writeln(\'".$start_page. - "

$heading<\/h4>". + "

".&mt("$heading")."<\/h4>". "
". '<\\/form>'.$end_page. @@ -887,8 +889,7 @@ sub Create_PrgWin { } if (!$inputname) { $prog_state{'inputname'}=&get_uniq_name(); - &r_print($r,$heading.' '); + &r_print($r,&mt("$heading [_1]",' ')); } else { $prog_state{'inputname'}=$inputname; @@ -1234,16 +1235,19 @@ returns: nothing if (!defined($menulink)) { $menulink=1; } if ($menulink) { my $description = 'Menu'; + my $no_mt_descr = 0; if (exists($env{'request.course.id'}) && $env{'request.course.id'} ne '') { $description = $env{'course.'.$env{'request.course.id'}.'.description'}; + $no_mt_descr = 1; } unshift(@Crumbs,{ href =>'/adm/menu', title =>'Go to main menu', target =>'_top', text =>$description, + no_mt =>$no_mt_descr, }); } my $links .= @@ -1473,7 +1477,14 @@ sub course_select_row { my ($title,$formname,$totcodes,$codetitles,$idlist,$idlist_titles, $css_class) = @_; my $output = &row_title($title,$css_class); - $output .= qq| + $output .= &course_selection($formname,$totcodes,$codetitles,$idlist,$idlist_titles); + $output .= &row_closure(); + return $output; +} + +sub course_selection { + my ($formname,$totcodes,$codetitles,$idlist,$idlist_titles) = @_; + my $output = qq|