[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface loncommon.pm

raeburn raeburn at source.lon-capa.org
Sun Dec 29 20:57:05 EST 2013


raeburn		Mon Dec 30 01:57:05 2013 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	loncommon.pm 
  Log:
  - For 2.11
    - Backport 1.1168, 1.1169.
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1075.2.60 loncom/interface/loncommon.pm:1.1075.2.61
--- loncom/interface/loncommon.pm:1.1075.2.60	Mon Dec 30 01:31:55 2013
+++ loncom/interface/loncommon.pm	Mon Dec 30 01:57:04 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1075.2.60 2013/12/30 01:31:55 raeburn Exp $
+# $Id: loncommon.pm,v 1.1075.2.61 2013/12/30 01:57:04 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1356,16 +1356,21 @@
     unless ($env{'environment.remote'} eq 'on') {
         $stay_on_page = 1;
     }
-    my $link = ($stay_on_page) ? "javascript:helpMenu('display')"
-	                     : "javascript:helpMenu('open')";
-    my $banner_link = &update_help_link(undef,undef,undef,undef,$stay_on_page);
-
+    my ($link,$banner_link);
+    unless ($env{'request.noversionuri'} =~ m{^/adm/helpmenu}) {
+        $link = ($stay_on_page) ? "javascript:helpMenu('display')"
+	                         : "javascript:helpMenu('open')";
+        $banner_link = &update_help_link(undef,undef,undef,undef,$stay_on_page);
+    }
     my $title = &mt('Get help');
-
-    return <<"END";
+    if ($link) {
+        return <<"END";
 $banner_link
 <a href="$link" title="$title">$text</a>
 END
+    } else {
+        return ' '.$text.' ';
+    }
 }
 
 sub help_menu_js {
@@ -1412,9 +1417,10 @@
     return;
 }
 function writeHelp(caller) {
-    caller.document.writeln('$start_page\\n<frame name="bannerframe" src="'+banner_link+'" />\\n<frame name="bodyframe" src="$details_link" />\\n$end_page')
-    caller.document.close()
-    caller.focus()
+    caller.document.writeln('$start_page\\n<frame name="bannerframe" src="'+banner_link+'" marginwidth="0" marginheight="0" frameborder="0">\\n');
+    caller.document.writeln('<frame name="bodyframe" src="$details_link" marginwidth="0" marginheight="0" frameborder="0">\\n$end_page');
+    caller.document.close();
+    caller.focus();
 }
 // END LON-CAPA Internal -->
 // ]]>
@@ -5157,6 +5163,10 @@
         }
         $bodytag .= qq|<div id="LC_realm">$realm $dc_info</div>|;
 
+        #if directed to not display the secondary menu, don't.
+        if ($args->{'no_secondary_menu'}) {
+            return $bodytag;
+        }
         #don't show menus for public users
         if (!$public){
             $bodytag .= Apache::lonmenu::secondary_menu($httphost);
@@ -7324,7 +7334,11 @@
     }
     if (!$args->{'no_auto_mt_title'}) { $title = &mt($title); }
     $result .= '<title> LON-CAPA '.$title.'</title>'
-	.'<link rel="stylesheet" type="text/css" href="'.$url.'" />'
+	.'<link rel="stylesheet" type="text/css" href="'.$url.'"';
+    if (!$args->{'frameset'}) {
+        $result .= ' /';
+    }
+    $result .= '>'
         .$inhibitprint
 	.$head_extra;
     if ($env{'browser.mobile'}) {
@@ -7351,7 +7365,11 @@
     if ((!$env{'browser.mathml'} && $env{'browser.unicode'}) ||
         ((ref($args) eq 'HASH') && ($args->{'browser.unicode'}))) {
 	$headerstring.=
-	    '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'."\n";
+	    '<meta http-equiv="Content-Type" content="text/html; charset=utf-8"';
+        if (!$args->{'frameset'}) {
+            $headerstring.= ' /';
+        }
+        $headerstring .= '>'."\n";
     }
     return $headerstring;
 }
@@ -7443,6 +7461,7 @@
 =cut
 
 sub xml_begin {
+    my ($is_frameset) = @_;
     my $output='';
 
     if ($env{'browser.mathml'}) {
@@ -7454,9 +7473,12 @@
 	    .'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">'
             .'<html xmlns:math="http://www.w3.org/1998/Math/MathML" ' 
 	    .'xmlns="http://www.w3.org/1999/xhtml">';
+    } elsif ($is_frameset) {
+        $output='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">'."\n".
+                '<html>'."\n";
     } else {
-	$output='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n"
-           .'<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">'."\n";
+	$output='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n".
+                '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">'."\n";
     }
     return $output;
 }
@@ -7525,7 +7547,7 @@
     my ($result, at advtools);
 
     if (! exists($args->{'skip_phases'}{'head'}) ) {
-        $result .= &xml_begin() . &headtag($title, $head_extra, $args);
+        $result .= &xml_begin($args->{'frameset') . &headtag($title, $head_extra, $args);
     }
     
     if (! exists($args->{'skip_phases'}{'body'}) ) {
@@ -8910,7 +8932,7 @@
 Same, if upload of a file directly to a course/community via Course Editor
 will cause quota for uploaded content for the course to be exceeded.
 
-Inputs: 6
+Inputs: 7 
 1. username or coursenum
 2. domain
 3. context ('author' or 'course')




More information about the LON-CAPA-cvs mailing list