X-Git-Url: https://scm.cri.ensmp.fr/git/Plinn.git/blobdiff_plain/3c4367d8e03450e9a73e61f4247145d2b6c86a33..959d888c17d1403d2eeecc19bc4b5e2c8d1debf6:/skins/custom_control/folder_top_control.py diff --git a/skins/custom_control/folder_top_control.py b/skins/custom_control/folder_top_control.py deleted file mode 100755 index 1f0b54c..0000000 --- a/skins/custom_control/folder_top_control.py +++ /dev/null @@ -1,24 +0,0 @@ -##parameters=ids, **kw -## - -#TODO : translate messages -#from Products.PlacelessTranslationService.MessageID import MessageIDFactory -#_ = MessageIDFactory('default', as_unicode=True) -_ = lambda x : lambda : x - -subset_ids = [ obj.getId() for obj in context.listFolderContents() ] -try: - try: - attempt = context.moveObjectsToTop(ids, subset_ids=subset_ids) - except TypeError: - # Zope 2.7.0 - attempt = context.moveObjectsToTop(ids) - if attempt: - msg = _(attempt == 1 and \ - '%d item moved to top.' or \ - '%d items moved to top.')().encode('utf-8') % attempt - return context.setStatus( True, msg) - else: - return context.setStatus(False, 'Nothing to change.') -except ValueError, errmsg: - return context.setStatus(False, 'ValueError: %s' % errmsg)