--- loncom/interface/lonhtmlcommon.pm 2021/04/29 17:45:22 1.398
+++ loncom/interface/lonhtmlcommon.pm 2022/05/24 18:21:43 1.402
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common html routines
#
-# $Id: lonhtmlcommon.pm,v 1.398 2021/04/29 17:45:22 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.402 2022/05/24 18:21:43 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -82,6 +82,9 @@ sub coursepreflink {
if (($env{'request.lti.login'}) && ($env{'request.lti.target'} eq 'iframe')) {
$target ='';
}
+ if (($env{'request.deeplink.login'}) && ($env{'request.deeplink.target'})) {
+ $target = ' target="'.$env{'request.deeplink.target'}.'"';
+ }
return '&"').'">'.$text.'';
} else {
return '';
@@ -109,6 +112,9 @@ sub direct_parm_link {
if (($env{'request.lti.login'}) && ($env{'request.lti.target'} eq 'iframe')) {
$target='';
}
+ if (($env{'request.deeplink.login'}) && ($env{'request.deeplink.target'})) {
+ $target = ' target="'.$env{'request.deeplink.target'}.'"';
+ }
return "$linktext";
} else {
return $linktext;
@@ -1917,6 +1923,16 @@ returns: nothing
# The first one should be the course or a menu link
if (!defined($menulink)) { $menulink=1; }
if ($menulink) {
+ if ($env{'request.course.id'}) {
+ my ($menucoll,$deeplinkmenu,$menuref) = &Apache::loncommon::menucoll_in_effect();
+ if (($menucoll) && (ref($menuref) eq 'HASH')) {
+ if ($menuref->{'main'} eq 'n') {
+ undef($menulink);
+ }
+ }
+ }
+ }
+ if ($menulink) {
my $description = 'Menu';
my $no_mt_descr = 0;
if ((exists($env{'request.course.id'})) &&
@@ -1938,6 +1954,9 @@ returns: nothing
if (($env{'request.lti.login'}) && ($env{'request.lti.target'} eq 'iframe')) {
$target='';
}
+ if (($env{'request.deeplink.login'}) && ($env{'request.deeplink.target'})) {
+ $target = $env{'request.deeplink.target'};
+ }
$menulink = { href =>'/adm/menu',
title =>'Go to main menu',
target =>$target,
@@ -1961,7 +1980,10 @@ returns: nothing
if ($env{'request.noversionuri'} eq '/adm/searchcat') {
$hashref->{'target'} = '_top';
if (($env{'request.lti.login'}) && ($env{'request.lti.target'} eq 'iframe')) {
- $hashref->{'target'} = '';
+ $hashref->{'target'} = '_parent';
+ }
+ if (($env{'request.deeplink.login'}) && ($env{'request.deeplink.target'} eq '_self')) {
+ $hashref->{'target'} = '_parent';
}
}
$links=&htmltag( 'a','
',
@@ -3423,12 +3445,18 @@ PARAMSONE
if (itemid != null) {
itemh = itemid.offsetHeight;
}
- var primaryheight = document.getElementById('LC_nav_bar').offsetHeight;
- var secondaryheight;
+ var primaryheight = 0;
+ if (document.getElementById('LC_nav_bar') != null) {
+ primaryheight = document.getElementById('LC_nav_bar').offsetHeight;
+ }
+ var secondaryheight = 0;
if (document.getElementById('LC_secondary_menu') != null) {
secondaryheight = document.getElementById('LC_secondary_menu').offsetHeight;
}
- var crumbsheight = document.getElementById('LC_breadcrumbs').offsetHeight;
+ var crumbsheight = 0;
+ if (document.getElementById('LC_breadcrumbs') != null) {
+ crumbsheight = document.getElementById('LC_breadcrumbs').offsetHeight;
+ }
var dccidheight = 0;
if (document.getElementById('dccid') != null) {
dccidheight = document.getElementById('dccid').offsetHeight;