--- loncom/interface/lonhtmlcommon.pm	2006/03/21 18:39:02	1.122
+++ loncom/interface/lonhtmlcommon.pm	2006/05/12 16:45:41	1.128
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.122 2006/03/21 18:39:02 albertel Exp $
+# $Id: lonhtmlcommon.pm,v 1.128 2006/05/12 16:45:41 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -178,6 +178,7 @@ sub get_recent {
 sub textbox {
     my ($name,$value,$size,$special) = @_;
     $size = 40 if (! defined($size));
+    $value = &HTML::Entities::encode($value,'<>&"');
     my $Str = '<input type="text" name="'.$name.'" size="'.$size.'" '.
         'value="'.$value.'" '.$special.' />';
     return $Str;
@@ -524,7 +525,7 @@ sub get_date_from_form {
     if (($year<70) || ($year>137)) { return undef; }
     if (defined($sec) && defined($min)   && defined($hour) &&
         defined($day) && defined($month) && defined($year) &&
-        eval(&timelocal($sec,$min,$hour,$day,$month,$year))) {
+        eval('&timelocal($sec,$min,$hour,$day,$month,$year)')) {
         return &timelocal($sec,$min,$hour,$day,$month,$year);
     } else {
         return undef;
@@ -979,7 +980,14 @@ sub crumbs {
 # --------------------- A function that generates a window for the spellchecker
 
 sub spellheader {
-    my $html=&Apache::lonxml::xmlbegin();
+    my $start_page=
+	&Apache::loncommon::start_page('Speller Suggestions',undef,
+				       {'only_body' => 1,
+					'js_ready'  => 1,
+					'bgcolor'   => '#DDDDDD',});
+    my $end_page=
+	&Apache::loncommon::end_page({'js_ready'  => 1}); 
+
     my $nothing=&javascript_nothing();
     return (<<ENDCHECK);
 <script type="text/javascript"> 
@@ -988,7 +996,7 @@ var checkwin;
 
 function spellcheckerwindow() {
     checkwin=window.open($nothing,'spellcheckwin','height=320,width=280,resizable=yes,scrollbars=yes,location=no,menubar=no,toolbar=no');
-    checkwin.document.writeln('$html<head></head><body bgcolor="#DDDDDD"><form name="spellcheckform" action="/adm/spellcheck" method="post"><input type="hidden" name="text" value="" /></form></body></html>');
+    checkwin.document.writeln('$start_page<form name="spellcheckform" action="/adm/spellcheck" method="post"><input type="hidden" name="text" value="" /></form>$end_page');
     checkwin.document.close();
 }
 // END LON-CAPA Internal -->
@@ -1008,6 +1016,22 @@ ENDLINK
 
 # ------------------------------------------------- Output headers for HTMLArea
 
+{
+    my @htmlareafields;
+    sub init_htmlareafields {
+	undef(@htmlareafields);
+    }
+    
+    sub add_htmlareafields {
+	my (@newfields) = @_;
+	push(@htmlareafields,@newfields);
+    }
+
+    sub get_htmlareafields {
+	return @htmlareafields;
+    }
+}
+
 sub htmlareaheaders {
     if (&htmlareablocked()) { return ''; }
     unless (&htmlareabrowser()) { return ''; }
@@ -1142,20 +1166,9 @@ returns: nothing
     my @Crumbs;
     
     sub breadcrumbs {
-        my ($color,$component,$component_help,$function,$domain,$menulink,
-	    $helplink) = @_;
-        if (! defined($color)) {
-            if (! defined($function)) {
-                $function = &Apache::loncommon::get_users_function();
-            }
-            $color = &Apache::loncommon::designparm($function.'.tabbg',
-                                                    $domain);
-        }
+        my ($component,$component_help,$menulink,$helplink) = @_;
         #
-        my $Str = "\n".
-            '<table width="100%" border="0" cellpadding="0" cellspacing="0">'.
-            '<tr><td bgcolor="'.$color.'">'.
-            '<font size="-1">';
+        my $Str = "\n".'<table id="LC_breadcrumbs"><tr><td>';
         #
         # Make the faq and bug data cascade
         my $faq = '';
@@ -1210,17 +1223,19 @@ returns: nothing
 #            $icons .= &Apache::loncommon::help_open_bug($bug);
 #        }
 	if ($helplink ne 'nohelp') {
-	    $icons .= &Apache::loncommon::help_open_menu($color,$component,$component_help,$function,$faq,$bug);
+	    $icons .= &Apache::loncommon::help_open_menu(undef,$component,
+							 $component_help,
+							 undef,$faq,$bug);
 	}
         if ($icons ne '') {
             $Str .= $icons.'&nbsp;';
         }
         #
-        $Str .= $links.'</font></td>';
+        $Str .= $links.'</td>';
         #
         if (defined($component)) {
-            $Str .= '<td align="right" bgcolor="'.$color.'">'.
-                '<font size="+1">'.&mt($component).'</font></td>';
+            $Str .= '<td class="LC_breadcrumb_component">'.
+                &mt($component).'</td>';
         }
         $Str .= '</tr></table>'."\n";
         #