--- loncom/interface/lonhtmlcommon.pm	2009/04/07 15:40:38	1.207
+++ loncom/interface/lonhtmlcommon.pm	2009/05/20 17:39:06	1.216
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.207 2009/04/07 15:40:38 amueller Exp $
+# $Id: lonhtmlcommon.pm,v 1.216 2009/05/20 17:39:06 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -62,6 +62,31 @@ use Apache::lonlocal;
 use Apache::lonnet;
 use LONCAPA;
 
+##############################################
+##############################################
+
+=pod
+
+=item confirm_success
+
+Successful completion of an operation message
+
+=cut
+
+sub confirm_success {
+   my ($message,$failure)=@_;
+   if ($failure) {
+      return '<span class="LC_error">'."\n"
+            .'<img src="/adm/lonIcons/navmap.wrong.gif" /> '."\n"
+            .$message."\n"
+            .'</span>'."\n";
+   } else {
+      return '<span class="LC_success">'."\n"
+            .'<img src="/adm/lonIcons/navmap.correct.gif" /> '."\n"
+            .$message."\n"
+            .'</span>'."\n";
+   }
+}
 
 ##############################################
 ##############################################
@@ -955,7 +980,7 @@ sub Create_PrgWin {
          popwin=open(\'\',\'popwin\',\'width=400,height=100\');".
         "popwin.document.writeln(\'".$start_page.
               "<h4>".&mt("$heading")."<\/h4>".
-              "<form action= \"\" name=\"popremain\" method=\"post\">".
+              "<form action=\"\" name=\"popremain\" method=\"post\">".
               '<input type="text" size="'.$width.'" name="remaining" value="'.
 	      &mt('Starting').'" /><\\/form>'.$end_page.
               "\');".
@@ -1305,13 +1330,13 @@ returns: nothing
     my @Crumbs;
     
     sub breadcrumbs {
-        my ($component,$component_help,$menulink,$helplink,$css_class,$no_mt, $no_realBreadcrumb) = @_;
+        my ($component,$component_help,$menulink,$helplink,$css_class,$no_mt, $CourseBreadcrumbs) = @_;
         #
-	$css_class ||= 'LC_breadcrumbs';
-        my $Str1 = '<ol id="LC_MenuBreadcrumbs">';
+        $css_class ||= 'LC_breadcrumbs';
+        my $Str1 = '<div id="LC_head_subbox"><ol id="LC_MenuBreadcrumbs">';
 	
-		if($no_realBreadcrumb){
-			$Str1 = '<ul class="LC_CourseBreadcrumbs">';
+		if($CourseBreadcrumbs){
+			$Str1 = '<ul id="LC_CourseBreadcrumbs">';
 		}
 
         my $Str = '';
@@ -1319,14 +1344,14 @@ returns: nothing
         # Make the faq and bug data cascade
         my $faq = '';
         my $bug = '';
-	my $help='';
-	# Crumb Symbol
-	my $crumbsymbol = '&raquo;&nbsp;';
+        my $help='';
+        # Crumb Symbol
+        my $crumbsymbol = '&raquo;&nbsp;';
         # The last breadcrumb does not have a link, so handle it separately.
         my $last = pop(@Crumbs);
         #
         # The first one should be the course or a menu link
-	if (!defined($menulink)) { $menulink=1; }
+        if (!defined($menulink)) { $menulink=1; }
         if ($menulink) {
             my $description = 'Menu';
             my $no_mt_descr = 0;
@@ -1336,13 +1361,18 @@ returns: nothing
                     $env{'course.'.$env{'request.course.id'}.'.description'};
                 $no_mt_descr = 1;
             }
-            unshift(@Crumbs,{
-                    href   =>'/adm/menu',
-                    title  =>'Go to main menu',
-                    target =>'_top',
-                    text   =>$description,
-                    no_mt  =>$no_mt_descr,
-                });
+            $menulink =  {  href   =>'/adm/menu',
+                            title  =>'Go to main menu',
+                            target =>'_top',
+                            text   =>$description,
+                            no_mt  =>$no_mt_descr, };
+            if($last) {
+                #$last set, so we have some crumbs
+                unshift(@Crumbs,$menulink);
+            } else {
+                #only menulink crumb present
+                $last = $menulink;
+            }
         }
         my $links .= '<li>'. 
             join('</li><li>'.$crumbsymbol,
@@ -1397,10 +1427,10 @@ returns: nothing
         #
 		
 
-		if($no_realBreadcrumb){
+		if($CourseBreadcrumbs){
         	$Str1 .= $links.'</ul>';
 		} else {
-        	$Str1 .= $links.'</ol>';		
+        	$Str1 .= $links.'</ol></div>';		
 		}
         #
         if (defined($component)) {
@@ -1523,9 +1553,9 @@ END
 }
 
 sub row_title {
+    my ($title,$css_title_class,$css_value_class) = @_;
     $row_count[0]++;
     my $css_class = ($row_count[0] % 2)?'LC_odd_row':'LC_even_row';
-    my ($title,$css_title_class,$css_value_class) = @_;
     $css_title_class ||= 'LC_pick_box_title';
     $css_title_class = 'class="'.$css_title_class.'"';
 
@@ -1784,7 +1814,7 @@ sub topic_bar {
     return '
 <div class="LC_topic_bar">
     <img alt="'.&mt('Step [_1]',$imgnum).
-              '"src="/res/adm/pages/bl_step'.$imgnum.'.gif" />&nbsp;
+              ' "src="/res/adm/pages/bl_step'.$imgnum.'.gif" />&nbsp;
     <span>'.$title.'</span>
 </div>
 ';