--- loncom/interface/loncommon.pm 2010/03/29 13:40:03 1.963 +++ loncom/interface/loncommon.pm 2010/04/12 15:05:45 1.964 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.963 2010/03/29 13:40:03 raeburn Exp $ +# $Id: loncommon.pm,v 1.964 2010/04/12 15:05:45 droeschl Exp $ # # Copyright Michigan State University Board of Trustees # @@ -4598,8 +4598,6 @@ sub bodytag { } if (!$realm) { $realm=' '; } -# Set messages - my $messages=&domainlogo($domain); my $extra_body_attr = &make_attr_string($forcereg,\%design); @@ -6702,6 +6700,14 @@ $args - additional optional args support sub start_page { my ($title,$head_extra,$args) = @_; #&Apache::lonnet::logthis("start_page ".join(':',caller(0))); +#SD +#I don't see why we copy certain elements of %$args to %head_args +#head args is passed to headtag() and this routine only reads those +#keys that are needed. There doesn't happen any writes or any processing +#of other keys. +#proposal: just pass $args to headtag instead of \%head_args and delete +#marked lines +#<- MARK my %head_args; foreach my $arg ('redirect','force_register','domain','function', 'bgcolor','frameset','no_nav_bar','only_body', @@ -6710,13 +6716,16 @@ sub start_page { $head_args{$arg} = $args->{$arg}; } } +#MARK -> $env{'internal.start_page'}++; my $result; + if (! exists($args->{'skip_phases'}{'head'}) ) { - $result.= - &xml_begin(). - &headtag($title,$head_extra,\%head_args); + $result .= + &xml_begin() . &headtag($title,$head_extra,\%head_args); +#replace prev line by +# &xml_begin() . &headtag($title, $head_extra, $args); } if (! exists($args->{'skip_phases'}{'body'}) ) { @@ -6746,15 +6755,10 @@ sub start_page { # $result .= &build_functionlist(); #} - # Don't add anything more if only_body wanted - return $result if $args->{'only_body'}; + # Don't add anything more if only_body wanted or in const space + return $result if $args->{'only_body'} + || $env{'request.state'} eq 'construct'; - #Breadcrumbs for Construction Space provided by &bodytag. - if ( - $env{'request.state'} eq 'construct') { - return $result; - } - #Breadcrumbs if (exists($args->{'bread_crumbs'}) or exists($args->{'bread_crumbs_component'})) { &Apache::lonhtmlcommon::clear_breadcrumbs();