[LON-CAPA-cvs] cvs: loncom /homework structuretags.pm /interface loncommon.pm lonmenu.pm

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 11 Nov 2004 23:45:36 -0000


albertel		Thu Nov 11 18:45:36 2004 EDT

  Modified files:              
    /loncom/homework	structuretags.pm 
    /loncom/interface	loncommon.pm lonmenu.pm 
  Log:
  
  - moving the header generation out of innerregister and into bodytag
  - making homework problems grab bodytag in cstr when there isn;'t a remote
  
  
  
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.271 loncom/homework/structuretags.pm:1.272
--- loncom/homework/structuretags.pm:1.271	Wed Nov 10 17:20:50 2004
+++ loncom/homework/structuretags.pm	Thu Nov 11 18:45:35 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.271 2004/11/10 22:20:50 albertel Exp $
+# $Id: structuretags.pm,v 1.272 2004/11/11 23:45:35 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -88,7 +88,10 @@
 	    &Apache::lonxml::fontsettings();     
     }
     my $body_tag_start;
-    if (!defined($found{'body'})) {
+    if (!defined($found{'body'}) && $ENV{'request.state'} eq 'construct'
+	&& $ENV{'environment.remote'} eq 'off') {
+	$body_tag_start=&Apache::loncommon::bodytag();
+    } elsif (!defined($found{'body'})) {
 	$body_tag_start='<body onload="'.&Apache::lonmenu::loadevents().'" '.
 	    'onunload="'.&Apache::lonmenu::unloadevents().'" ';
 	my $background=&Apache::lonxml::get_param('background',$parstack,
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.228 loncom/interface/loncommon.pm:1.229
--- loncom/interface/loncommon.pm:1.228	Tue Nov  9 14:51:43 2004
+++ loncom/interface/loncommon.pm	Thu Nov 11 18:45:36 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.228 2004/11/09 19:51:43 matthew Exp $
+# $Id: loncommon.pm,v 1.229 2004/11/11 23:45:36 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2592,10 +2592,27 @@
 </td>
 ENDROLE
         my $titleinfo = '<font face="Arial, Helvetica, sans-serif" size="+3" color="'.
-                        $font.'"><b>'.$title.'</b></font>';
+		$font.'"><b>'.$title.'</b></font>';
         if ($customtitle) {
             $titleinfo = $customtitle;
         } 
+	if ($ENV{'request.state'} eq 'construct') {
+	    my ($uname,$thisdisfn)=
+		($ENV{'request.filename'} =~ m|^/home/([^/]+)/public_html/(.*)|);
+	    my $formaction='/priv/'.$uname.'/'.$thisdisfn;
+	    $formaction=~s/\/+/\//g;
+	    $titleinfo = '<form name="dirs" method="post" action="'.$formaction
+		.'" target="_top">'
+		.&Apache::lonhtmlcommon::crumbs($uname.'/'.$thisdisfn,'_top','/priv','','-1')
+		.&Apache::lonhtmlcommon::select_recent('construct','recent','this.form.action=this.form.recent.value;this.form.submit()')
+		.'</form>'
+		.&Apache::lonmenu::constspaceform();
+
+	    &Apache::lonhtmlcommon::store_recent('construct',$formaction,$formaction);
+	    if ($thisdisfn!~m|/$|) {  $forcereg=1; }
+	}
+
+	&Apache::lonnet::logthis("hrrm");
         return $bodytag.&Apache::lonmenu::menubuttons($forcereg,'web',
                                                       $forcereg).
       '<table bgcolor="'.$pgbg.'" width="100%" border="0" cellspacing="3" cellpadding="3"><tr><td rowspan="3" bgcolor="'.$tabbg.'">'.$titleinfo.'</td>'.$roleinfo.'</tr></table>';
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.127 loncom/interface/lonmenu.pm:1.128
--- loncom/interface/lonmenu.pm:1.127	Thu Nov 11 17:47:55 2004
+++ loncom/interface/lonmenu.pm	Thu Nov 11 18:45:36 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.127 2004/11/11 22:47:55 albertel Exp $
+# $Id: lonmenu.pm,v 1.128 2004/11/11 23:45:36 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -227,12 +227,7 @@
     my $target = shift;
     my $result = '';
     my ($uname,$thisdisfn);
-    my $const_space = 0;
-    if ($ENV{'request.filename'} =~ /^\/home\/([^\/]+)\/public_html\/(.*)/) {
-        $const_space = 1;
-        $uname = $1;
-        $thisdisfn = $2;
-    }
+    my $const_space = ($ENV{'request.state'} eq 'construct');
 
     if ($ENV{'request.noversionuri'} eq '/res/adm/pages/menu.html') { return ''; }
 
@@ -252,38 +247,6 @@
     if ($noremote) {
 	$newmail='<font face="Arial,Helvetica,sans-serif"><table bgcolor="'.$pgbg.'" border="0" cellspacing="1" cellpadding="1" width="100%"><tr><td bgcolor="'.$tabbg.'">';
     }
-    if ($textual && $const_space) {
-        my $formaction='/priv/'.$uname.'/'.$thisdisfn;
-        $formaction=~s/\/+/\//g;
-        my $titleinfo = '<form name="dirs" method="post" action="'.$formaction
-              .'" target="_top">'.
-        &Apache::lonhtmlcommon::crumbs($uname.'/'.$thisdisfn,'_top','/priv','','-1').
-        &Apache::lonhtmlcommon::select_recent('construct','recent',
-                 'this.form.action=this.form.recent.value;this.form.submit()').
-              '</form>';
-        &Apache::lonhtmlcommon::store_recent('construct',$formaction,$formaction);
-        $newmail .= &constspaceform();
-# role and realm
-        my ($role,$realm) = &Apache::lonnet::plaintext((split(/\./,$ENV{'request.role'}))[0]);
-        unless ($realm) { $realm='&nbsp;'; }
-        $newmail .= <<END;
-<table width="100%" cellspacing="0" border="0" cellpadding="0">
-<tr>
-<td>
-$titleinfo
-</td>
-<td align="right">
-<font size="2" face="Arial, Helvetica, sans-serif">
-    $ENV{'environment.firstname'}
-    $ENV{'environment.middlename'}
-    $ENV{'environment.lastname'}
-    $ENV{'environment.generation'}
-    </font>&nbsp;<br />
-    <font size="2" face="Arial, Helvetica, sans-serif">$role</font>&nbsp;
-</td></tr>
-</table>
-END
-    }
     if (($textual) && ($ENV{'request.symb'}) && ($ENV{'request.course.id'})) {
 	my ($mapurl,$rid,$resurl)=&Apache::lonnet::decode_symb($ENV{'request.symb'});
         $newmail.=$ENV{'course.'.$ENV{'request.course.id'}.'.description'};
@@ -401,6 +364,8 @@
 # Prepare the rest of the buttons
         my $menuitems;
         if ($const_space) {
+	    my ($uname,$thisdisfn) =
+		($ENV{'request.filename'}=~m|^/home/([^/]+)/public_html/(.*)|);
             my $currdir = '/priv/'.$uname.'/'.$thisdisfn;
             $currdir =~ s#[^/]+$##;
             $menuitems=(<<ENDMENUITEMS);