[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ZMI - ZMIViewUtility.py:1.1.2.3

Kapil k_vertigo@yahoo.com
Fri, 1 Feb 2002 14:26:10 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/ZMI
In directory cvs.zope.org:/tmp/cvs-serv29441/lib/python/Zope/App/ZMI

Modified Files:
      Tag: Zope-3x-branch
	ZMIViewUtility.py 
Log Message:
Changed zmi view thingy to add the zmi skin to the tab action URL. -amos


=== Zope3/lib/python/Zope/App/ZMI/ZMIViewUtility.py 1.1.2.2 => 1.1.2.3 ===
         context = self.getContext()
         zmi_view_service = getService(context, 'ZMIViewService')
-        views = zmi_view_service.getViews(context)
-        return [{'label': view[0], 'action': view[1]}
-                for view in views]
-
+        zmi_views=[]
+        for view in zmi_view_service.getViews(context):
+            label=view[0]
+            action=view[1]
+            # munge action URL to make sure that it's using the ZMI skin
+            parts=action.split('/')
+            parts[0]='%s;skin=zmi' % parts[0]
+            action='/'.join(parts)
+            zmi_views.append({'label':label, 'action':action})
+        return zmi_views