--- loncom/interface/loncommon.pm 2006/08/11 22:00:07 1.444 +++ loncom/interface/loncommon.pm 2006/09/05 20:42:18 1.449 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.444 2006/08/11 22:00:07 albertel Exp $ +# $Id: loncommon.pm,v 1.449 2006/09/05 20:42:18 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -729,9 +729,7 @@ sub update_help_link { my $banner_link = "/adm/helpmenu?page=banner&topic=$topic&component_help=$component_help&faq=$faq&bug=$bug&origurl=$origurl&stamp=$timestamp&stayonpage=$stayOnPage"; my $output .= <<"ENDOUTPUT"; ENDOUTPUT return $output; @@ -2109,6 +2107,9 @@ sub noteswrapper { sub aboutmewrapper { my ($link,$username,$domain,$target)=@_; + if (!defined($username) && !defined($domain)) { + return; + } return ''.$link.''; } @@ -2139,7 +2140,9 @@ sub track_student_link { $target = ''; } if ($start) { $link.='&start='.$start; } - return qq{$linktext}; + + return qq{$linktext}. + &help_open_topic('View_recent_activity'); } =pod @@ -3181,6 +3184,7 @@ sub standard_css { my $border = ($env{'browser.type'} eq 'explorer') ? '0px 2px 0px 2px' : '0px 3px 0px 4px'; + return <{'nonstandard'}) || ($args->{'firstres'} eq 'blank') || ($cloneid)) { + use LONCAPA::map; $outcome .= &mt('Setting first resource').': '; - my ($errtext,$fatal)= - &Apache::londocs::mapread($$crsunum,$$crsudom,'default.sequence'); + + my $map = '/uploaded/'.$$crsudom.'/'.$$crsunum.'/default.sequence'; + my ($errtext,$fatal)=&LONCAPA::map::mapread($map); + $outcome .= ($fatal?$errtext:'read ok').' - '; my $title; my $url; if ($args->{'firstres'} eq 'syl') { @@ -5861,10 +5868,12 @@ sub construct_course { $title='Navigate Contents'; $url='/adm/navmaps'; } - $Apache::lonratedt::resources[1]=$title.':'.$url.':false:start:res'; - ($errtext,$fatal)= - &Apache::londocs::storemap($$crsunum,$$crsudom,'default.sequence'); - $outcome .= ($fatal?$errtext:'write ok').'
'; + + $LONCAPA::map::resources[1]=$title.':'.$url.':false:start:res'; + (my $outtext,$errtext) = &LONCAPA::map::storemap($map,1); + + if ($errtext) { $fatal=2; } + $outcome .= ($fatal?$errtext:'write ok').'
'; } return $outcome; } @@ -5916,6 +5925,15 @@ sub lonhttpdurl { return 'http://'.$ENV{'SERVER_NAME'}.':'.$lonhttpd_port.$url; } +sub absolute_url { + my ($host_name) = @_; + my $protocol = ($ENV{'SERVER_PORT'} == 443?'https://':'http://'); + if ($host_name eq '') { + $host_name = $ENV{'SERVER_NAME'}; + } + return $protocol.$host_name; +} + sub connection_aborted { my ($r)=@_; $r->print(" ");$r->rflush();