[CMF-checkins] CVS: CMF/CMFDefault/skins/zpt_generic - folder_contents_control.py:1.4 folder_rename_control.py:1.2

Yvo Schubbe y.2004_ at wcm-solutions.de
Thu Feb 5 09:45:38 EST 2004


Update of /cvs-repository/CMF/CMFDefault/skins/zpt_generic
In directory cvs.zope.org:/tmp/cvs-serv25432/CMFDefault/skins/zpt_generic

Modified Files:
	folder_contents_control.py folder_rename_control.py 
Log Message:
- replaced some getActionInfo calls by the new getActionInfo method of DynamicType
- added a fallback to 'folder/view' for folderish subobjects that don't have a 'folder/folderContents' action in portal_actions


=== CMF/CMFDefault/skins/zpt_generic/folder_contents_control.py 1.3 => 1.4 ===
--- CMF/CMFDefault/skins/zpt_generic/folder_contents_control.py:1.3	Mon Feb  2 11:50:32 2004
+++ CMF/CMFDefault/skins/zpt_generic/folder_contents_control.py	Thu Feb  5 09:45:38 2004
@@ -24,8 +24,7 @@
 
 
 if not mtool.checkPermission(ListFolderContents, context):
-    ti = context.getTypeInfo()
-    target = ti.getActionInfo('folder/view', context)['url']
+    target = context.getActionInfo('folder/view')['url']
     context.REQUEST.RESPONSE.redirect(target)
     return None
 
@@ -52,8 +51,7 @@
         message = 'Please select one or more items to delete first.'
 
 elif items_new:
-    ti = context.getTypeInfo()
-    target = ti.getActionInfo('folder/new', context)['url']
+    target = context.getActionInfo('folder/new')['url']
     context.REQUEST.RESPONSE.redirect(target)
     return None
 
@@ -71,8 +69,7 @@
 
 elif items_rename:
     if ids:
-        ti = context.getTypeInfo()
-        target = ti.getActionInfo('folder/rename_items', context)['url']
+        target = context.getActionInfo('folder/rename_items')['url']
         query = make_query( ids=list(ids) )
         context.REQUEST.RESPONSE.redirect( '%s?%s' % (target, query) )
         return None
@@ -116,10 +113,12 @@
     item_icon = item.getIcon(1)
     item_id = item.getId()
     if item.isPrincipiaFolderish:
-        item_url = atool.getActionInfo('folder/folderContents', item)['url']
+        try:
+            item_url = atool.getActionInfo('folder/folderContents', item)['url']
+        except ValueError:
+            item_url = item.getActionInfo('folder/view')['url']
     else:
-        ti = item.getTypeInfo()
-        item_url = ti.getActionInfo('object/view', item)['url']
+        item_url = item.getActionInfo('object/view')['url']
     items.append( { 'checkbox': items_manage_allowed and
                                 ('cb_%s' % item_id) or '',
                     'icon': item_icon and


=== CMF/CMFDefault/skins/zpt_generic/folder_rename_control.py 1.1 => 1.2 ===
--- CMF/CMFDefault/skins/zpt_generic/folder_rename_control.py:1.1	Mon Jan 12 07:42:40 2004
+++ CMF/CMFDefault/skins/zpt_generic/folder_rename_control.py	Thu Feb  5 09:45:38 2004
@@ -48,8 +48,7 @@
 control['batch'] = { 'listItemInfos': tuple(items) }
 
 buttons = []
-ti = context.getTypeInfo()
-target = ti.getActionInfo('folder/rename_items', context)['url']
+target = context.getActionInfo('folder/rename_items')['url']
 buttons.append( {'name': 'rename', 'value': 'Rename'} )
 buttons.append( {'name': 'cancel', 'value': 'Cancel'} )
 control['form'] = { 'action': target,




More information about the CMF-checkins mailing list