[Erp5-report] r38928 luke - /erp5/trunk/products/ERP5Type/Core/Folder.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Oct 6 16:31:54 CEST 2010


Author: luke
Date: Wed Oct  6 16:31:49 2010
New Revision: 38928

URL: http://svn.erp5.org?rev=38928&view=rev
Log:
 - add getIconURL on Folder class, as type icon resolution for ERP5 types is static, and CMF 2.2 works by default with dynamic, but there is no need to make it so complex

Modified:
    erp5/trunk/products/ERP5Type/Core/Folder.py

Modified: erp5/trunk/products/ERP5Type/Core/Folder.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Core/Folder.py?rev=38928&r1=38927&r2=38928&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Core/Folder.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/Core/Folder.py [utf8] Wed Oct  6 16:31:49 2010
@@ -1584,6 +1584,17 @@ class Folder(CopyContainer, CMFBTreeFold
     Folder.inheritedAttribute(
           '_verifyObjectPaste')(self, object, validate_src)
 
+  security.declarePublic('getIconURL')
+  def getIconURL(self):
+    """ Get the absolute URL of the icon for the object.
+        Patched, as ERP5 Type does not provide getExprContext which is used in
+        CMF 2.2
+    """
+    ti = self.getTypeInfo()
+    utool = getToolByName(self, 'portal_url')
+    if ti is None:
+      return '%s/misc_/OFSP/dtmldoc.gif' % utool()
+    return '%s/%s' % (utool(), ti.getTypeIcon())
 
 # We browse all used class from btree and hbtree and set not implemented
 # class if one method defined on a class is not defined on other, thus if




More information about the Erp5-report mailing list