Brown-paper-bag commit. This is what happens when one pays more attention to...

Brown-paper-bag commit. This is what happens when one pays more attention to CMF 1.5 compatibility than to CMF 2.x compatibility one is trying to achieve. Make the skin registration also work on CMF 2.x as well (approved by jerome)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29615 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 617843d1
...@@ -1703,12 +1703,14 @@ class ERP5Generator(PortalGenerator): ...@@ -1703,12 +1703,14 @@ class ERP5Generator(PortalGenerator):
from Products.CMFCore.DirectoryView import createDirectoryView from Products.CMFCore.DirectoryView import createDirectoryView
try: try:
from Products.CMFCore.DirectoryView import _generateKey from Products.CMFCore.DirectoryView import _generateKey
def generateKey(package, subdir):
return _generateKey(package.__name__, subdir)
except ImportError: except ImportError:
# Means we're still on CMF 1.x, were they generate the DirectoryView # Means we're still on CMF 1.x, were they generate the DirectoryView
# key using minimalpath # key using minimalpath
# ( see Products.CMFCore.DirectoryView.addDirectoryViews() ) # ( see Products.CMFCore.DirectoryView.addDirectoryViews() )
from Products.CMFCore.DirectoryView import minimalpath from Products.CMFCore.DirectoryView import minimalpath
def _generateKey(package, subdir): def generateKey(package, subdir):
package_path = os.path.dirname(package.__file__) package_path = os.path.dirname(package.__file__)
return minimalpath(os.path.join(package_path, subdir)) return minimalpath(os.path.join(package_path, subdir))
import Products.CMFDefault import Products.CMFDefault
...@@ -1716,7 +1718,7 @@ class ERP5Generator(PortalGenerator): ...@@ -1716,7 +1718,7 @@ class ERP5Generator(PortalGenerator):
ps = getToolByName(p, 'portal_skins') ps = getToolByName(p, 'portal_skins')
# get the layer directories actually present # get the layer directories actually present
for cmfdefault_skin_layer in self.CMFDEFAULT_FOLDER_LIST: for cmfdefault_skin_layer in self.CMFDEFAULT_FOLDER_LIST:
reg_key = _generateKey(Products.CMFDefault, reg_key = generateKey(Products.CMFDefault,
'skins/' + cmfdefault_skin_layer) 'skins/' + cmfdefault_skin_layer)
createDirectoryView(ps, reg_key) createDirectoryView(ps, reg_key)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment