[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/Publisher/Browser - GlobalBrowserMenuService.py:1.9

runyaga runyaga@thisbox.com
Thu, 5 Dec 2002 09:17:13 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/Publisher/Browser
In directory cvs.zope.org:/tmp/cvs-serv10345

Modified Files:
	GlobalBrowserMenuService.py 
Log Message:
added a 'selected' attribute for each MenuItem
when the BrowserService returns a getMenu()
this calculation is based on the request.




=== Zope3/lib/python/Zope/App/Publisher/Browser/GlobalBrowserMenuService.py 1.8 => 1.9 ===
--- Zope3/lib/python/Zope/App/Publisher/Browser/GlobalBrowserMenuService.py:1.8	Tue Nov 19 18:25:13 2002
+++ Zope3/lib/python/Zope/App/Publisher/Browser/GlobalBrowserMenuService.py	Thu Dec  5 09:17:11 2002
@@ -95,10 +95,16 @@
                     except (Unauthorized, Forbidden):
                         continue # Skip unauthorized or forbidden
 
+                if request.getURL().endswith(action):
+                    selected='selected'
+                else:
+                    selected=''
+
                 result.append({
                     'title': title,
                     'description': description,
                     'action': "%s" % action,
+                    'selected': selected
                     })
 
                 if len(result) >= max: