X-Git-Url: https://scm.cri.mines-paristech.fr/git/Plinn.git/blobdiff_plain/b3b52f5b0ad754fd9036f816d0ab8e98a5373f40..47c592d60c4673c0dd7ad36b579a7aa47a87529c:/profiles/photo/various.py diff --git a/profiles/photo/various.py b/profiles/photo/various.py index 2932d81..efe3039 100644 --- a/profiles/photo/various.py +++ b/profiles/photo/various.py @@ -10,11 +10,8 @@ from Products.CMFCore.utils import getToolByName from Products.CMFCore.exceptions import BadRequest from Products.Plinn.exceptions import WorkflowException -# TODO : CMF-2.1 compat -#from Products.PlacelessTranslationService.MessageID import MessageIDFactory -#_ = MessageIDFactory('plinn') -translate = lambda msg : msg -#--- +from Products.Plinn.utils import translate as i18ntranslate +translate = lambda msg : i18ntranslate(msg, context) # constructs misc objects @@ -30,7 +27,7 @@ for m in misc : except : pass if site.acl_users.Users.acl_users.encrypt_passwords : - site.acl_users.Users.acl_users.manage_setUserFolderProperties(encrypt_passwords=False) + site.acl_users.Users.acl_users.manage_setUserFolderProperties(encrypt_passwords=True) # configure mosaicTool @@ -60,15 +57,20 @@ def doActionForOrSkip(*args, **kw) : except WorkflowException : pass # home page +text=[] +text.append('
%s
' % translate('This is the default home page.')) +text.append('%s
' % translate('To change the content just select "Edit" in the Tab bar on the top.')) +text = '\n'.join(text) constructOrSkip( 'Document', site, 'index_html' , title = translate('Home') , text_format='html' - , text=site.default_home_page_content()) + , text=text) doActionForOrSkip(site.index_html, 'direct_publish') # default folders -constructOrSkip('Plinn Folder', site, 'Members', title = translate('Members')) -#constructOrSkip('Plinn Folder', site, 'global_settings', title = translate('Portlets')) +constructOrSkip('Huge Plinn Folder', site, 'Members', title = translate('Members')) +#constructOrSkip('Huge Plinn Folder', site, 'global_settings', title = translate('Portlets')) if not hasattr(site, 'global_settings') : site.manage_addProduct['OFSP'].manage_addFolder('global_settings') if not site.global_settings.hasProperty('noIndex'): @@ -78,7 +80,7 @@ if not site.global_settings.hasProperty('noIndex'): constructOrSkip('Mosaic Document', site.global_settings, 'left_boxes', title=translate('Left boxes')) lb = site.global_settings.left_boxes addBlockOrSkip(lb, 'Tree Box Block', 0, id='nav_tree') -lb.nav_tree.saveBlock(filteredMetaTypes={'text' : ['Plinn Folder', 'Portfolio', 'Topic']}) +lb.nav_tree.saveBlock(filteredMetaTypes={'text' : ['Huge Plinn Folder', 'Portfolio', 'Topic']}) doActionForOrSkip(lb, 'direct_publish') # right boxes @@ -87,20 +89,32 @@ rb = site.global_settings.right_boxes addBlockOrSkip(rb, 'Action Box Block', 0, id='global_actions') rb.global_actions.saveBlock(boxTitle={'text' : translate('Global actions')}, categories={'text' : ['global']}) addBlockOrSkip(rb, 'Action Box Block', 0, id='workflow_actions') -#rb.workflow_actions.saveBlock(boxTitle={'text' : translate('Workflow')}, categories={'text' : ['workflow']}) -#doActionForOrSkip(rb, 'direct_publish') +rb.workflow_actions.saveBlock(boxTitle={'text' : translate('Workflow')}, categories={'text' : ['workflow']}) +doActionForOrSkip(rb, 'direct_publish') # tools settings mtool = getToolByName(site, 'portal_membership') -mtool.setMemberAreaPortalType('Plinn Folder') +mtool.setMemberAreaPortalType('Huge Plinn Folder') gtool = getToolByName(site, 'portal_groups') -gtool.setGroupWorkspaceContainerType('Plinn Folder') -gtool.setGroupWorkspaceType('Plinn Folder') +gtool.setGroupWorkspaceContainerType('Huge Plinn Folder') +gtool.setGroupWorkspaceType('Huge Plinn Folder') caltool = getToolByName(site, 'portal_calendar') caltool.configureTool(['created', 'modified', 'DateTimeOriginal'], [9, 18]) +pimtool = getToolByName(site, 'portal_image_manipulation') +if not pimtool.hasObject('image') : + pimtool.manage_addProduct['OFSP'].manage_addFolder('image') +if not pimtool.hasObject('tile') : + pimtool.manage_addProduct['OFSP'].manage_addFolder('tile') + +ctool = getToolByName(site, 'portal_catalog') +if not 'position' in ctool.indexes() : + ctool.manage_addProduct['ProxyIndex'].manage_addProxyIndex('position', + extra = { 'idx_type' : 'FieldIndex' + , 'value_expr' : 'python:object.getParentNode().getObjectPosition(object.getId())'}) + # Caches HTTPCache = site.HTTPCache HTTPCache.manage_editProps(title='Accelerated HTTP Cache',