[Erp5-report] r12154 - /erp5/trunk/products/ERP5Type/Base.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Jan 19 10:10:27 CET 2007


Author: jp
Date: Fri Jan 19 10:10:25 2007
New Revision: 12154

URL: http://svn.erp5.org?rev=12154&view=rev
Log:
Added support for web mode detection

Modified:
    erp5/trunk/products/ERP5Type/Base.py

Modified: erp5/trunk/products/ERP5Type/Base.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Base.py?rev=12154&r1=12153&r2=12154&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Base.py (original)
+++ erp5/trunk/products/ERP5Type/Base.py Fri Jan 19 10:10:25 2007
@@ -2454,6 +2454,16 @@
     except AttributeError:
       return None
 
+  security.declarePublic('isWebMode')
+  def isWebMode(self):
+    if self.getApplicableLayout() is None:
+      return False
+    if getattr(self.REQUEST, 'ignore_layout', None) is not None:
+      return False
+    if getattr(self.REQUEST, 'editable_mode', 0):
+      return False
+    return True
+
   security.declareProtected(Permissions.ChangeLocalRoles,
                             'updateLocalRolesOnSecurityGroups')
   def updateLocalRolesOnSecurityGroups(self, **kw):




More information about the Erp5-report mailing list