On va essayer d'afficher le résultat de la XHR.
[Plinn.git] / skins / custom_control / folder_rename_control.py
1 ##parameters=ids, new_ids, **kw
2 ##title=Rename objects in a folder
3 ##
4 from Products.CMFDefault.exceptions import CopyError
5 from Products.Plinn.utils import translate
6 _ = lambda msg : translate(msg, context)
7
8 if not ids == new_ids:
9 try:
10 skiped = context.manage_renameObjects(ids, new_ids)
11 if not skiped :
12 if len(ids) == 1:
13 return context.setStatus(True, _(u'Item renamed.'))
14 else:
15 return context.setStatus(True, _(u'Items renamed.'))
16 else :
17 if len(skiped) == 1 :
18 return context.setStatus(True, _( u'This item has not been renamed: "%s"') % ids[0] )
19 else :
20 return context.setStatus(True
21 , _( u'These items have not been renamed: %s') % \
22 ', '.join(['"%s"' % id for id in ids]) )
23 except CopyError:
24 return context.setStatus(False, _(u'Rename failed.'))
25 else:
26 return context.setStatus(False, _(u'Nothing to change.'))