--- loncom/interface/loncommon.pm 2006/05/09 15:09:27 1.366 +++ loncom/interface/loncommon.pm 2006/05/12 02:17:50 1.370 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.366 2006/05/09 15:09:27 albertel Exp $ +# $Id: loncommon.pm,v 1.370 2006/05/12 02:17:50 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -64,6 +64,7 @@ use HTML::Entities; use Apache::lonhtmlcommon(); use Apache::loncoursedata(); use Apache::lontexconvert(); +use LONCAPA; my $readit; @@ -709,7 +710,7 @@ sub help_open_menu { my $timestamp = time; foreach my $datum (\$color,\$function,\$topic,\$component_help,\$faq, \$bug,\$origurl) { - $$datum = &Apache::lonnet::escape($$datum); + $$datum = &escape($$datum); } if (!$stayOnPage) { $link = "javascript:helpMenu('open')"; @@ -775,7 +776,7 @@ ENDTEMPLATE $width,$height).' '.$template; } else { my $help_text; - $help_text=&Apache::lonnet::unescape($topic); + $help_text=&unescape($topic); $template=''; + $prevattempts.=''; } } } @@ -2406,7 +2408,7 @@ sub get_previous_attempt { } else { $value=$lasthash{$key}; } - $value=&Apache::lonnet::unescape($value); + $value=&unescape($value); if ($key =~/$regexp$/ && (defined &$gradesub)) {$value = &$gradesub($value)} $prevattempts.=''; } @@ -2528,7 +2530,7 @@ sub submlink { if (!$symb) { $symb=$cursymb; } } if (!$symb) { $symb=&Apache::lonnet::symbread(); } - $symb=&Apache::lonnet::escape($symb); + $symb=&escape($symb); if ($target) { $target="target=\"$target\""; } return ' - + $roleinfo +
'. &help_open_topic($component_help,$help_text,$stayOnPage, $width,$height).''.$template. @@ -803,7 +804,7 @@ sub help_open_bug { my $link=''; my $template=''; my $url=$Apache::lonnet::perlvar{'BugzillaHost'}.'enter_bug.cgi?product=LON-CAPA&bug_file_loc='. - &Apache::lonnet::escape($ENV{'REQUEST_URI'}).'&component='.$topic; + &escape($ENV{'REQUEST_URI'}).'&component='.$topic; if (!$stayOnPage) { $link = "javascript:void(open('$url', 'Bugzilla', 'menubar=0,toolbar=1,scrollbars=1,width=$width,height=$height,resizable=yes'))"; @@ -2024,10 +2025,11 @@ sub screenname { # ------------------------------------------------------------- Message Wrapper sub messagewrapper { - my ($link,$username,$domain)=@_; + my ($link,$username,$domain,$subject,$text)=@_; return ''.$link.''; } # --------------------------------------------------------------- Notes Wrapper @@ -2394,7 +2396,7 @@ sub get_previous_attempt { } else { $value=$returnhash{$version.':'.$key}; } - $prevattempts.=''.&Apache::lonnet::unescape($value).' '.&unescape($value).' '.$value.' 
$upperleft
$titleinfo $dc_info $menu
ENDBODY } @@ -3117,6 +3128,7 @@ table#LC_title_bar { width: 100%; border: 0; border-spacing: 0px 1px; + padding: 0px 2px 0px 2px; background: $pgbg; font-family: $sans; border-collapse: collapse; @@ -3145,6 +3157,11 @@ span.LC_title_bar_title { table#LC_title_bar td.LC_title_bar_domain_logo { background: $sidebg; text-align: right; + padding: 0px; +} +table#LC_title_bar td.LC_title_bar_role_logo { + background: $sidebg; + padding: 0px; } table#LC_menubuttons_mainmenu { @@ -3304,7 +3321,7 @@ sub headtag { $env{'environment.color.timestamp'}, $function,$domain,$bgcolor); - $url = '/adm/css/'.&Apache::lonnet::escape($url).'.css'; + $url = '/adm/css/'.&escape($url).'.css'; my $result = ''. @@ -3646,6 +3663,14 @@ sub simple_error_page { sub end_data_table_row { return ''; } + + sub start_data_table_header_row { + return ''; + } + + sub end_data_table_header_row { + return ''; + } } ############################################### @@ -3904,7 +3929,7 @@ sub get_group_settings { $content{$tool}{$function} = $value; } } elsif ($entry eq 'groupname') { - $content{$entry}=&Apache::lonnet::unescape($value); + $content{$entry}=&unescape($value); } elsif (($entry eq 'roles') || ($entry eq 'types') || ($entry eq 'sectionpick') || ($entry eq 'defpriv')) { push(@{$content{$entry}},$value); @@ -4091,7 +4116,7 @@ sub get_unprocessed_cgi { # $Apache::lonxml::debug=1; foreach my $pair (split(/&/,$query)) { my ($name, $value) = split(/=/,$pair); - $name = &Apache::lonnet::unescape($name); + $name = &unescape($name); if (!defined($possible_names) || (grep {$_ eq $name} @$possible_names)) { $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; @@ -4720,9 +4745,9 @@ sub DrawBarGraph { $Title = '' if (! defined($Title)); $xlabel = '' if (! defined($xlabel)); $ylabel = '' if (! defined($ylabel)); - $ValuesHash{$id.'.title'} = &Apache::lonnet::escape($Title); - $ValuesHash{$id.'.xlabel'} = &Apache::lonnet::escape($xlabel); - $ValuesHash{$id.'.ylabel'} = &Apache::lonnet::escape($ylabel); + $ValuesHash{$id.'.title'} = &escape($Title); + $ValuesHash{$id.'.xlabel'} = &escape($xlabel); + $ValuesHash{$id.'.ylabel'} = &escape($ylabel); $ValuesHash{$id.'.y_max_value'} = $Max; $ValuesHash{$id.'.NumBars'} = $NumBars; $ValuesHash{$id.'.NumSets'} = $NumSets; @@ -4802,9 +4827,9 @@ sub DrawXYGraph { $ylabel = '' if (! defined($ylabel)); my %ValuesHash = ( - $id.'.title' => &Apache::lonnet::escape($Title), - $id.'.xlabel' => &Apache::lonnet::escape($xlabel), - $id.'.ylabel' => &Apache::lonnet::escape($ylabel), + $id.'.title' => &escape($Title), + $id.'.xlabel' => &escape($xlabel), + $id.'.ylabel' => &escape($ylabel), $id.'.y_max_value'=> $Max, $id.'.labels' => join(',',@$Xlabels), $id.'.PlotType' => 'XY', @@ -4899,9 +4924,9 @@ sub DrawXYYGraph { $ylabel = '' if (! defined($ylabel)); my %ValuesHash = ( - $id.'.title' => &Apache::lonnet::escape($Title), - $id.'.xlabel' => &Apache::lonnet::escape($xlabel), - $id.'.ylabel' => &Apache::lonnet::escape($ylabel), + $id.'.title' => &escape($Title), + $id.'.xlabel' => &escape($xlabel), + $id.'.ylabel' => &escape($ylabel), $id.'.labels' => join(',',@$Xlabels), $id.'.PlotType' => 'XY', $id.'.NumSets' => 2, @@ -4973,7 +4998,7 @@ Inputs: sub chartlink { my ($linktext, $sname, $sdomain) = @_; my $link = ''.$linktext.''; } @@ -5036,11 +5061,11 @@ sub store_course_settings { if (ref($env{'form.'.$setting})) { $stored_form = join(',', map { - &Apache::lonnet::escape($_); + &escape($_); } sort(@{$env{'form.'.$setting}})); } else { $stored_form = - &Apache::lonnet::escape($env{'form.'.$setting}); + &escape($env{'form.'.$setting}); } # Determine if the array contents are the same. if ($stored_form ne $env{$envname}) { @@ -5074,7 +5099,7 @@ sub restore_course_settings { } elsif ($type eq 'array') { $env{'form.'.$setting} = [ map { - &Apache::lonnet::unescape($_); + &unescape($_); } split(',',$env{$envname}) ]; } @@ -5147,7 +5172,7 @@ sub escape_double { sub escape_url { my ($url) = @_; my @urlslices = split(/\//, $url,-1); - my $lastitem = &Apache::lonnet::escape(pop(@urlslices)); + my $lastitem = &escape(pop(@urlslices)); return join('/',@urlslices).'/'.$lastitem; } =pod