--- loncom/xml/londefdef.pm	2010/08/20 21:20:24	1.403.4.2
+++ loncom/xml/londefdef.pm	2010/05/04 19:40:47	1.416
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.403.4.2 2010/08/20 21:20:24 raeburn Exp $
+# $Id: londefdef.pm,v 1.416 2010/05/04 19:40:47 faziophi Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -538,22 +538,51 @@ sub start_body {
 	
 	my $extra_head = &generate_css_links();
 
+    # Breadcrumbs
+    &Apache::lonhtmlcommon::clear_breadcrumbs();
+    if ($env{'request.state'} eq 'construct') {
+        &Apache::lonhtmlcommon::add_breadcrumb({
+            'text'  => 'Construction Space',
+            'href'  => &Apache::loncommon::authorspace(),
+        });
+        &Apache::lonhtmlcommon::add_breadcrumb({
+            'text'  => 'HTML Editor',
+            'href'  => '',
+        });
+        # breadcrumbs (and tools) will be created 
+        # in start_page->bodytag->innerregister
+    } else {
+        # FIXME Where are we?
+    }
+
 	$currentstring = 
 	    &Apache::loncommon::start_page($Apache::londefdef::title,
 					   $Apache::londefdef::head
 					      .$extra_head,
 					   {'add_entries'    => $token->[2],
-					    'no_title'       => 1,
+#					    'no_title'       => 1,
 					    'force_register' => 1});
 
-	if ($env{'request.state'} ne 'published') {
-	    $currentstring.=&Apache::lonmenu::constspaceform();
-	    $currentstring.=&Apache::londefdef::edit_controls();
-	}
-	$currentstring.=&Apache::lonxml::message_location();
+        my $header = '';
+        if ($env{'request.state'} ne 'published' &&
+            $env{'request.state'} ne 'construct') {
+            $header=&Apache::lonmenu::constspaceform();
+        }
+        if ($env{'request.state'} ne 'published') {
+            $header.=&Apache::londefdef::edit_controls();
+        }
+        if ($env{'request.state'} eq 'construct') {
+            $currentstring.=&Apache::loncommon::head_subbox(
+                                &Apache::loncommon::CSTR_pageheader()
+                               .$header);
+        } elsif ($env{'request.state'} eq 'edit') {
+            $currentstring.=&Apache::loncommon::head_subbox($header);
+        }
+        $currentstring.=&Apache::lonxml::message_location();
     } elsif ($target eq 'tex') {
-	$currentstring = '';   #  '\begin{document}' is in header.
-    } 
+        $currentstring = '';   #  '\begin{document}' is in header.
+    }
+
     return $currentstring;
 }
 
@@ -570,9 +599,14 @@ sub edit_controls {
 </div>';
     }
     $result .= '
-<div class="LC_edit_problem_header_edit_row"><input type="submit" name="editmode" accesskey="e" value="'.&mt('Edit').'" /></div></div>
+<div><input type="submit" name="editmode" accesskey="e" value="'.&mt('Edit').'" />';
+    if (($env{'request.course.id'}) && ($env{'form.forceedit'})) {
+        $result .= ('&nbsp;' x 3).'<input type="button" value="'.&mt('Course View').'" onclick="javascript:location.href=currentURL" />';
+    }
+    $result .= '</div>
+</div>
 </form>
-<br />';
+';
     return $result;
 }
 
