[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm lonmenu.pm lonmeta.pm lonmsg.pm

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 16 Mar 2006 22:12:20 -0000


albertel		Thu Mar 16 17:12:20 2006 EDT

  Modified files:              
    /loncom/interface	loncommon.pm lonmenu.pm lonmeta.pm lonmsg.pm 
  Log:
  - more start_paging, added the ddomain attribute to start_pagee
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.311 loncom/interface/loncommon.pm:1.312
--- loncom/interface/loncommon.pm:1.311	Thu Mar 16 16:54:40 2006
+++ loncom/interface/loncommon.pm	Thu Mar 16 17:12:17 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.311 2006/03/16 21:54:40 albertel Exp $
+# $Id: loncommon.pm,v 1.312 2006/03/16 22:12:17 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3036,9 +3036,11 @@
 Inputs: $title - optional title for the page
         $head_extra - optional extra HTML to incude inside the <head>
         %args - additional optional args supported are:
-                  only_body  -> is true will set &bodytag() onlybodytag arg on
-                  no_nav_bar -> is true will set &bodytag() notopbar arg on
+                  only_body   -> is true will set &bodytag() onlybodytag arg on
+                  no_nav_bar  -> is true will set &bodytag() notopbar arg on
                   add_entries -> additional attributes to add to the  <body>
+                  domain      -> force to color decorate a page for a 
+                                 specific domain
 
 =back
 
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.165 loncom/interface/lonmenu.pm:1.166
--- loncom/interface/lonmenu.pm:1.165	Tue Feb 21 15:14:49 2006
+++ loncom/interface/lonmenu.pm	Thu Mar 16 17:12:17 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.165 2006/02/21 20:14:49 raeburn Exp $
+# $Id: lonmenu.pm,v 1.166 2006/03/16 22:12:17 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1235,7 +1235,6 @@
 	$env{'browser.interface'} ne 'textual') {
 	$form=&serverform();
     }
-    my $bodytag=&Apache::loncommon::bodytag('Main Menu');
     my $function='student';
     if ($env{'request.role'}=~/^(cc|in|ta|ep)/) {
 	$function='coordinator';
@@ -1265,40 +1264,32 @@
 	$env{'browser.interface'}='faketextual';
 	$env{'environment.remote'}='off';
     }
-    my $html=&Apache::lonxml::xmlbegin();
-    $r->print(<<ENDHEADER);
-$html
-<head>
-<title>LON-CAPA Main Menu</title>
-$script_tag
-</head>
-$bodytag
-ENDHEADER
+    $r->print(&Apache::loncommon::start_page('Main Menu'));
     $r->print('<table>'.&inlinemenu().'</table>'.$form);
