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

albertel lon-capa-cvs-allow@mail.lon-capa.org
Tue, 11 Sep 2007 23:36:47 -0000


albertel		Tue Sep 11 19:36:47 2007 EDT

  Modified files:              
    /loncom/homework	structuretags.pm 
    /loncom/interface	loncommon.pm 
  Log:
  - css .sty file <definetag> displays
  
  
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.395 loncom/homework/structuretags.pm:1.396
--- loncom/homework/structuretags.pm:1.395	Mon Sep 10 13:02:32 2007
+++ loncom/homework/structuretags.pm	Tue Sep 11 19:36:39 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.395 2007/09/10 17:02:32 albertel Exp $
+# $Id: structuretags.pm,v 1.396 2007/09/11 23:36:39 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1070,16 +1070,19 @@
 
     my $name = $token->[2]->{'name'};
     my $skip=&Apache::lonxml::get_all_text("/definetag",$parser,$style);
-    if ($name=~/^\//) {
-	$result=
- '<br /><table bgcolor="#FFBBBB"><tr><th>END <tt>'.$name.'</tt></th></tr>';
-    } else {
-	$result=
- '<br /><table bgcolor="#BBFFBB"><tr><th>BEGIN <tt>'.$name.'</tt></th></tr>';
+    if ($target eq 'web') {
+	if ($name=~/^\//) {
+	    $result=
+		'<br /><table class="LC_sty_end"><tr><th>'.
+		&mt('END [_1]'.'<tt>'.$name.'</tt>').'</th></tr>';
+	} else {
+	    $result=
+		'<br /><table class="LC_sty_begin"><tr><th>'.
+		&mt('BEGIN [_1]'.'<tt>'.$name.'</tt>').'</th></tr>';
+	}
+	$skip = &HTML::Entities::encode($skip, '<>&"');
+	$result.='<tr><td><pre>'.$skip.'</pre></td></tr></table>';
     }
-    $skip=~s/\</\&lt\;/gs;
-    $skip=~s/\>/\&gt\;/gs;
-    $result.='<tr><td><pre>'.$skip.'</pre></td></tr></table>';
     return $result;
 }
 
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.583 loncom/interface/loncommon.pm:1.584
--- loncom/interface/loncommon.pm:1.583	Tue Sep 11 16:40:23 2007
+++ loncom/interface/loncommon.pm	Tue Sep 11 19:36:46 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.583 2007/09/11 20:40:23 albertel Exp $
+# $Id: loncommon.pm,v 1.584 2007/09/11 23:36:46 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -4647,6 +4647,13 @@
   background: #DDDDDD;
 }
 
+table.LC_sty_begin {
+  background: #BBFFBB;
+}
+table.LC_sty_end {
+  background: #FFBBBB;
+}
+
 END
 }