--- rat/lonwrapper.pm 2020/05/22 23:54:42 1.49.2.4.4.2 +++ rat/lonwrapper.pm 2017/12/18 23:23:14 1.66 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Wrapper for external and binary files as standalone resources # -# $Id: lonwrapper.pm,v 1.49.2.4.4.2 2020/05/22 23:54:42 raeburn Exp $ +# $Id: lonwrapper.pm,v 1.66 2017/12/18 23:23:14 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -37,7 +37,9 @@ use Apache::lonlocal; use Apache::loncommon(); use Apache::lonhtmlcommon(); use Apache::lonextresedit(); +use Apache::lonexttool(); use LONCAPA qw(:DEFAULT :match); +use HTML::Entities(); # ================================================================ Main Handler sub wrapper { @@ -48,7 +50,6 @@ sub wrapper { unless ($env{'form.folderpath'}) { $forcereg = 1; } - my %lt = &Apache::lonlocal::texthash( 'noif' => 'No iframe support.', 'show' => 'Show content in pop-up window', @@ -84,6 +85,22 @@ sub wrapper { my $startpage = &Apache::loncommon::start_page('Menu',undef,$args); my $endpage = &Apache::loncommon::end_page(); + if (($exttool) && (&Apache::lonnet::EXT('resource.0.gradable'))) { + my $resource_due = &Apache::lonhomework::due_date(0, $env{'request.symb'}); + if ($resource_due) { + my $time_left = $resource_due - time(); + if ($resource_due && ($time_left > 0)) { + $startpage .=' +'."\n". + &Apache::lonhtmlcommon::set_due_date($resource_due); + } + } + } + if (($env{'browser.mobile'}) || ($exttool eq 'window') || ($exttool eq 'tab')) { my $output = $startpage; if ($is_pdf) { @@ -104,6 +121,7 @@ sub wrapper { if ($linktext eq '') { $linktext = &mt('Launch External Tool'); } + $url = &HTML::Entities::encode($url,'"<>&'); if ($exttool eq 'tab') { $output .= '
'. ''. @@ -113,9 +131,9 @@ sub wrapper { $output .= <<"ENDLINK";