[LON-CAPA-cvs] cvs: loncom /homework structuretags.pm /publisher packages.tab

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 16 Feb 2006 01:58:54 -0000


albertel		Wed Feb 15 20:58:54 2006 EDT

  Modified files:              
    /loncom/publisher	packages.tab 
    /loncom/homework	structuretags.pm 
  Log:
  - add the ability to set a PARm of a css file to use by default on problems and tasks
  
  
  
Index: loncom/publisher/packages.tab
diff -u loncom/publisher/packages.tab:1.47 loncom/publisher/packages.tab:1.48
--- loncom/publisher/packages.tab:1.47	Mon Dec 19 23:06:11 2005
+++ loncom/publisher/packages.tab	Wed Feb 15 20:58:51 2006
@@ -53,6 +53,8 @@
 part_0&discusshide&display:Hide Closed Discussion
 part_0&discusshide&type:string_yesno
 part_0&discusshide&default:no
+part_0&cssstyle&display:CSS style sheet to link
+part_0&cssstyle&type:string
 numericalhint&tol&display:Numerical Tolerance
 numericalhint&tol&type:tolerance
 numericalhint&tol&default:5%
@@ -173,5 +175,6 @@
 Task_0&available&type:string
 Task_0&availablestudent&display:Slots of availability selected by student
 Task_0&availablestudent&type:string
-
+Task_0&cssstyle&display:CSS style sheet to link
+Task_0&cssstyle&type:string
 
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.334 loncom/homework/structuretags.pm:1.335
--- loncom/homework/structuretags.pm:1.334	Fri Feb 10 19:03:07 2006
+++ loncom/homework/structuretags.pm	Wed Feb 15 20:58:54 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.334 2006/02/11 00:03:07 albertel Exp $
+# $Id: structuretags.pm,v 1.335 2006/02/16 01:58:54 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -113,6 +113,12 @@
 	    &Apache::lonhtmlcommon::htmlareaheaders().
 	    &Apache::lonhtmlcommon::spellheader().
 	    &Apache::lonxml::fontsettings();     
+	my $css_href = &Apache::lonnet::EXT('resource.0.cssstyle');
+	if ($css_href =~ /\S/) {
+	    &Apache::lonxml::extlink($css_href);
+	    $head_tag_start = 
+		'<link rel="stylesheet" type="text/css" href="'.$css_href.'" />';
+	}
 	if ($target eq 'edit') {
 	    $head_tag_start.=&Apache::edit::js_change_detection();
 	}