Back to index

plone3  3.1.7
add_ext_editor.py
Go to the documentation of this file.
00001 ## Script (Python) "add_ext_editor"
00002 ##bind container=container
00003 ##bind context=context
00004 ##bind namespace=
00005 ##bind script=script
00006 ##bind subpath=traverse_subpath
00007 ##parameters=
00008 ##title=adds ext_edit actions to types
00009 types=context.portal_types
00010 omit_types=('Folder','Discussion Item','Event','Topic', 'Collector', 'Collector Issue',
00011             'Collector Issue Transcript', 'Collector Subset')
00012 for ctype in [ctype for ctype in types.objectValues() if ctype.Title() not in omit_types]:
00013     try:
00014         ctype.getActionById('external_edit')
00015     except (TypeError, KeyError, ValueError):
00016         ctype.addAction( 'external_edit',
00017                          'External Editor',
00018                          'external_edit',
00019                          'Modify portal content',
00020                          'object',
00021                          visible=0 )
00022 context.portal_properties.site_properties.manage_changeProperties( {'ext_editor':1} )
00023 return 'Successfully configured system to use External Editor.'