--- rat/lonwrapper.pm 2017/06/22 02:11:30 1.49.2.4.2.1 +++ rat/lonwrapper.pm 2020/05/22 23:54:42 1.49.2.4.4.2 @@ -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.2.1 2017/06/22 02:11:30 raeburn Exp $ +# $Id: lonwrapper.pm,v 1.49.2.4.4.2 2020/05/22 23:54:42 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -37,7 +37,6 @@ use Apache::lonlocal; use Apache::loncommon(); use Apache::lonhtmlcommon(); use Apache::lonextresedit(); -use Apache::lonexttool(); use LONCAPA qw(:DEFAULT :match); # ================================================================ Main Handler @@ -202,7 +201,7 @@ sub handler { my $url = $r->uri; my ($is_ext,$brcrum,$absolute,$is_pdf,$exttool,$cdom,$cnum, - $linktext,$explanation,$width,$height); + $linktext,$explanation,$width,$height); for ($url){ s|^/adm/wrapper||; @@ -222,7 +221,7 @@ sub handler { my %toolhash = &Apache::lonnet::get('exttool_'.$marker,['target','linktext','explanation','id','width','height'], $cdom,$cnum); if ($toolhash{'id'}) { - my %ltitools = &Apache::lonnet::get_domain_ltitools($cdom); + my %ltitools = &Apache::lonnet::get_domain_lti($cdom,'consumer'); if (ref($ltitools{$toolhash{'id'}}) eq 'HASH') { $exttoolremote = $ltitools{$toolhash{'id'}}{'url'}; } @@ -241,7 +240,6 @@ sub handler { $exttool = 'tab'; } } - if (($is_ext) || ($exttool)) { &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['forceedit','register','folderpath','symb','idx','title','anchor']); @@ -336,7 +334,7 @@ described at http://www.lon-capa.org. =over -=item wrapper($url,$brcrum,$absolute,$is_ext,$is_pdf,$exttool,$title)) +=item wrapper($url,$brcrum,$absolute,$is_ext,$is_pdf,$exttool,$linktext,$explanation,$title,$width,$height) =over @@ -378,6 +376,22 @@ true if URL is for an external resource. true if URL is for a PDF (based on file extension). +=item $exttool + +If URL is for an External Tool, will contain the target type: iframe, window or tab. + +=item $linktext + +optional. If URL is for an External Tool, and target type is window or tab, +then the link text may be an option set in the course for each tool instance, +or may be a default defined in the domain for all instances of the tool. + +=item $explanation + +optional. If URL is for an External Tool, and target type is window or tab, +then the explanation is an option set in the course for each tool instance, +or may be a default defined in the domain for all instances of the tool. + =item $title optional. If wrapped item is a PDF, and $env{'browser.mobile'} @@ -386,6 +400,20 @@ above the link, but if not provided as a will be used, otherwise, the filename will be displayed (unless hidden URL set for the resource). +=item $width + +optional. If URL is for an External Tool, and target type is window, +then a default width may have been defined in the domain for all instances of +the tool. If so, that width will be used for the window opened (via a link) +to launch the external tool. + +=item $height + +optional. If URL is for an External Tool, and target type is window, +then a default height may have been defined in the domain for all instances of +the tool. If so, that height will be used for the window opened (via a link) +to launch the external tool. + =back Returns markup for the entire page.