Back to index

plone3  3.1.7
reconfig_form.py
Go to the documentation of this file.
00001 ##parameters=change=''
00002 ##
00003 from Products.CMFCore.utils import getUtilityByInterfaceName
00004 from Products.CMFCore.utils import getToolByName
00005 from Products.CMFDefault.utils import decode
00006 from Products.CMFDefault.utils import Message as _
00007 
00008 atool = getToolByName(script, 'portal_actions')
00009 ptool = getUtilityByInterfaceName('Products.CMFCore.interfaces.IPropertiesTool')
00010 
00011 
00012 form = context.REQUEST.form
00013 if change and \
00014         context.portal_config_control(**form) and \
00015         context.setRedirect(atool, 'global/configPortal'):
00016     return
00017 
00018 
00019 options = {}
00020 
00021 target = atool.getActionInfo('global/configPortal')['url']
00022 buttons = []
00023 buttons.append( {'name': 'change', 'value': _(u'Change')} )
00024 options['form'] = { 'action': target,
00025                     'email_from_name': ptool.getProperty('email_from_name'),
00026                     'email_from_address':
00027                                       ptool.getProperty('email_from_address'),
00028                     'smtp_server': ptool.smtp_server(),
00029                     'title': ptool.title(),
00030                     'description': ptool.getProperty('description'),
00031                     'validate_email': ptool.getProperty('validate_email'),
00032                     'default_charset':
00033                                     ptool.getProperty('default_charset', ''),
00034                     'email_charset': ptool.getProperty('email_charset', ''),
00035                     'listButtonInfos': tuple(buttons) }
00036 
00037 return context.reconfig_template(**decode(options, script))