Back to index

plone3  3.1.7
folder_rename_control.py
Go to the documentation of this file.
00001 ##parameters=ids, new_ids, **kw
00002 ##title=Rename objects in a folder
00003 ##
00004 from Products.CMFDefault.exceptions import CopyError
00005 from Products.CMFDefault.utils import Message as _
00006 
00007 if not ids == new_ids:
00008     try:
00009         context.manage_renameObjects(ids, new_ids)
00010         if len(ids) == 1:
00011             return context.setStatus(True, _(u'Item renamed.'))
00012         else:
00013             return context.setStatus(True, _(u'Items renamed.'))
00014     except CopyError:
00015         return context.setStatus(False, _(u'CopyError: Rename failed.'))
00016 else:
00017     return context.setStatus(False, _(u'Nothing to change.'))