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

bisitz bisitz@source.lon-capa.org
Wed, 27 May 2009 14:36:11 -0000


bisitz		Wed May 27 14:36:11 2009 EDT

  Modified files:              
    /loncom/interface	lonmeta.pm 
  Log:
  Changes related to modification of LON-CAPA screen header.
  - Added new sub routine &pageheader() to centralize the page header creation
  - start_page calls:
      - Added breadcrumbs
      - Added head_subbox and included CSTR standard header
  
  
Index: loncom/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.233 loncom/interface/lonmeta.pm:1.234
--- loncom/interface/lonmeta.pm:1.233	Wed May 27 13:29:47 2009
+++ loncom/interface/lonmeta.pm	Wed May 27 14:36:11 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Metadata display handler
 #
-# $Id: lonmeta.pm,v 1.233 2009/05/27 13:29:47 bisitz Exp $
+# $Id: lonmeta.pm,v 1.234 2009/05/27 14:36:11 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -742,6 +742,13 @@
                       $relatedvalue); 
 }
 
+# Create pageheader
+sub pageheader {
+    return &Apache::lonhtmlcommon::breadcrumbs()
+          .&Apache::loncommon::head_subbox(
+               &Apache::loncommon::CSTR_pageheader());
+}
+
 # Main Handler
 sub handler {
     my $r=shift;
@@ -755,16 +762,34 @@
     return OK if $r->header_only;
     my ($resdomain,$resuser)=
         (&Apache::lonnet::declutter($uri)=~/^($match_domain)\/($match_username)\//);
+
+    # Breadcrumbs
+    &Apache::lonhtmlcommon::clear_breadcrumbs();
+    &Apache::lonhtmlcommon::add_breadcrumb({
+        'text'  => 'Construction Space',
+        'href'  => '', # FIXME Add link to /priv/[user]
+    });
+
     if ($uri=~m:/adm/bombs/(.*)$:) {
+        &Apache::lonhtmlcommon::add_breadcrumb({
+            'text'  => 'Error Messages',
+            'href'  => '',
+        });
         $r->print(&Apache::loncommon::start_page('Error Messages'));
+        $r->print(&pageheader());
         # Looking for all bombs?
         &report_bombs($r,$uri);
     } elsif ($uri=~m|^/editupload/[^/]+/[^/]+/portfolio/|) {
+        &Apache::lonhtmlcommon::add_breadcrumb({
+            'text'  => 'Edit Portfolio File Metadata',
+            'href'  => '',
+        });
 	    ($resdomain,$resuser)=
 		(&Apache::lonnet::declutter($uri)=~m|^($match_domain)/($match_name)/portfolio|);
         $r->print(&Apache::loncommon::start_page('Edit Portfolio File Metadata',
 						 undef,
 						 {'domain' => $resdomain,}));
+        $r->print(&pageheader());
         if ($env{'form.store'}) {
             &present_editable_metadata($r,$uri,'portfolio');
         } else {
@@ -781,22 +806,37 @@
             }
         }
     } elsif ($uri=~m|^/editupload/[^/]+/[^/]+/groups/|) {
+        &Apache::lonhtmlcommon::add_breadcrumb({
+            'text'  => 'Edit Group Portfolio File Metadata',
+            'href'  => '',
+        });
         $r->print(&Apache::loncommon::start_page('Edit Group Portfolio File Metadata',
 						 undef,
 						 {'domain' => $resdomain,}));
+        $r->print(&pageheader());
         &present_editable_metadata($r,$uri,'groups');    
     } elsif ($uri=~m|^/~|) { 
         # Construction space
+        &Apache::lonhtmlcommon::add_breadcrumb({
+            'text'  => 'Edit Metadata',
+            'href'  => '',
+        });
         $r->print(&Apache::loncommon::start_page('Edit Metadata',
 						"\n".'<script type="text/javascript">'."\n".
                                                 &Apache::loncommon::browser_and_searcher_javascript().
                                                 "\n".'</script>',
 						 {'domain' => $resdomain,}));
+        $r->print(&pageheader());
         &present_editable_metadata($r,$uri);
     } else {
+        &Apache::lonhtmlcommon::add_breadcrumb({
+            'text'  => 'Metadata',
+            'href'  => '',
+        });
         $r->print(&Apache::loncommon::start_page('Metadata',
 						 undef,
 						 {'domain' => $resdomain,}));
+        $r->print(&pageheader());
         &present_uneditable_metadata($r,$uri);
     }
     $r->print(&Apache::loncommon::end_page());