[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/Container/Views/Browser - Contents.py:1.3

Jim Fulton jim@zope.com
Thu, 13 Jun 2002 19:16:11 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Container/Views/Browser
In directory cvs.zope.org:/tmp/cvs-serv10697/lib/python/Zope/App/OFS/Container/Views/Browser

Modified Files:
	Contents.py 
Log Message:
Got icons working, and, along the way:

- Implemented the icon directive

- Implemented
  http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/ResourcesProposal

- Added a special view, named '', for service manager containers that
  allows resources to have URLs like:

  http://foo.com/@@/resourcename

- Fixed some server code that caused HTTP response data to get
  promoted to unicode

- Updated the folder contents page to display icons.

- Ported icons for folder, file, image, and zptpage. Many more icons
  need to be ported or created.



=== Zope3/lib/python/Zope/App/OFS/Container/Views/Browser/Contents.py 1.2 => 1.3 ===
 from Zope.App.PageTemplate import ViewPageTemplateFile
 from Zope.App.OFS.Container.IContainer import IContainer
+from Zope.ComponentArchitecture import queryView
 
 class Contents(BrowserView):
 
@@ -32,9 +33,14 @@
         info['id'] = item[0]
         info['object'] = item[1]
 
-        # XXX:  We will fake this stuff out for now
         info[ 'title' ] = info[ 'url' ] = item[0]
-        info['icon'] = None
+
+        zmi_icon = queryView(item[1], 'zmi_icon', self.request)
+        if zmi_icon is None:
+            info['icon'] = None
+        else:
+            info['icon'] = zmi_icon()
+            
 
         return info