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

kaisler kaisler@source.lon-capa.org
Thu, 26 Feb 2009 22:22:51 -0000


kaisler		Thu Feb 26 22:22:51 2009 EDT

  Modified files:              
    /loncom/interface	loncommon.pm 
  Log:
  Add a param to the start_page function to display die Breadcrumb helps
  
  Kalberlah & Kaisler
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.757 loncom/interface/loncommon.pm:1.758
--- loncom/interface/loncommon.pm:1.757	Wed Feb 25 21:06:27 2009
+++ loncom/interface/loncommon.pm	Thu Feb 26 22:22:51 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.757 2009/02/25 21:06:27 schulted Exp $
+# $Id: loncommon.pm,v 1.758 2009/02/26 22:22:51 kaisler Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -6247,16 +6247,23 @@
 		$result = &html_encode($result);
     }
 
-    if (exists($args->{'bread_crumbs'})) {
-        &Apache::lonhtmlcommon::clear_breadcrumbs();
-        if (ref($args->{'bread_crumbs'}) eq 'ARRAY') {         
-            foreach my $crumb (@{$args->{'bread_crumbs'}}){
-                &Apache::lonhtmlcommon::add_breadcrumb($crumb);
-            }
-        }
-        $result .= &Apache::lonhtmlcommon::breadcrumbs();
-    }
+	#Breadcrumbs
+    if (exists($args->{'bread_crumbs'}) or exists($args->{'bread_crumbs_component'})) {
+		&Apache::lonhtmlcommon::clear_breadcrumbs();
+		#if any br links exists, add them to the breadcrumbs
+		if (exists($args->{'bread_crumbs'}) and ref($args->{'bread_crumbs'}) eq 'ARRAY') {         
+			foreach my $crumb (@{$args->{'bread_crumbs'}}){
+				&Apache::lonhtmlcommon::add_breadcrumb($crumb);
+			}
+		}
 
+		#if bread_crumbs_component exists show it as headline else show only the breadcrumbs
+		if(exists($args->{'bread_crumbs_component'})){
+			$result .= &Apache::lonhtmlcommon::breadcrumbs($args->{'bread_crumbs_component'});
+		}else{
+			$result .= &Apache::lonhtmlcommon::breadcrumbs();
+		}
+    }
     return $result;
 }