version 1.80, 2022/10/27 21:35:30
|
version 1.86, 2023/12/31 21:45:03
|
Line 82 sub wrapper {
|
Line 82 sub wrapper {
|
} |
} |
} |
} |
|
|
my $noiframe = &Apache::loncommon::modal_link($url.$anchor,$lt{'show'},500,400); |
my $noiframe = &Apache::loncommon::modal_link(&HTML::Entities::encode($url.$anchor,'&<>"\''),$lt{'show'},500,400); |
my $args = {'bgcolor' => '#FFFFFF'}; |
my $args = {'bgcolor' => '#FFFFFF'}; |
if ($forcereg) { |
if ($forcereg) { |
$args->{'force_register'} = $forcereg; |
$args->{'force_register'} = $forcereg; |
Line 95 sub wrapper {
|
Line 95 sub wrapper {
|
} |
} |
if ($env{'form.only_body'}) { |
if ($env{'form.only_body'}) { |
$args->{'only_body'} = $env{'form.only_body'}; |
$args->{'only_body'} = $env{'form.only_body'}; |
|
} elsif (($is_supp) && ($env{'form.folderpath'} ne '')) { |
|
$args->{'bread_crumbs_nomenu'} = 1; |
} |
} |
|
|
my ($countdown,$donemsg,$headjs); |
my ($countdown,$donemsg,$headjs); |
Line 151 sub wrapper {
|
Line 153 sub wrapper {
|
# |
# |
|
|
unless ($clientmobile || ($exttool eq 'window') || ($exttool eq 'tab') || $uselink) { |
unless ($clientmobile || ($exttool eq 'window') || ($exttool eq 'tab') || $uselink) { |
$headjs = ' |
$headjs = &Apache::loncommon::iframe_wrapper_headjs(); |
<script type="text/javascript"> |
|
// <![CDATA[ |
|
var LCnotready = 0; |
|
var LCresizedef = 0; |
|
// ]]> |
|
</script>'."\n"; |
|
} |
} |
|
|
my $startpage = &Apache::loncommon::start_page('Menu',$headjs,$args).$countdown.$donemsg; |
my $startpage = &Apache::loncommon::start_page('Menu',$headjs,$args).$countdown.$donemsg; |
Line 300 ENDLINK
|
Line 296 ENDLINK
|
$linktext = &mt('Link to resource'); |
$linktext = &mt('Link to resource'); |
return $startpage.&create_link($url,$anchor,$title,$linktext).$endpage; |
return $startpage.&create_link($url,$anchor,$title,$linktext).$endpage; |
} else { |
} else { |
my $offset = 5; |
|
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['inhibitmenu']); |
|
if ($env{'form.inhibitmenu'} eq 'yes') { |
|
$offset = 0; |
|
} |
|
my $script = &Apache::lonhtmlcommon::scripttag(<<SCRIPT); |
|
\$(document).ready( function() { |
|
\$(window).unbind('resize').resize(function(){ |
|
var header = null; |
|
var offset = $offset; |
|
var height = 0; |
|
var hdrtop = 0; |
|
if (\$('div.LC_head_subbox:first').length) { |
|
header = \$('div.LC_head_subbox:first'); |
|
offset = 9; |
|
} else { |
|
if (\$('#LC_breadcrumbs').length) { |
|
header = \$('#LC_breadcrumbs'); |
|
} |
|
} |
|
if (header != null && header.length) { |
|
height = header.height(); |
|
hdrtop = header.position().top; |
|
} |
|
var pos = height + hdrtop + offset; |
|
\$('.LC_iframecontainer').css('top', pos); |
|
}); |
|
LCresizedef = 1; |
|
if (LCnotready == 1) { |
|
LCnotready = 0; |
|
\$(window).trigger('resize'); |
|
} |
|
}); |
|
window.onload = function(){ |
|
if (LCresizedef) { |
|
LCnotready = 0; |
|
\$(window).trigger('resize'); |
|
} else { |
|
LCnotready = 1; |
|
} |
|
}; |
|
SCRIPT |
|
# javascript will position the iframe if window was resized (or zoomed) |
# javascript will position the iframe if window was resized (or zoomed) |
|
my $script = &Apache::loncommon::iframe_wrapper_resizejs(); |
my $dest = &HTML::Entities::encode($url.$anchor,'&<>"'); |
my $dest = &HTML::Entities::encode($url.$anchor,'&<>"'); |
return <<ENDFRAME; |
return <<ENDFRAME; |
$startpage |
$startpage |
Line 425 sub handler {
|
Line 380 sub handler {
|
my %toolhash = &Apache::lonnet::get('exttool_'.$marker,['target','linktext','explanation','id','width','height'], |
my %toolhash = &Apache::lonnet::get('exttool_'.$marker,['target','linktext','explanation','id','width','height'], |
$cdom,$cnum); |
$cdom,$cnum); |
if ($toolhash{'id'}) { |
if ($toolhash{'id'}) { |
my %ltitools = &Apache::lonnet::get_domain_lti($cdom,'consumer'); |
my ($idx,%ltitools); |
if (ref($ltitools{$toolhash{'id'}}) eq 'HASH') { |
if ($toolhash{'id'} =~ /^c(\d+)$/) { |
$exttoolremote = $ltitools{$toolhash{'id'}}{'url'}; |
$idx = $1; |
|
%ltitools = &Apache::lonnet::get_course_lti($cnum,$cdom,'consumer'); |
|
} else { |
|
$idx = $toolhash{'id'}; |
|
%ltitools = &Apache::lonnet::get_domain_lti($cdom,'consumer'); |
|
} |
|
if (ref($ltitools{$idx}) eq 'HASH') { |
|
$exttoolremote = $ltitools{$idx}{'url'}; |
} |
} |
} |
} |
if ($toolhash{'target'} eq 'window') { |
if ($toolhash{'target'} eq 'window') { |
Line 446 sub handler {
|
Line 408 sub handler {
|
} |
} |
if (($is_ext) || ($exttool)) { |
if (($is_ext) || ($exttool)) { |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
['forceedit','register','folderpath','symb','idx','title','anchor']); |
['forceedit','register','folderpath','symb','idx','title','anchor','only_body']); |
if (($env{'form.forceedit'}) && |
if (($env{'form.forceedit'}) && |
(&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) && |
(&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) && |
(($env{'form.folderpath'} =~ /^supplemental/) || |
(($env{'form.folderpath'} =~ /^supplemental/) || |
Line 484 sub handler {
|
Line 446 sub handler {
|
$title = &mt('External Tool'); |
$title = &mt('External Tool'); |
} |
} |
} |
} |
|
$title = &HTML::Entities::encode($title,'\'"<>&'); |
$is_supp = 1; |
$is_supp = 1; |
if ($env{'request.course.id'}) { |
if ($env{'request.course.id'}) { |
$cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
$cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
$cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
$cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
&Apache::loncommon::validate_folderpath(1,'',$cnum,$cdom); |
&Apache::loncommon::validate_folderpath(1,'',$cnum,$cdom); |
} |
} |
$brcrum = |
unless ($env{'form.only_body'}) { |
&Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1); |
$brcrum = |
|
&Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1); |
|
} |
} |
} |
} elsif ($env{'request.course.id'}) { |
} elsif ($env{'request.course.id'}) { |
my $courseurl = &Apache::lonnet::courseid_to_courseurl($env{'request.course.id'}); |
my $courseurl = &Apache::lonnet::courseid_to_courseurl($env{'request.course.id'}); |
Line 499 sub handler {
|
Line 464 sub handler {
|
if ($url =~ m{^\Q/uploaded/$courseurl/supplemental/\E}) { |
if ($url =~ m{^\Q/uploaded/$courseurl/supplemental/\E}) { |
$is_supp = 1; |
$is_supp = 1; |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
['folderpath','title']); |
['folderpath','title','only_body']); |
if ($env{'form.folderpath'}) { |
if ($env{'form.folderpath'}) { |
$cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
$cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
$cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
$cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
&Apache::loncommon::validate_folderpath(1,'',$cnum,$cdom); |
&Apache::loncommon::validate_folderpath(1,'',$cnum,$cdom); |
} |
} |
my $title = $env{'form.title'}; |
my $title = $env{'form.title'}; |
|
$title = &HTML::Entities::encode($title,'\'"<>&'); |
my $crstype = &Apache::loncommon::course_type(); |
my $crstype = &Apache::loncommon::course_type(); |
$brcrum = |
unless ($env{'form.only_body'}) { |
&Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1); |
$brcrum = |
|
&Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1); |
|
} |
} |
} |
} |
} |
|
|
Line 570 described at http://www.lon-capa.org.
|
Line 537 described at http://www.lon-capa.org.
|
|
|
=over |
=over |
|
|
=item wrapper($r,$url,$brcrum,$absolute,$is_ext,$is_pdf,$exttool,$linktext,$explanation,$title,$width,$height,$reuse,$is_supp) |
=item wrapper() |
|
|
|
Args: $r,$url,$brcrum,$absolute,$is_ext,$is_pdf,$exttool,$linktext,$explanation,$title,$width,$height,$reuse,$is_supp |
|
|
=over |
=over |
|
|
Line 675 of all external resource instances in a
|
Line 644 of all external resource instances in a
|
|
|
Returns markup for the entire page. |
Returns markup for the entire page. |
|
|
|
=item create_link() |
|
|
|
Args: $url,$anchor,$title,$linktext |
|
|
|
=over |
|
|
|
=item $url |
|
|
|
URL to link to |
|
|
|
=item $anchor |
|
|
|
optional. Will be the anchor to append to the URL, if there is one. |
|
|
|
=item $title |
|
|
|
optional. If provided will be the title displayed above the link. If |
|
one is not provided, then $env{'form.title'} will be used, unless empty. |
|
|
|
=item $linktext |
|
|
|
The text to inlcude between the <a href="$url"> and </a> tags. |
|
|
|
=back |
|
|
|
Returns HTML needed to show a link which can be followed to display the |
|
part of the original URL following the initial /adm/wrapper part |
|
in the original request, in the case where an iframe is not going to be |
|
used to embed the content available at the URL in the existing page. |
|
|
=item handler() |
=item handler() |
|
|
Content handler for requests for: /adm/wrapper/... |
Content handler for requests for: /adm/wrapper/... |