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

albertel lon-capa-cvs-allow@mail.lon-capa.org
Tue, 05 Jun 2007 22:37:59 -0000


albertel		Tue Jun  5 18:37:59 2007 EDT

  Modified files:              
    /loncom/publisher	packages.tab 
    /loncom/homework	structuretags.pm 
    /loncom/xml	londefdef.pm 
  Log:
  - enable cssfile for html pages
  
  
Index: loncom/publisher/packages.tab
diff -u loncom/publisher/packages.tab:1.49 loncom/publisher/packages.tab:1.50
--- loncom/publisher/packages.tab:1.49	Wed Feb 15 21:03:22 2006
+++ loncom/publisher/packages.tab	Tue Jun  5 18:37:50 2007
@@ -113,6 +113,11 @@
 extension_page&encrypturl&display:Do not show plain URL
 #extension_page&encrypturl&hidden:parm
 
+import_defaults&extension_html:1
+extension_html&cssfile&display:CSS file to link
+extension_html&cssfile&type:string
+
+
 #default parameters for anything that doesn't have any more specific
 #pacakge defintions
 
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.378 loncom/homework/structuretags.pm:1.379
--- loncom/homework/structuretags.pm:1.378	Mon May 28 18:51:29 2007
+++ loncom/homework/structuretags.pm	Tue Jun  5 18:37:56 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.378 2007/05/28 22:51:29 albertel Exp $
+# $Id: structuretags.pm,v 1.379 2007/06/05 22:37:56 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -103,12 +103,8 @@
 	
 	$extra_head .= &Apache::lonhtmlcommon::spellheader();
 
-	my $css_href = &Apache::lonnet::EXT('resource.0.cssfile');
-	if ($css_href =~ /\S/) {
-	    &Apache::lonxml::extlink($css_href);
-	    $extra_head .= 
-		'<link rel="stylesheet" type="text/css" href="'.$css_href.'" />';
-	}
+	$extra_head .= &Apache::londefdef::generate_css_links();
+
 	if ($target eq 'edit') {
 	    $extra_head.=&Apache::edit::js_change_detection().
 		"<script type=\"text/javascript\">\n".
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.365 loncom/xml/londefdef.pm:1.366
--- loncom/xml/londefdef.pm:1.365	Thu May 10 05:50:10 2007
+++ loncom/xml/londefdef.pm	Tue Jun  5 18:37:58 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.365 2007/05/10 09:50:10 foxr Exp $
+# $Id: londefdef.pm,v 1.366 2007/06/05 22:37:58 albertel Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -516,6 +516,17 @@
     return $currentstring;
 }
 
+sub generate_css_links {
+    my $links;
+    my $css_href = &Apache::lonnet::EXT('resource.0.cssfile');
+    if ($css_href =~ /\S/) {
+	&Apache::lonxml::extlink($css_href);
+	$links .= 
+	    '<link rel="stylesheet" type="text/css" href="'.$css_href.'" />';
+    }
+    return $links;
+}
+
 #-- <body> tag (end tag required)
 sub start_body {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
@@ -530,9 +541,13 @@
 	if (&is_inside_of($tagstack, "head")) {
 	    &end_head(@_);
 	}
+	
+	my $extra_head = &generate_css_links();
+
 	$currentstring = 
 	    &Apache::loncommon::start_page($Apache::londefdef::title,
-					   $Apache::londefdef::head,
+					   $Apache::londefdef::head
+					      .$extra_head,
 					   {'add_entries'    => $token->[2],
 					    'no_title'       => 1,
 					    'force_register' => 1});