-
+ |
$title
-
+ |
ENDONE
return $output;
@@ -2630,9 +2777,9 @@ sub course_custom_roles {
sub resource_info_box {
- my ($symb,$onlyfolderflag,$stuvcurrent,$stuvdisp)=@_;
+ my ($symb,$onlyfolderflag,$stuvcurrent,$stuvdisp,$divforres)=@_;
my $return='';
- if ($stuvcurrent ne '') {
+ if (($stuvcurrent ne '') || ($divforres)) {
$return = '';
}
if ($symb) {
@@ -2661,7 +2808,7 @@ sub resource_info_box {
} else {
$return=' '.&mt('No context provided.').' ';
}
- if ($stuvcurrent ne '') {
+ if (($stuvcurrent ne '') || ($divforres)) {
$return .= ' ';
}
return $return;
@@ -3392,12 +3539,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;
@@ -3470,7 +3623,10 @@ THIRD
sub javascript_jumpto_resource {
my $confirm_switch = &mt("Editing requires switching to the resource's home server.")."\n".
&mt('Switch server?');
+ my $confirm_new_tab = &mt("Editing requires using the resource's home server.")."\n".
+ &mt('Open a new browser tab?');
&js_escape(\$confirm_switch);
+ &js_escape(\$confirm_new_tab);
return (<&');
- if ($symb) {
- $cfile .= '&symb='.&HTML::Entities::encode($symb,'"<>&');
+ if ($shownsymb) {
+ $cfile .= '&symb='.&HTML::Entities::encode($shownsymb,'"<>&');
+ if ($resedit) {
+ $cfile .= '&edit=1';
+ }
} elsif ($folderpath) {
$cfile .= '&folderpath='.&HTML::Entities::encode($folderpath,'"<>&');
}
@@ -3514,17 +3703,19 @@ sub jump_to_editres {
if ($forcereg) {
$cfile .= '®ister=1';
}
- $jscall = "need_switchserver('".&Apache::loncommon::escape_single($cfile)."');";
+ $jscall = "need_switchserver('".&Apache::loncommon::escape_single($cfile)."','$target')";
}
} else {
unless ($cfile =~ m{^/priv/}) {
- if ($cfile =~ m{^(/adm/wrapper/ext/([^#]+))#([^#]+)$}) {
+ if ($cfile =~ m{^(/adm/wrapper/ext/([^#]+))(?:|#([^#]+))$}) {
$cfile = $1;
my $extlink = $2;
$anchor = $3;
$is_ext = 1;
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'}) {
if ($env{'request.use_absolute'} =~ m{^https://}) {
$usehttps = 1;
@@ -3537,7 +3728,9 @@ sub jump_to_editres {
($env{'course.'.$env{'request.course.id'}.'.num'} eq $cnum) &&
($env{'course.'.$env{'request.course.id'}.'.domain'} eq $cdom)) {
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'}) {
@@ -3577,9 +3770,7 @@ sub jump_to_editres {
if ($hostname ne '') {
$cfile = 'http://'.$hostname.(($cfile =~ /^\//)? '':'/').$cfile;
}
- unless ($is_ext) {
- $cfile .= (($cfile=~/\?/)?'&':'?').'usehttp=1';
- }
+ $cfile .= (($cfile=~/\?/)?'&':'?').'usehttp=1';
} elsif ($usehttps) {
$cfile = $env{'request.use_absolute'}.(($cfile =~ /^\//)? '':'/').$cfile;
}
@@ -3608,15 +3799,18 @@ sub jump_to_editres {
# javascript_valid_email
#
# Generates javascript to validate an e-mail address.
-# Returns a javascript function which accetps a form field as argumnent, and
+# Returns a javascript function which accepts a form field as argument, and
# returns false if field.value does not satisfy two regular expression matches
# for a valid e-mail address. Backwards compatible with old browsers without
# support for javascript RegExp (just checks for @ in field.value in this case).
sub javascript_valid_email {
my $scripttag .= <<'END';
-function validmail(field) {
+function validmail(field,suffix) {
var str = field.value;
+ if (suffix != '' && suffix != undefined) {
+ str += suffix;
+ }
if (window.RegExp) {
var reg1str = "(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)";
var reg2str = "^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$"; //"
@@ -3792,7 +3986,7 @@ sub list_from_array {
sub generate_menu {
my @menu = @_;
# subs for specific html elements
- my ($h3, $div, $ul, $li, $a, $img) = inittags( qw(h3 div ul li a img) );
+ my ($h2, $div, $ul, $li, $a, $img) = inittags( qw(h2 div ul li a img) );
my @categories; # each element represents the entire markup for a category
@@ -3815,30 +4009,25 @@ sub generate_menu {
src => $src,
alt => mt(defined($$link{alttext}) ?
$$link{alttext} : $$link{linktext})
- }), {
- href => $$link{url},
- title => mt($$link{linktitle}),
- class => 'LC_menubuttons_link'
- }).
- $a->(mt($$link{linktext}), {
+ }).mt($$link{linktext}), {
href => $$link{url},
title => mt($$link{linktitle}),
class => "LC_menubuttons_link"
}).
- (defined($$link{help}) ?
+ (defined($$link{help}) ?
Apache::loncommon::help_open_topic($$link{help}) : ''),
{class => "LC_menubuttons_inline_text"}));
}
- # wrap categorytitle in , concatenate with
+ # wrap categorytitle in , concatenate with
# joined and in tags wrapped @links
# and wrap everything in an enclosing and push it into
# @categories
# such that each element looks like:
- #
+ #
# the category won't be added if there aren't any links
push(@categories,
- $div->($h3->(mt($$category{categorytitle}), {class=>"LC_hcell"}).
+ $div->($h2->(mt($$category{categorytitle}), {class=>'LC_hcell LC_heading_2'}).
$ul->(join('' ,@links), {class =>"LC_ListStyleNormal" }),
{class=>"LC_Box LC_400Box"})) if scalar(@links);
}
|