--- loncom/interface/loncommon.pm 2020/01/10 05:15:29 1.1075.2.141 +++ loncom/interface/loncommon.pm 2020/09/28 00:38:30 1.1075.2.147 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.1075.2.141 2020/01/10 05:15:29 raeburn Exp $ +# $Id: loncommon.pm,v 1.1075.2.147 2020/09/28 00:38:30 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -428,7 +428,7 @@ sub studentbrowser_javascript { OFFLOAD - } } } } @@ -8390,8 +8456,7 @@ sub modal_link { $target_attr = 'target="'.$target.'"'; } return <<"ENDLINK"; - - $linktext +$linktext ENDLINK } @@ -15455,12 +15520,17 @@ sub construct_course { # Open all assignments # if ($args->{'openall'}) { + my $opendate = time; + if ($args->{'openallfrom'} =~ /^\d+$/) { + $opendate = $args->{'openallfrom'}; + } my $storeunder=$$crsudom.'_'.$$crsunum.'.0.opendate'; - my %storecontent = ($storeunder => time, + my %storecontent = ($storeunder => $opendate, $storeunder.'.type' => 'date_start'); - - $outcome .= &mt('Opening all assignments').': '.&Apache::lonnet::cput - ('resourcedata',\%storecontent,$$crsudom,$$crsunum).$linefeed; + $outcome .= &mt('All assignments open starting [_1]', + &Apache::lonlocal::locallocaltime($opendate)).': '. + &Apache::lonnet::cput + ('resourcedata',\%storecontent,$$crsudom,$$crsunum).$linefeed; } # # Set first page @@ -17187,7 +17257,9 @@ sub is_nonframeable { } my $uselink; my $request = new HTTP::Request('HEAD',$url); - my $response = &LONCAPA::LWPReq::makerequest('',$request,'','',5); + my $ua = LWP::UserAgent->new; + $ua->timeout(5); + my $response=$ua->request($request); if ($response->is_success()) { my $secpolicy = lc($response->header('content-security-policy')); my $xframeop = lc($response->header('x-frame-options'));