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

raeburn raeburn at source.lon-capa.org
Sat Dec 22 10:53:01 EST 2012


raeburn		Sat Dec 22 15:53:01 2012 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	loncommon.pm 
  Log:
  - For 2.11. 
    - Remote Control retained in 2.11 
    - Display CSTR button on Remote Control when content is published and
      editable by current user in course context.
    - Display "Functions" inline menu for other contente ditable by current
      user.
    - Horizontal rule (Remote Control enabled) to separate header from content 
      when no inline breadcrumbs or functions items included in current display.   
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1075.2.20 loncom/interface/loncommon.pm:1.1075.2.21
--- loncom/interface/loncommon.pm:1.1075.2.20	Sat Dec 22 15:43:03 2012
+++ loncom/interface/loncommon.pm	Sat Dec 22 15:53:00 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1075.2.20 2012/12/22 15:43:03 raeburn Exp $
+# $Id: loncommon.pm,v 1.1075.2.21 2012/12/22 15:53:00 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -5068,7 +5068,19 @@
 
     if ($env{'request.state'} eq 'construct') { $forcereg=1; }
 
-    unless ($env{'environment.remote'} eq 'on') {
+    my $funclist;
+    if (($env{'environment.remote'} eq 'on') && ($env{'request.state'} ne 'construct')) {
+        $bodytag .= Apache::lonhtmlcommon::scripttag(Apache::lonmenu::utilityfunctions(), 'start')."\n".
+                    Apache::lonmenu::serverform();
+        my $forbodytag;
+        &Apache::lonmenu::prepare_functions($env{'request.noversionuri'},
+                                            $forcereg,$args->{'group'},
+                                            $args->{'bread_crumbs'},
+                                            $advtoolsref,'',\$forbodytag);
+        unless (ref($args->{'bread_crumbs'}) eq 'ARRAY') {
+            $funclist = $forbodytag;
+        }
+    } else {
 
         #    if ($env{'request.state'} eq 'construct') {
         #        $titleinfo = &CSTR_pageheader(); #FIXME: Will be removed once all scripts have their own calls
@@ -5112,11 +5124,14 @@
             } elsif ($forcereg) { 
                 $bodytag .= &Apache::lonmenu::innerregister($forcereg);
             } else {
-                $bodytag .=
-                    &Apache::lonmenu::prepare_functions($env{'request.noversionuri'},
-                                                        $forcereg,$args->{'group'},
-                                                        $args->{'bread_crumbs'},
-                                                        $advtoolsref);
+                my $forbodytag;
+                &Apache::lonmenu::prepare_functions($env{'request.noversionuri'},
+                                                    $forcereg,$args->{'group'},
+                                                    $args->{'bread_crumbs'},
+                                                    $advtoolsref,'',\$forbodytag);
+                unless (ref($args->{'bread_crumbs'}) eq 'ARRAY') {
+                    $bodytag .= $forbodytag;
+                }
             }
         }else{
             # this is to seperate menu from content when there's no secondary
@@ -5152,7 +5167,6 @@
                        <li>$menu</li>
                        </ol><div id="LC_realm"> $realm $dc_info</div>|;
     }
-    my $funclist;
     if ($env{'request.state'} eq 'construct') {
         if (!$public){
             if ($env{'request.state'} eq 'construct') {
@@ -5164,17 +5178,7 @@
             }
         }
     }
-    return(<<ENDBODY);
-$bodytag
-<table id="LC_title_bar" class="LC_with_remote">
-<tr><td>$upperleft</td>
-    <td>$messages </td>
-</tr>
-<tr><td>$titleinfo $dc_info $menu</td>
-</tr>
-</table>
-$funclist
-ENDBODY
+    return $bodytag."\n".$funclist;
 }
 
 sub dc_courseid_toggle {
@@ -7491,6 +7495,8 @@
 		}else{
 			$result .= &Apache::lonhtmlcommon::breadcrumbs();
 		}
+    } elsif ($env{'request.noversionuri'} =~ m{^/res/}) {
+        $result .= '<div style="padding:0;margin:0;clear:both"><hr /></div>';
     }
     return $result;
 }




More information about the LON-CAPA-cvs mailing list