@@ -1349,10 +1383,6 @@ sub start_font {
     my $currentstring = '';
     if ($target eq 'web' || $target eq 'webgrade') {
 	my $face=&Apache::lonxml::get_param('face',$parstack,$safeeval);
-	if ($face!~/symbol/i) {
-	    if (($env{'browser.fontenhance'} eq 'on') || 
-		($env{'browser.blackwhite'} eq 'on')) { return ''; }
-	}
 	$currentstring = $token->[4];     
     }  elsif ($target eq 'tex') {
 	my $fontsize=&Apache::lonxml::get_param('TeXsize',$parstack,$safeeval);
@@ -2018,39 +2048,29 @@ sub start_table {
 	my $width  = &Apache::lonxml::get_param('TeXwidth', $parstack, $safeeval, undef, 0);
 	my $theme  = &Apache::lonxml::get_param('TeXtheme', $parstack, $safeeval, undef, 0);
 	my $align  = &Apache::lonxml::get_param('align', $parstack, $safeeval, undef, 0);
-        my $cell_border = &Apache::lonxml::get_param('rules', $parstack, $safeeval, undef, 0);
 
 	# The only thing that needs any figuring out is the width.. and then only if it is
 	# a percent. If not it's assumed to be some valid TeX measurement unit e.g. 3.0cm
 	#
 
 	my $table = new Apache::lontable();
-        if ((defined $border) && ($border > 0)) {
-        #    &Apache::lonnet::logthis("Turning on table borders: $border");
-            $table->table_border(1);
-            if ($cell_border ne 'none') {
-                $table->cell_border(1); # html specs that border turns on both...unless rules='none'.
-            }
-        }
-        # Only all or nothing for cell borders for now:
-
-        if ((defined $cell_border) && ($cell_border ne 'none')) {
-        #    &Apache::lonnet::logthis("Turning on cell borders: $cell_border");
-            $table->cell_border(1);
-        }
-	if (defined $theme) {
+	if ($border ne '') {
+	    $table->table_border(1);
+	    $table->cell_border(1);
+	}
+	if ($theme ne '') {
 	    $table->theme($theme);
 	}
-	if (defined $align) {
+	if ($align ne '') {
 	    $table->alignment($align);
 	}
 
 	# Missing width is most of page width
 
-	if (!(defined $width)) {
+	if ($width eq "") {
 	    $width = '70%';
 	}
-
+	
 	# If a percentage, need to calculate what this means in terms of
 	# page width:
 	
@@ -3255,28 +3275,21 @@ sub start_img {
 						   ['','bottom','middle','top','left','right'],$token,5);
 	$currentstring .=&Apache::edit::select_arg('TeXwrap:', 'TeXwrap',
 						   ['', 'none','parbox', 'parpic', 'wrapfigure'], $token, 2);
-        my $alt=    &Apache::lonxml::get_param('alt',$parstack,$safeeval);
-        my $enc=    &Apache::lonxml::get_param('encrypturl',$parstack,$safeeval);
-
 	$currentstring .=&Apache::edit::select_arg('Encrypt URL:','encrypturl',
 						   ['no','yes'], $token, 2);
-        if (($alt=~/\S/) && (lc($enc) eq 'yes')) {
-           $currentstring.='<br /><span class="LC_warning">'.&mt('Warning: the description "[_1]" will be available, even for encrypted URL',$alt).'</span><br />';
-        }
 	$currentstring .=&Apache::edit::end_row().&Apache::edit::start_spanning_row();
 	my $src=    &Apache::lonxml::get_param('src',$parstack,$safeeval);
+	my $alt=    &Apache::lonxml::get_param('alt',$parstack,$safeeval);
 	my $width=  &Apache::lonxml::get_param('width',$parstack,$safeeval);
 	my $height= &Apache::lonxml::get_param('height',$parstack,$safeeval);
 
         if ($token->[2]{'src'}=~/\$/) {
-           $currentstring.=&mt('Variable image source');
-        } elsif ($token->[2]{'src'}=~/\S/) {
+           $currentstring.='Variable image source';
+        } else {
 	   $currentstring .= '<img src="'.$src.'" alt="'.$alt.'" ';
 	   if ($width) { $currentstring.=' width="'.$width.'" '; }
 	   if ($height) { $currentstring.=' height="'.$height.'" '; }
 	   $currentstring .= ' />';
-        } else {
-           $currentstring.=&mt("No image source specified");
         }
     } elsif ($target eq 'modified') {
 	my ($osrc,$owidth,$oheight)=
@@ -3525,7 +3538,7 @@ sub start_frameset {
 	    &Apache::loncommon::start_page($Apache::londefdef::title,
 					   $Apache::londefdef::head,
 					   {'add_entries'    => $token->[2],
-					    'no_title'       => 1,
+#					    'no_title'       => 1,
 					    'force_register' => 1,
 					    'frameset'       => 1,});
 
@@ -3884,12 +3897,16 @@ sub end_colgroup {
     return $currentstring;
 }
 
+
 #-- <del> tag (end tag required)
 sub start_del {
     my ($target,$token) = @_;
     my $currentstring = '';
     if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
+    } elsif ($target eq 'tex') {
+	&disable_para();
+	$currentstring .= '\st{';  
     } 
     return $currentstring;
 }
@@ -3898,7 +3915,10 @@ sub end_del {
     my ($target,$token) = @_;
     my $currentstring = '';
     if ($target eq 'web' || $target eq 'webgrade') {
-	$currentstring = $token->[2];    
+	$currentstring = $token->[2];     
+    } elsif ($target eq 'tex') {
+	&enable_para();
+	$currentstring = '}';
     } 
     return $currentstring;
 }
@@ -4834,6 +4854,7 @@ sub latex_header {
 	"\\usepackage{xcolor}\n".
 	'\usepackage{calc}'.
 	'\usepackage{amsmath}'.
+    '\usepackage{soul}',
 	'\usepackage{amssymb}'.
 	'\usepackage{amsfonts}'.
 	'\usepackage{amsthm}'.