Commit 18546ee4 authored by Kevin Deldycke's avatar Kevin Deldycke

Install fckeditor automaticcaly.

Auto-delete trailing spaces.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9320 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e7ea6231
...@@ -105,7 +105,7 @@ class ReferCheckerBeforeTraverseHook: ...@@ -105,7 +105,7 @@ class ReferCheckerBeforeTraverseHook:
response = request.RESPONSE response = request.RESPONSE
http_url = request.get('ACTUAL_URL', '').strip() http_url = request.get('ACTUAL_URL', '').strip()
http_referer = request.get('HTTP_REFERER', '').strip() http_referer = request.get('HTTP_REFERER', '').strip()
user_password = request._authUserPW() user_password = request._authUserPW()
if user_password: if user_password:
user = container.acl_users.getUserById(user_password[0]) or\ user = container.acl_users.getUserById(user_password[0]) or\
...@@ -113,7 +113,7 @@ class ReferCheckerBeforeTraverseHook: ...@@ -113,7 +113,7 @@ class ReferCheckerBeforeTraverseHook:
# Manager can do anything # Manager can do anything
if user is not None and 'Manager' in user.getRoles(): if user is not None and 'Manager' in user.getRoles():
return return
portal_url = container.portal_url.getPortalObject().absolute_url() portal_url = container.portal_url.getPortalObject().absolute_url()
if http_referer != '': if http_referer != '':
# if HTTP_REFERER is set, user can acces the object if referer is ok # if HTTP_REFERER is set, user can acces the object if referer is ok
...@@ -164,7 +164,7 @@ class ERP5Site(FolderMixIn, CMFSite): ...@@ -164,7 +164,7 @@ class ERP5Site(FolderMixIn, CMFSite):
Implemented for consistency Implemented for consistency
""" """
return self.index_html() return self.index_html()
security.declareProtected(Permissions.ManagePortal, 'enableRefererCheck') security.declareProtected(Permissions.ManagePortal, 'enableRefererCheck')
def enableRefererCheck(self): def enableRefererCheck(self):
"""Enable a ReferCheckerBeforeTraverseHook to check users have valid """Enable a ReferCheckerBeforeTraverseHook to check users have valid
...@@ -175,7 +175,7 @@ class ERP5Site(FolderMixIn, CMFSite): ...@@ -175,7 +175,7 @@ class ERP5Site(FolderMixIn, CMFSite):
ReferCheckerBeforeTraverseHook.handle, ReferCheckerBeforeTraverseHook.handle,
# we want to be registered _after_ CookieCrumbler # we want to be registered _after_ CookieCrumbler
100) 100)
def _disableRefererCheck(self): def _disableRefererCheck(self):
"""Disable the HTTP_REFERER check.""" """Disable the HTTP_REFERER check."""
BeforeTraverse.unregisterBeforeTraverse(self, BeforeTraverse.unregisterBeforeTraverse(self,
...@@ -1091,29 +1091,43 @@ class ERP5Generator(PortalGenerator): ...@@ -1091,29 +1091,43 @@ class ERP5Generator(PortalGenerator):
def setupDefaultSkins(self, p): def setupDefaultSkins(self, p):
from Products.CMFCore.DirectoryView import addDirectoryViews from Products.CMFCore.DirectoryView import addDirectoryViews
from Products.CMFDefault import cmfdefault_globals from Products.CMFDefault import cmfdefault_globals
from Products.CMFActivity import cmfactivity_globals from Products.CMFActivity import cmfactivity_globals
from Products.FCKeditor import fckeditor_globals
ps = getToolByName(p, 'portal_skins') ps = getToolByName(p, 'portal_skins')
addDirectoryViews(ps, 'skins', cmfdefault_globals) addDirectoryViews(ps, 'skins', cmfdefault_globals)
addDirectoryViews(ps, 'skins', cmfactivity_globals) addDirectoryViews(ps, 'skins', cmfactivity_globals)
addDirectoryViews(ps, 'skins', fckeditor_globals)
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( ps['custom'].manage_addProperty("business_template_skin_layer_priority", 100.0, "float")
"business_template_skin_layer_priority", 100.0, "float") skin_folder_list = [ 'custom'
ps.addSkinSelection('View', 'custom, external_method, activity, ' , 'fckeditor'
+ 'zpt_content, zpt_generic,' , 'external_method'
+ 'zpt_control, content, generic, control, Images', , 'activity'
make_default=1) , 'zpt_content'
ps.addSkinSelection('Print', 'custom, external_method, activity, ' , 'zpt_generic'
+ 'zpt_content, zpt_generic,' , 'zpt_control'
+ 'zpt_control, content, generic, control, Images', , 'content'
make_default=0) , 'generic'
ps.addSkinSelection('CSV', 'custom, external_method, activity, ' , 'control'
+ 'zpt_content, zpt_generic,' , 'Images'
+ 'zpt_control, content, generic, control, Images', ]
make_default=0) skin_folders = ', '.join(skin_folder_list)
ps.addSkinSelection( 'View'
, skin_folders
, make_default = 1
)
ps.addSkinSelection( 'Print'
, skin_folders
, make_default = 0
)
ps.addSkinSelection( 'CSV'
, skin_folders
, make_default = 0
)
p.setupCurrentSkin() p.setupCurrentSkin()
def setupWorkflow(self, p): def setupWorkflow(self, p):
......
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