Commit 7afe12b3 authored by Bryton Lacquement's avatar Bryton Lacquement 🚪

ERP5Site: stop registering CMFDefault's Images directory

parent 2d5ce69e
...@@ -2235,35 +2235,14 @@ class ERP5Generator(PortalGenerator): ...@@ -2235,35 +2235,14 @@ class ERP5Generator(PortalGenerator):
""" """
pass pass
# this lists only the skin layers of Products.CMFDefault we are actually
# interested in.
CMFDEFAULT_FOLDER_LIST = ['Images']
def addCMFDefaultDirectoryViews(self, p):
"""Semi-manually create DirectoryViews since CMFDefault 2.X no longer
registers the "skins" directory, only its subdirectories, making it
unusable with Products.CMFCore.DirectoryView.addDirectoryViews."""
from Products.CMFCore.DirectoryView import createDirectoryView, _generateKey
import Products.CMFDefault
ps = p.portal_skins
# get the layer directories actually present
for cmfdefault_skin_layer in self.CMFDEFAULT_FOLDER_LIST:
reg_key = _generateKey(Products.CMFDefault.__name__,
'skins/' + cmfdefault_skin_layer)
createDirectoryView(ps, reg_key)
def setupDefaultSkins(self, p): def setupDefaultSkins(self, p):
ps = p.portal_skins ps = p.portal_skins
self.addCMFDefaultDirectoryViews(p)
ps.manage_addProduct['OFSP'].manage_addFolder(id='external_method') ps.manage_addProduct['OFSP'].manage_addFolder(id='external_method')
ps.manage_addProduct['OFSP'].manage_addFolder(id='custom') ps.manage_addProduct['OFSP'].manage_addFolder(id='custom')
# Set the 'custom' layer a high priority, so it remains the first # Set the 'custom' layer a high priority, so it remains the first
# layer when installing new business templates. # layer when installing new business templates.
ps['custom'].manage_addProperty("business_template_skin_layer_priority", 100.0, "float") ps['custom'].manage_addProperty("business_template_skin_layer_priority", 100.0, "float")
skin_folder_list = [ 'custom' skin_folders = ', '.join(['custom', 'external_method'])
, 'external_method'
] + self.CMFDEFAULT_FOLDER_LIST
skin_folders = ', '.join(skin_folder_list)
ps.addSkinSelection( 'View' ps.addSkinSelection( 'View'
, skin_folders , skin_folders
, make_default = 1 , make_default = 1
......
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