1 ##parameters=ids=[], items=[], rename='', cancel='', ajax=''
3 from Products
.CMFCore
.utils
import getToolByName
4 from Products
.CMFDefault
.utils
import html_marshal
6 utool
= getToolByName(script
, 'portal_url')
10 form
= context
.REQUEST
.form
12 context
.folder_rename_control(**form
) and \
13 context
.setRedirect(context
, 'object/folderContents', **form
):
16 context
.setRedirect(context
, 'object/folderContents', **form
):
20 c
= context
.aq_explicit
23 ids
= [i
['id'] for i
in items
]
28 if item
.cb_isMoveable() :
29 item_icon
= item
.getIcon(1)
30 itemInfos
.append( { 'icon': item_icon
and ( '%s/%s' % (portal_url
, item_icon
) ) or '',
32 'title': item
.Title(),
33 'type': item
.Type() or None } )
35 options
['batch'] = { 'listItemInfos': itemInfos
}
36 action
= context
.getActionInfo('object/rename_items')['url']
38 buttons
.append( {'name': 'rename', 'value': 'Rename'} )
39 buttons
.append( {'name': 'cancel', 'value': 'Cancel'} )
40 options
['form'] = {'action': action
,
41 'listButtonInfos': tuple(buttons
)}
43 return context
.folder_rename_template(**options
)