[Erp5-report] r13682 - /erp5/trunk/products/ERP5/Document/TextDocument.py

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Mar 26 22:40:12 CEST 2007


Author: jp
Date: Mon Mar 26 22:40:11 2007
New Revision: 13682

URL: http://svn.erp5.org?rev=13682&view=rev
Log:
Better support for base URL in TextDocument.

Modified:
    erp5/trunk/products/ERP5/Document/TextDocument.py

Modified: erp5/trunk/products/ERP5/Document/TextDocument.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/TextDocument.py?rev=13682&r1=13681&r2=13682&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/TextDocument.py (original)
+++ erp5/trunk/products/ERP5/Document/TextDocument.py Mon Mar 26 22:40:11 2007
@@ -151,3 +151,15 @@
     def __call__(self):
       _setCacheHeaders(self, {})
       return Document.__call__(self)
+
+    security.declareProtected(Permissions.AccessContentsInformation, 'getContentBaseURL')
+    def getContentBaseURL(self):
+      """
+        Returns the content base URL based on the actual content
+        (in HTML)
+      """
+      html = self.asHTML()
+      base_list = re.findall(self.base_parser, str(html))
+      if base_list:
+        return base_list[0]
+      return Document.getContentBaseURL(self)




More information about the Erp5-report mailing list