[Erp5-report] r21910 - /erp5/trunk/products/ERP5/Document/WebSite.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Jun 26 04:56:29 CEST 2008
Author: yo
Date: Thu Jun 26 04:56:28 2008
New Revision: 21910
URL: http://svn.erp5.org?rev=21910&view=rev
Log:
Support changing a skin selection based on the property skin_selection_name in a Web Site.
Modified:
erp5/trunk/products/ERP5/Document/WebSite.py
Modified: erp5/trunk/products/ERP5/Document/WebSite.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/WebSite.py?rev=21910&r1=21909&r2=21910&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/WebSite.py (original)
+++ erp5/trunk/products/ERP5/Document/WebSite.py Thu Jun 26 04:56:28 2008
@@ -54,7 +54,7 @@
Remove the path to the VirtualRoot from a physical path
and add the path to the WebSite if any
"""
- if type(path) is type(''):
+ if isinstance(path, str):
path = path.split( '/')
# Every Web Section acts as a mini site though layout for document editing is the root layout
@@ -98,10 +98,15 @@
def __call__(self, container, request):
"""
Each time we are traversed, we patch the request instance with our
- rewritted version of physicalPathToVirtualPath
+ own version of physicalPathToVirtualPath
"""
self._v_request = request
request.physicalPathToVirtualPath = self._physicalPathToVirtualPath
+
+ # If a skin selection is defined in this web site, change the skin now.
+ skin_selection_name = container.getSkinSelectionName()
+ if skin_selection_name:
+ container.getPortalObject().changeSkin(skin_selection_name)
class WebSite(WebSection):
"""
@@ -124,6 +129,7 @@
, PropertySheet.CategoryCore
, PropertySheet.DublinCore
, PropertySheet.WebSection
+ , PropertySheet.WebSite
, PropertySheet.Predicate
)
@@ -205,4 +211,4 @@
# Sort by Index
section_list.sort(lambda x,y: cmp(x.getIntIndex(), y.getIntIndex()))
- return section_list
+ return section_list
More information about the Erp5-report
mailing list