[Checkins] SVN: Products.CMFDefault/trunk/Products/CMFDefault/skins/zpt_ - backported some changes from the browser view

Yvo Schubbe cvs-admin at zope.org
Mon Jul 30 06:29:10 UTC 2012


Log message for revision 127398:
  - backported some changes from the browser view

Changed:
  U   Products.CMFDefault/trunk/Products/CMFDefault/skins/zpt_control/folder_paste_control.py
  U   Products.CMFDefault/trunk/Products/CMFDefault/skins/zpt_control/folder_sort_control.py
  U   Products.CMFDefault/trunk/Products/CMFDefault/skins/zpt_generic/getBatchItemInfos.py

-=-
Modified: Products.CMFDefault/trunk/Products/CMFDefault/skins/zpt_control/folder_paste_control.py
===================================================================
--- Products.CMFDefault/trunk/Products/CMFDefault/skins/zpt_control/folder_paste_control.py	2012-07-30 06:21:19 UTC (rev 127397)
+++ Products.CMFDefault/trunk/Products/CMFDefault/skins/zpt_control/folder_paste_control.py	2012-07-30 06:29:06 UTC (rev 127398)
@@ -12,6 +12,10 @@
     else:
         return context.setStatus(True, _(u'Items pasted.'))
 except CopyError:
-    return context.setStatus(False, _(u'CopyError: Paste failed.'))
+    context.REQUEST['RESPONSE'].expireCookie('__cp',
+            path='%s' % (context.REQUEST['BASEPATH1'] or "/"))
+    return context.setStatus(True, _(u'CopyError: Paste failed.'))
+except ValueError:
+    return context.setStatus(False, _(u'ValueError: Paste failed.'))
 except zExceptions_Unauthorized:
     return context.setStatus(False, _(u'Unauthorized: Paste failed.'))

Modified: Products.CMFDefault/trunk/Products/CMFDefault/skins/zpt_control/folder_sort_control.py
===================================================================
--- Products.CMFDefault/trunk/Products/CMFDefault/skins/zpt_control/folder_sort_control.py	2012-07-30 06:21:19 UTC (rev 127397)
+++ Products.CMFDefault/trunk/Products/CMFDefault/skins/zpt_control/folder_sort_control.py	2012-07-30 06:29:06 UTC (rev 127398)
@@ -1,6 +1,7 @@
 ##parameters=key='position', reverse=0, **kw
 ##title=Sort objects in a folder
 ##
+from Products.CMFDefault.utils import Message as _
+
 context.setDefaultSorting(key, reverse)
-
-return context.setStatus(True)
+return context.setStatus(True, _(u'Default sort order changed.'))

Modified: Products.CMFDefault/trunk/Products/CMFDefault/skins/zpt_generic/getBatchItemInfos.py
===================================================================
--- Products.CMFDefault/trunk/Products/CMFDefault/skins/zpt_generic/getBatchItemInfos.py	2012-07-30 06:21:19 UTC (rev 127397)
+++ Products.CMFDefault/trunk/Products/CMFDefault/skins/zpt_generic/getBatchItemInfos.py	2012-07-30 06:29:06 UTC (rev 127398)
@@ -1,29 +1,27 @@
-## Script (Python) "getBatchItemInfos"
 ##parameters=batch_obj
-##title=
 ##
 items = []
 for item in batch_obj:
     item_description = item.Description()
     item_title = item.Title()
-    item_type = remote_type = item.Type()
+    item_type = item.getPortalTypeName()
     if item_type == 'Favorite':
         try:
             item = item.getObject()
             item_description = item_description or item.Description()
             item_title = item_title or item.Title()
-            remote_type = item.Type()
+            item_type = item.getPortalTypeName()
         except KeyError:
             pass
-    is_file = remote_type in ('File', 'Image')
-    is_link = remote_type == 'Link'
+    is_file = item_type in ('File', 'Image')
+    is_link = item_type == 'Link'
     items.append({'description': item_description,
                   'format': is_file and item.Format() or '',
                   'icon': item.getIconURL(),
-                  'size': is_file and ('%0.0f kb' %
-                                       (item.get_size() / 1024.0)) or '',
+                  'size': is_file and ('%0.1f kB' %
+                                     (item.get_size() / 1024.0)) or '',
                   'title': item_title,
-                  'type': item_type,
+                  'type': item.Type(),
                   'url': is_link and item.getRemoteUrl() or
                          item.absolute_url()})
 return tuple(items)



More information about the checkins mailing list