[Erp5-report] r20270 - /erp5/trunk/products/ERP5Form/FormulatorPatch.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Apr 2 14:32:23 CEST 2008


Author: bartek
Date: Wed Apr  2 14:32:19 2008
New Revision: 20270

URL: http://svn.erp5.org?rev=20270&view=rev
Log:
css file inclusion mechanism (same as for javascript files)

Modified:
    erp5/trunk/products/ERP5Form/FormulatorPatch.py

Modified: erp5/trunk/products/ERP5Form/FormulatorPatch.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Form/FormulatorPatch.py?rev=20270&r1=20269&r2=20270&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Form/FormulatorPatch.py (original)
+++ erp5/trunk/products/ERP5Form/FormulatorPatch.py Wed Apr  2 14:32:19 2008
@@ -495,6 +495,15 @@
   """
   pass
 Widget.render_css = Widget_render_css
+
+def Widget_get_css_list(self, field, REQUEST):
+  """
+    Return CSS needed by the widget - to be overwritten in field classes.
+    Should return a list of CSS file names.
+    These names will be appended to global css_list and included in a rendered page.
+  """
+  return []
+Widget.get_css_list = Widget_get_css_list
 
 def Widget_get_javascript_list(self, field, REQUEST):
   """
@@ -1456,16 +1465,26 @@
 
 def Field_render_css(self, REQUEST=None):
   """
-  Generate css content which will be added in the html header.
+  Generate css content which will be added inline.
 
   XXX key parameter may be needed.
   """
   return self.widget.render_css(self, REQUEST)
 Field.render_css = Field_render_css
 
+def Field_get_css_list(self, REQUEST=None):
+  """
+    Returns list of css sheets needed by the field
+    to be included in global css imports
+  """
+  return self.widget.get_css_list(self, REQUEST)
+Field.get_css_list = Field_get_css_list
+
+
 def Field_get_javascript_list(self, REQUEST=None):
   """
-  Returns list of javascript needed by the field
+    Returns list of javascript needed by the field
+    to be included in global js imports
   """
   return self.widget.get_javascript_list(self, REQUEST)
 Field.get_javascript_list = Field_get_javascript_list




More information about the Erp5-report mailing list