[CMF-checkins] CVS: Products/CMFDefault/skins/zpt_generic -
members_delete_form.py:1.1 members_delete_template.pt:1.1
members_manage_form.py:1.3
Yvo Schubbe
y.2005- at wcm-solutions.de
Thu Jun 9 06:16:28 EDT 2005
Update of /cvs-repository/Products/CMFDefault/skins/zpt_generic
In directory cvs.zope.org:/tmp/cvs-serv561/CMFDefault/skins/zpt_generic
Modified Files:
members_manage_form.py
Added Files:
members_delete_form.py members_delete_template.pt
Log Message:
- added a confirmation step to avoid accidental deletion of members
=== Added File Products/CMFDefault/skins/zpt_generic/members_delete_form.py ===
##parameters=ids, b_start=0, delete='', cancel=''
##
from Products.CMFCore.utils import getToolByName
from Products.CMFDefault.utils import html_marshal
atool = getToolByName(script, 'portal_actions')
form = context.REQUEST.form
if delete and \
context.members_delete_control(**form) and \
context.setRedirect(atool, 'global/manage_members', b_start=b_start):
return
elif cancel and \
context.setRedirect(atool, 'global/manage_members', b_start=b_start):
return
options = {}
target = atool.getActionInfo('global/members_delete')['url']
hidden_vars = []
for name, value in html_marshal(b_start=b_start, ids=ids):
hidden_vars.append( {'name': name, 'value': value} )
buttons = []
buttons.append( {'name': 'delete', 'value': 'Delete'} )
buttons.append( {'name': 'cancel', 'value': 'Cancel'} )
options['form'] = { 'action': target,
'members': ', '.join(ids),
'listHiddenVarInfos': tuple(hidden_vars),
'listButtonInfos': tuple(buttons) }
return context.members_delete_template(**options)
=== Added File Products/CMFDefault/skins/zpt_generic/members_delete_template.pt ===
<html metal:use-macro="context/main_template/macros/master">
<body>
<metal:slot metal:fill-slot="header" i18n:domain="cmf_default">
<h1 i18n:translate="">Delete Members</h1>
</metal:slot>
<metal:slot metal:fill-slot="main" i18n:domain="cmf_default"
tal:define="form options/form">
<div class="Desktop">
<form action="members_delete" method="post"
tal:attributes="action form/action"
><metal:macro metal:use-macro="context/form_widgets/macros/hidden_vars" />
<p i18n:translate="">The following members - including all their data, home
folders and roles - are selected for deletion:</p>
<p><strong tal:content="form/members">MEMBERS</strong></p>
<metal:macro metal:use-macro="context/form_widgets/macros/buttons" />
</form>
</div>
</metal:slot>
</body>
</html>
=== Products/CMFDefault/skins/zpt_generic/members_manage_form.py 1.2 => 1.3 ===
--- Products/CMFDefault/skins/zpt_generic/members_manage_form.py:1.2 Tue Jan 25 14:49:42 2005
+++ Products/CMFDefault/skins/zpt_generic/members_manage_form.py Thu Jun 9 06:16:28 2005
@@ -11,8 +11,8 @@
form = context.REQUEST.form
if members_delete and \
context.validateMemberIds(**form) and \
- context.members_delete_control(**form) and \
- context.setRedirect(atool, 'global/manage_members', b_start=b_start):
+ context.setRedirect(atool, 'global/members_delete', b_start=b_start,
+ ids=ids):
return
elif members_new and \
context.setRedirect(atool, 'user/join', b_start=b_start):
@@ -47,7 +47,7 @@
buttons = []
buttons.append( {'name': 'members_new', 'value': 'New...'} )
if items:
- buttons.append( {'name': 'members_delete', 'value': 'Delete'} )
+ buttons.append( {'name': 'members_delete', 'value': 'Delete...'} )
options['form'] = { 'action': target,
'listHiddenVarInfos': tuple(hidden_vars),
'listButtonInfos': tuple(buttons) }
More information about the CMF-checkins
mailing list