Last change
on this file since 536 was
486,
checked in by joachim, 18 years ago
|
svn -R propset svn:keywords "Id" .
added layout_application_/edit/create/view
and cleaned that up.
|
-
Property svn:keywords set to
Id
|
File size:
1.1 KB
|
Rev | Line | |
---|
[333] | 1 | ## Script (Python) "folder_delete"
|
---|
[337] | 2 | ##bind container=container
|
---|
| 3 | ##bind context=context
|
---|
| 4 | ##bind namespace=
|
---|
| 5 | ##bind script=script
|
---|
| 6 | ##bind subpath=traverse_subpath
|
---|
| 7 | ##parameters=ids=[], REQUEST=None
|
---|
| 8 | ##title=
|
---|
| 9 | ##
|
---|
[486] | 10 | # $Id: folder_delete.py 486 2006-09-06 10:09:39Z joachim $
|
---|
[337] | 11 | """
|
---|
| 12 | FIXME: add docstring.
|
---|
| 13 | """
|
---|
[333] | 14 |
|
---|
[337] | 15 | from Products.CMFCore.utils import getToolByName
|
---|
[333] | 16 |
|
---|
[337] | 17 | ti = getToolByName(context, 'portal_types').getTypeInfo(context.portal_type)
|
---|
| 18 | meth_id = ti.queryMethodID('view', 'folder_contents')
|
---|
| 19 | ret_url = context.absolute_url() + '/' + meth_id
|
---|
| 20 |
|
---|
| 21 | if ids:
|
---|
| 22 | for id in ids:
|
---|
| 23 | # XXX has to be called from here since the workflow doesn't handle the
|
---|
| 24 | # deletion yet
|
---|
| 25 | ob = getattr(context, id)
|
---|
| 26 | from Products.CPSCore.EventServiceTool import getPublicEventService
|
---|
| 27 | evtool = getPublicEventService(context)
|
---|
| 28 | evtool.notifyEvent('workflow_delete', ob, {})
|
---|
| 29 | context.manage_delObjects(ids)
|
---|
| 30 | message = 'portal_status_message=psm_item(s)_deleted'
|
---|
[333] | 31 | else:
|
---|
[337] | 32 | message = 'portal_status_message=psm_select_at_least_one_document'
|
---|
[333] | 33 |
|
---|
[337] | 34 | if REQUEST is not None:
|
---|
| 35 | return REQUEST.RESPONSE.redirect(ret_url + '?' + message)
|
---|
Note: See
TracBrowser for help on using the repository browser.