';
}
if ($symb) {
@@ -2618,7 +2660,7 @@ sub resource_info_box {
} else {
$return='
'.&mt('No context provided.').'
';
}
- if (($stuvcurrent ne '') || ($divforres)) {
+ if ($stuvcurrent ne '') {
$return .= '
';
}
return $return;
@@ -3349,18 +3391,12 @@ PARAMSONE
if (itemid != null) {
itemh = itemid.offsetHeight;
}
- var primaryheight = 0;
- if (document.getElementById('LC_nav_bar') != null) {
- primaryheight = document.getElementById('LC_nav_bar').offsetHeight;
- }
- var secondaryheight = 0;
+ var primaryheight = document.getElementById('LC_nav_bar').offsetHeight;
+ var secondaryheight;
if (document.getElementById('LC_secondary_menu') != null) {
secondaryheight = document.getElementById('LC_secondary_menu').offsetHeight;
}
- var crumbsheight = 0;
- if (document.getElementById('LC_breadcrumbs') != null) {
- crumbsheight = document.getElementById('LC_breadcrumbs').offsetHeight;
- }
+ var crumbsheight = document.getElementById('LC_breadcrumbs').offsetHeight;
var dccidheight = 0;
if (document.getElementById('dccid') != null) {
dccidheight = document.getElementById('dccid').offsetHeight;
@@ -3440,17 +3476,7 @@ function go(url) {
if (url!='' && url!= null) {
currentURL = null;
currentSymb= null;
- var lcHostname = setLCHost();
- 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;
- }
+ window.location.href=url;
}
}
@@ -3469,8 +3495,8 @@ ENDUTILITY
sub jump_to_editres {
my ($cfile,$home,$switchserver,$forceedit,$forcereg,$symb,$folderpath,
- $title,$hostname,$idx,$suppurl,$todocs,$suppanchor) = @_;
- my ($jscall,$anchor,$usehttp,$usehttps,$is_ext);
+ $title,$idx,$suppurl,$todocs,$suppanchor) = @_;
+ my ($jscall,$anchor);
if ($switchserver) {
if ($home) {
$cfile = '/adm/switchserver?otherserver='.$home.'&role='.
@@ -3490,37 +3516,9 @@ sub jump_to_editres {
}
} 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)) {
- 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;
- }
- }
- } elsif ($cfile =~ m{^/?public/($match_domain)/($match_courseid)/syllabus}) {
- if ($ENV{'SERVER_PORT'} == 443) {
- my ($cdom,$cnum) = ($1,$2);
- if (($env{'request.course.id'}) &&
- ($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://}) {
- 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;
- }
- }
+ $anchor = $2;
}
if ($symb) {
if ($anchor ne '') {
@@ -3546,16 +3544,6 @@ sub jump_to_editres {
}
if ($forceedit) {
$cfile .= (($cfile=~/\?/)?'&':'?').'forceedit=1';
- if ($usehttps) {
- $cfile = $env{'request.use_absolute'}.(($cfile =~ /^\//)? '':'/').$cfile;
- }
- } elsif ($usehttp) {
- if ($hostname ne '') {
- $cfile = 'http://'.$hostname.(($cfile =~ /^\//)? '':'/').$cfile;
- }
- $cfile .= (($cfile=~/\?/)?'&':'?').'usehttp=1';
- } elsif ($usehttps) {
- $cfile = $env{'request.use_absolute'}.(($cfile =~ /^\//)? '':'/').$cfile;
}
if ($forcereg) {
$cfile .= (($cfile=~/\?/)?'&':'?').'register=1';
@@ -3582,18 +3570,15 @@ sub jump_to_editres {
# javascript_valid_email
#
# Generates javascript to validate an e-mail address.
-# Returns a javascript function which accepts a form field as argument, and
+# Returns a javascript function which accetps a form field as argumnent, 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,suffix) {
+function validmail(field) {
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})(\\]?)$"; //"
@@ -3703,7 +3688,9 @@ sub scripttag {
Constructs a XHTML list from \@array.
-input:
+=over
+
+=item input:
=over
@@ -3717,7 +3704,9 @@ Attributes for