-    $r->print('</body></html>');
+    $r->print(&Apache::loncommon::end_page());
     return OK;
 }
 
 # ================================================================ Main Program
 
 BEGIN {
-  if (! defined($readdesk)) {
-   {
-    my $tabfile = $Apache::lonnet::perlvar{'lonTabDir'}.'/mydesk.tab';
-    if ( CORE::open( my $config,"<$tabfile") ) {
-        while (my $configline=<$config>) {
-            $configline=(split(/\#/,$configline))[0];
-            $configline=~s/^\s+//;
-            chomp($configline);
-            if ($configline) {
-                $desklines[$#desklines+1]=$configline;
-            }
-        }
-        CORE::close($config);
+    if (! defined($readdesk)) {
+	{
+	    my $tabfile = $Apache::lonnet::perlvar{'lonTabDir'}.'/mydesk.tab';
+	    if ( CORE::open( my $config,"<$tabfile") ) {
+		while (my $configline=<$config>) {
+		    $configline=(split(/\#/,$configline))[0];
+		    $configline=~s/^\s+//;
+		    chomp($configline);
+		    if ($configline) {
+			push(@desklines,$configline);
+		    }
+		}
+		CORE::close($config);
+	    }
+	}
+	$readdesk='done';
     }
-   }
-   $readdesk='done';
-  }
 }
 
 1;
Index: loncom/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.152 loncom/interface/lonmeta.pm:1.153
--- loncom/interface/lonmeta.pm:1.152	Thu Mar  2 15:57:15 2006
+++ loncom/interface/lonmeta.pm	Thu Mar 16 17:12:17 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Metadata display handler
 #
-# $Id: lonmeta.pm,v 1.152 2006/03/02 20:57:15 www Exp $
+# $Id: lonmeta.pm,v 1.153 2006/03/16 22:12:17 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -701,19 +701,17 @@
     #
     my ($resdomain,$resuser)=
         (&Apache::lonnet::declutter($uri)=~/^(\w+)\/(\w+)\//);
-    my $html=&Apache::lonxml::xmlbegin();
-    $r->print($html.'<head><title>'.
-              'Catalog Information'.
-              '</title></head>');
+
     if ($uri=~m:/adm/bombs/(.*)$:) {
-        $r->print(&Apache::loncommon::bodytag('Error Messages'));
+        $r->print(&Apache::loncommon::start_page('Error Messages'));
         # Looking for all bombs?
         &report_bombs($r,$uri);
     } elsif ($uri=~/\/portfolio\//) {
 	    ($resdomain,$resuser)=
 	    (&Apache::lonnet::declutter($uri)=~m|^(\w+)/(\w+)/portfolio|);
-        $r->print(&Apache::loncommon::bodytag
-          ('Edit Portfolio File Information','','','',$resdomain));
+        $r->print(&Apache::loncommon::start_page('Edit Portfolio File Catalog Information',
+						 undef,
+						 {'domain' => $resdomain,}));
         if ($env{'form.store'}) {
             &present_editable_metadata($r,$uri,'portfolio');
         } else {
@@ -721,15 +719,17 @@
         }
     } elsif ($uri=~/^\/\~/) { 
         # Construction space
-        $r->print(&Apache::loncommon::bodytag
-                  ('Edit Catalog Information','','','',$resdomain));
+        $r->print(&Apache::loncommon::start_page('Edit Catalog nformation',
+						 undef,
+						 {'domain' => $resdomain,}));
         &present_editable_metadata($r,$uri);
     } else {
-        $r->print(&Apache::loncommon::bodytag
-		  ('Catalog Information','','','',$resdomain));
+        $r->print(&Apache::loncommon::start_page('Catalog Information',
+						 undef,
+						 {'domain' => $resdomain,}));
         &present_uneditable_metadata($r,$uri);
     }
-    $r->print('</body></html>');
+    $r->print(&Apache::loncommon::end_page());
     return OK;
 }
 
Index: loncom/interface/lonmsg.pm
diff -u loncom/interface/lonmsg.pm:1.177 loncom/interface/lonmsg.pm:1.178
--- loncom/interface/lonmsg.pm:1.177	Thu Mar 16 16:39:26 2006
+++ loncom/interface/lonmsg.pm	Thu Mar 16 17:12:17 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging
 #
-# $Id: lonmsg.pm,v 1.177 2006/03/16 21:39:26 albertel Exp $
+# $Id: lonmsg.pm,v 1.178 2006/03/16 22:12:17 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1032,7 +1032,7 @@
             }
             $r->print("</td></tr>");
         }
-        $r->print('</table>'.&Apache::loncommon::endbodytag().'</html>');
+        $r->print('</table>'.&Apache::loncommon::end_page());
     } elsif ($numblocked == 0) {
         $r->print("<h3>".&mt('You have no unread messages')."</h3>");
     }
@@ -1621,14 +1621,13 @@
         $r->print($lt{'ncbc'}.'<br /><br />');
     }
     &display_addblocker_table($r,$parmcount,\%ltext);
-    my $endbody=&Apache::loncommon::endbodytag();
+    my $end_page=&Apache::loncommon::end_page();
     $r->print(<<"END");
 <br />
 <input type="hidden" name="blocktotal" value="$blockcount" />
 <input type ="submit" value="Save Changes" />
 </form>
-$endbody
-</html>
+$end_page
 END
     return;
 }