version 1.393, 2018/04/24 13:40:32
|
version 1.405, 2022/06/30 21:04:14
|
Line 79 sub coursepreflink {
|
Line 79 sub coursepreflink {
|
my ($text,$category)=@_; |
my ($text,$category)=@_; |
if (&Apache::lonnet::allowed('opa',$env{'request.course.id'})) { |
if (&Apache::lonnet::allowed('opa',$env{'request.course.id'})) { |
my $target =' target="_top"'; |
my $target =' target="_top"'; |
if (($env{'request.lti.login'}) && ($env{'request.lti.target'} eq 'iframe')) { |
if ((($env{'request.lti.login'}) && ($env{'request.lti.target'} eq 'iframe')) || |
|
(($env{'request.deeplink.login'}) && ($env{'request.deeplink.target'} eq '_self'))) { |
$target =''; |
$target =''; |
} |
} |
return '<a'.$target.' href="'.&HTML::Entities::encode("/adm/courseprefs?phase=display&actions=$category",'<>&"').'"><span class="LC_setting">'.$text.'</span></a>'; |
return '<a'.$target.' href="'.&HTML::Entities::encode("/adm/courseprefs?phase=display&actions=$category",'<>&"').'"><span class="LC_setting">'.$text.'</span></a>'; |
Line 106 sub direct_parm_link {
|
Line 107 sub direct_parm_link {
|
$part=&entity_encode($part); |
$part=&entity_encode($part); |
if (($symb) && (&Apache::lonnet::allowed('opa')) && ($target ne 'tex')) { |
if (($symb) && (&Apache::lonnet::allowed('opa')) && ($target ne 'tex')) { |
my $target=' target="_top"'; |
my $target=' target="_top"'; |
if (($env{'request.lti.login'}) && ($env{'request.lti.target'} eq 'iframe')) { |
if ((($env{'request.lti.login'}) && ($env{'request.lti.target'} eq 'iframe')) || |
|
(($env{'request.deeplink.login'}) && ($env{'request.deeplink.target'} eq '_self'))) { |
$target=''; |
$target=''; |
} |
} |
return "<a".$target." href=\"/adm/parmset?symb=$symb&filter=$filter&part=$part\"><span class=\"LC_setting\">$linktext</span></a>"; |
return "<a".$target." href=\"/adm/parmset?symb=$symb&filter=$filter&part=$part\"><span class=\"LC_setting\">$linktext</span></a>"; |
Line 866 parameter setting wizard.
|
Line 868 parameter setting wizard.
|
############################################## |
############################################## |
sub pjump_javascript_definition { |
sub pjump_javascript_definition { |
my $Str = <<END; |
my $Str = <<END; |
function pjump(type,dis,value,marker,ret,call,hour,min,sec) { |
function pjump(type,dis,value,marker,ret,call,hour,min,sec,extra) { |
openMyModal("/adm/rat/parameter.html?type="+escape(type) |
openMyModal("/adm/rat/parameter.html?type="+escape(type) |
+"&value="+escape(value)+"&marker="+escape(marker) |
+"&value="+escape(value)+"&marker="+escape(marker) |
+"&return="+escape(ret) |
+"&return="+escape(ret) |
+"&call="+escape(call)+"&name="+escape(dis) |
+"&call="+escape(call)+"&name="+escape(dis) |
+"&defhour="+escape(hour)+"&defmin="+escape(min) |
+"&defhour="+escape(hour)+"&defmin="+escape(min) |
+"&defsec="+escape(sec)+"&modal=1",350,350,'no'); |
+"&defsec="+escape(sec)+"&extra="+escape(extra) |
|
+"&modal=1",350,350,'no'); |
} |
} |
END |
END |
return $Str; |
return $Str; |
Line 1737 sub show_return_link {
|
Line 1740 sub show_return_link {
|
return if ($env{'request.noversionuri'} eq '/adm/supplemental'); |
return if ($env{'request.noversionuri'} eq '/adm/supplemental'); |
return if (($env{'course.'.$env{'request.course.id'}.'.type'} eq 'Placement') && |
return if (($env{'course.'.$env{'request.course.id'}.'.type'} eq 'Placement') && |
(!$env{'request.role.adv'})); |
(!$env{'request.role.adv'})); |
if (($env{'request.noversionuri'} =~ m{^/adm/(viewclasslist|navmaps)($|\?)}) |
if (($env{'request.noversionuri'} =~ m{^/adm/viewclasslist($|\?)}) |
|| ($env{'request.noversionuri'} =~ m{^/adm/.*/aboutme($|\?)})) { |
|| ($env{'request.noversionuri'} =~ m{^/adm/.*/aboutme($|\?)})) { |
|
|
return if ($env{'form.register'}); |
return if ($env{'form.register'}); |
Line 1869 loncommon::help_open_topic() to generate
|
Line 1872 loncommon::help_open_topic() to generate
|
text to include in the link in the optional help item ($topic_help) on the right |
text to include in the link in the optional help item ($topic_help) on the right |
side of the breadcrumbs row. |
side of the breadcrumbs row. |
|
|
|
=item $links_target |
|
|
|
optionally includes the target (_top, _parent or _self) for (i) initial |
|
$menulink item in the breadcrumbs (if present), (ii) return to last location |
|
(if present), and (iii) help item at the right side of breadcrumbs menu, |
|
created by loncommon::help_open_topic() or loncommon::help_open_menu(). |
|
|
=back |
=back |
|
|
=back |
=back |
Line 1900 returns: nothing
|
Line 1910 returns: nothing
|
|
|
sub breadcrumbs { |
sub breadcrumbs { |
my ($component,$component_help,$menulink,$helplink,$css_class,$no_mt, |
my ($component,$component_help,$menulink,$helplink,$css_class,$no_mt, |
$CourseBreadcrumbs,$topic_help,$topic_help_text,$crstype) = @_; |
$CourseBreadcrumbs,$topic_help,$topic_help_text,$links_target) = @_; |
# |
# |
$css_class ||= 'LC_breadcrumbs'; |
$css_class ||= 'LC_breadcrumbs'; |
|
|
Line 1916 returns: nothing
|
Line 1926 returns: nothing
|
# The first one should be the course or a menu link |
# The first one should be the course or a menu link |
if (!defined($menulink)) { $menulink=1; } |
if (!defined($menulink)) { $menulink=1; } |
if ($menulink) { |
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 $description = 'Menu'; |
my $no_mt_descr = 0; |
my $no_mt_descr = 0; |
if ((exists($env{'request.course.id'})) && |
if ((exists($env{'request.course.id'})) && |
Line 1934 returns: nothing
|
Line 1954 returns: nothing
|
} |
} |
} |
} |
my $target = '_top'; |
my $target = '_top'; |
if (($env{'request.lti.login'}) && ($env{'request.lti.target'} eq 'iframe')) { |
if ($links_target) { |
|
$target = $links_target; |
|
} elsif ((($env{'request.lti.login'}) && ($env{'request.lti.target'} eq 'iframe')) || |
|
(($env{'request.deeplink.login'}) && ($env{'request.deeplink.target'} eq '_self'))) { |
$target=''; |
$target=''; |
} |
} |
$menulink = { href =>'/adm/menu', |
$menulink = { href =>'/adm/menu', |
Line 1957 returns: nothing
|
Line 1980 returns: nothing
|
title => &mt('Back to most recent content resource'), |
title => &mt('Back to most recent content resource'), |
class => 'LC_menubuttons_link', |
class => 'LC_menubuttons_link', |
}; |
}; |
if ($env{'request.noversionuri'} eq '/adm/searchcat') { |
if ($links_target) { |
$hashref->{'target'} = '_top'; |
$hashref->{'target'} = $links_target; |
if (($env{'request.lti.login'}) && ($env{'request.lti.target'} eq 'iframe')) { |
|
$hashref->{'target'} = ''; |
|
} |
|
} |
} |
$links=&htmltag( 'a','<img src="/res/adm/pages/tolastloc.png" alt="'.$alttext.'" class="LC_icon" />', |
$links=&htmltag( 'a','<img src="/res/adm/pages/tolastloc.png" alt="'.$alttext.'" class="LC_icon" />', |
$hashref); |
$hashref); |
Line 2012 returns: nothing
|
Line 2032 returns: nothing
|
if ($faq ne '' || $component_help ne '' || $bug ne '') { |
if ($faq ne '' || $component_help ne '' || $bug ne '') { |
$icons .= &Apache::loncommon::help_open_menu($component, |
$icons .= &Apache::loncommon::help_open_menu($component, |
$component_help, |
$component_help, |
$faq,$bug); |
$faq,$bug,'','','','', |
|
$links_target); |
} |
} |
if ($topic_help && $topic_help_text) { |
if ($topic_help && $topic_help_text) { |
$icons .= ' '.&Apache::loncommon::help_open_topic($topic_help,&mt($topic_help_text),'', |
$icons .= ' '.&Apache::loncommon::help_open_topic($topic_help,&mt($topic_help_text),'', |
undef,600); |
undef,600,'',$links_target); |
} |
} |
# |
# |
|
|
Line 2216 returns: nothing
|
Line 2237 returns: nothing
|
} # End of scope for @Crumbs |
} # End of scope for @Crumbs |
|
|
sub docs_breadcrumbs { |
sub docs_breadcrumbs { |
my ($allowed,$crstype,$contenteditor,$title,$precleared)=@_; |
my ($allowed,$crstype,$contenteditor,$title,$precleared,$checklinkprot)=@_; |
my ($folderpath,@folders,$supplementalflag); |
my ($folderpath,@folders,$supplementalflag); |
@folders = split('&',$env{'form.folderpath'}); |
@folders = split('&',$env{'form.folderpath'}); |
if ($env{'form.folderpath'} =~ /^supplemental/) { |
if ($env{'form.folderpath'} =~ /^supplemental/) { |
Line 2287 sub docs_breadcrumbs {
|
Line 2308 sub docs_breadcrumbs {
|
if (!$allowed && !$contenteditor) { |
if (!$allowed && !$contenteditor) { |
$menulink = 1; |
$menulink = 1; |
} |
} |
|
if ($checklinkprot) { |
|
if ($env{'request.deeplink.login'}) { |
|
my $linkprotout = &Apache::lonmenu::linkprot_exit(); |
|
if ($linkprotout) { |
|
&Apache::lonhtmlcommon::add_breadcrumb_tool('tools',$linkprotout); |
|
} |
|
} |
|
} |
return (&breadcrumbs(undef,undef,$menulink,'nohelp',undef,undef, |
return (&breadcrumbs(undef,undef,$menulink,'nohelp',undef,undef, |
$contenteditor), |
$contenteditor), |
$randompick,$ishidden,$isencrypted,$plain, |
$randompick,$ishidden,$isencrypted,$plain, |
Line 2660 sub course_custom_roles {
|
Line 2689 sub course_custom_roles {
|
|
|
|
|
sub resource_info_box { |
sub resource_info_box { |
my ($symb,$onlyfolderflag,$stuvcurrent,$stuvdisp)=@_; |
my ($symb,$onlyfolderflag,$stuvcurrent,$stuvdisp,$divforres)=@_; |
my $return=''; |
my $return=''; |
if ($stuvcurrent ne '') { |
if (($stuvcurrent ne '') || ($divforres)) { |
$return = '<div class="LC_left_float">'; |
$return = '<div class="LC_left_float">'; |
} |
} |
if ($symb) { |
if ($symb) { |
Line 2691 sub resource_info_box {
|
Line 2720 sub resource_info_box {
|
} else { |
} else { |
$return='<p><span class="LC_error">'.&mt('No context provided.').'</span></p>'; |
$return='<p><span class="LC_error">'.&mt('No context provided.').'</span></p>'; |
} |
} |
if ($stuvcurrent ne '') { |
if (($stuvcurrent ne '') || ($divforres)) { |
$return .= '</div>'; |
$return .= '</div>'; |
} |
} |
return $return; |
return $return; |
Line 3422 PARAMSONE
|
Line 3451 PARAMSONE
|
if (itemid != null) { |
if (itemid != null) { |
itemh = itemid.offsetHeight; |
itemh = itemid.offsetHeight; |
} |
} |
var primaryheight = document.getElementById('LC_nav_bar').offsetHeight; |
var primaryheight = 0; |
var secondaryheight; |
if (document.getElementById('LC_nav_bar') != null) { |
|
primaryheight = document.getElementById('LC_nav_bar').offsetHeight; |
|
} |
|
var secondaryheight = 0; |
if (document.getElementById('LC_secondary_menu') != null) { |
if (document.getElementById('LC_secondary_menu') != null) { |
secondaryheight = document.getElementById('LC_secondary_menu').offsetHeight; |
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; |
var dccidheight = 0; |
if (document.getElementById('dccid') != null) { |
if (document.getElementById('dccid') != null) { |
dccidheight = document.getElementById('dccid').offsetHeight; |
dccidheight = document.getElementById('dccid').offsetHeight; |
Line 3508 function go(url) {
|
Line 3543 function go(url) {
|
currentURL = null; |
currentURL = null; |
currentSymb= null; |
currentSymb= null; |
var lcHostname = setLCHost(); |
var lcHostname = setLCHost(); |
window.location.href=lcHostname+url; |
if (lcHostname!='' && lcHostname!= null) { |
|
var RegExp = /^https?\:/; |
|
if (RegExp.test(url)) { |
|
window.location.href=url; |
|
} else { |
|
window.location.href=lcHostname+url; |
|
} |
|
} else { |
|
window.location.href=url; |
|
} |
} |
} |
} |
} |
|
|
Line 3548 sub jump_to_editres {
|
Line 3592 sub jump_to_editres {
|
} |
} |
} else { |
} else { |
unless ($cfile =~ m{^/priv/}) { |
unless ($cfile =~ m{^/priv/}) { |
if ($cfile =~ m{^(/adm/wrapper/ext/([^#]+))#([^#]+)$}) { |
if ($cfile =~ m{^(/adm/wrapper/ext/([^#]+))(?:|#([^#]+))$}) { |
$cfile = $1; |
$cfile = $1; |
my $extlink = $2; |
my $extlink = $2; |
$anchor = $3; |
$anchor = $3; |
$is_ext = 1; |
$is_ext = 1; |
if (($extlink !~ /^https:/) && ($ENV{'SERVER_PORT'} == 443)) { |
if (($extlink !~ /^https:/) && ($ENV{'SERVER_PORT'} == 443)) { |
$usehttp = 1; |
unless ((&Apache::lonnet::uses_sts()) || (&Apache::lonnet::waf_allssl($hostname))) { |
|
$usehttp = 1; |
|
} |
} elsif ($env{'request.use_absolute'}) { |
} elsif ($env{'request.use_absolute'}) { |
if ($env{'request.use_absolute'} =~ m{^https://}) { |
if ($env{'request.use_absolute'} =~ m{^https://}) { |
$usehttps = 1; |
$usehttps = 1; |
Line 3567 sub jump_to_editres {
|
Line 3613 sub jump_to_editres {
|
($env{'course.'.$env{'request.course.id'}.'.num'} eq $cnum) && |
($env{'course.'.$env{'request.course.id'}.'.num'} eq $cnum) && |
($env{'course.'.$env{'request.course.id'}.'.domain'} eq $cdom)) { |
($env{'course.'.$env{'request.course.id'}.'.domain'} eq $cdom)) { |
if ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://}) { |
if ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://}) { |
$usehttp = 1; |
unless ((&Apache::lonnet::uses_sts()) || (&Apache::lonnet::waf_allssl($hostname))) { |
|
$usehttp = 1; |
|
} |
} |
} |
} |
} |
} elsif ($env{'request.use_absolute'}) { |
} elsif ($env{'request.use_absolute'}) { |
Line 3607 sub jump_to_editres {
|
Line 3655 sub jump_to_editres {
|
if ($hostname ne '') { |
if ($hostname ne '') { |
$cfile = 'http://'.$hostname.(($cfile =~ /^\//)? '':'/').$cfile; |
$cfile = 'http://'.$hostname.(($cfile =~ /^\//)? '':'/').$cfile; |
} |
} |
unless ($is_ext) { |
$cfile .= (($cfile=~/\?/)?'&':'?').'usehttp=1'; |
$cfile .= (($cfile=~/\?/)?'&':'?').'usehttp=1'; |
|
} |
|
} elsif ($usehttps) { |
} elsif ($usehttps) { |
$cfile = $env{'request.use_absolute'}.(($cfile =~ /^\//)? '':'/').$cfile; |
$cfile = $env{'request.use_absolute'}.(($cfile =~ /^\//)? '':'/').$cfile; |
} |
} |