Back to index

plone3  3.1.7
members_delete_form.py
Go to the documentation of this file.
00001 ##parameters=ids, b_start=0, delete='', cancel=''
00002 ##
00003 from Products.CMFCore.utils import getToolByName
00004 from Products.CMFDefault.utils import decode
00005 from Products.CMFDefault.utils import html_marshal
00006 from Products.CMFDefault.utils import Message as _
00007 
00008 atool = getToolByName(script, 'portal_actions')
00009 
00010 
00011 form = context.REQUEST.form
00012 if delete and \
00013         context.members_delete_control(**form) and \
00014         context.setRedirect(atool, 'global/manage_members', b_start=b_start):
00015     return
00016 elif cancel and \
00017         context.setRedirect(atool, 'global/manage_members', b_start=b_start):
00018     return
00019 
00020 
00021 options = {}
00022 
00023 target = atool.getActionInfo('global/members_delete')['url']
00024 hidden_vars = []
00025 for name, value in html_marshal(b_start=b_start, ids=ids):
00026     hidden_vars.append( {'name': name, 'value': value} )
00027 buttons = []
00028 buttons.append( {'name': 'delete', 'value': _(u'Delete')} )
00029 buttons.append( {'name': 'cancel', 'value': _(u'Cancel')} )
00030 options['form'] = { 'action': target,
00031                     'members': ', '.join(ids),
00032                     'listHiddenVarInfos': tuple(hidden_vars),
00033                     'listButtonInfos': tuple(buttons) }
00034 
00035 return context.members_delete_template(**decode(options, script))