changeset 1847:c935a4f09f90

allow excluding underlay from sitemap by adding underlay=0 as a parameter
author Johannes Berg <johannes AT sipsolutions DOT net>
date Fri, 02 Mar 2007 23:46:44 +0100
parents ca2c9a7f06c6
children 986c37b557c6
files MoinMoin/Page.py MoinMoin/action/sitemap.py
diffstat 2 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/Page.py	Fri Mar 02 21:44:28 2007 +0100
+++ b/MoinMoin/Page.py	Fri Mar 02 23:46:44 2007 +0100
@@ -1728,7 +1728,7 @@
         request.clock.stop('getPageList')
         return pages
 
-    def getPageDict(self, user=None, exists=1, filter=None):
+    def getPageDict(self, user=None, exists=1, filter=None, include_underlay=True):
         """ Return a dictionary of filtered page objects readable by user
 
         Invoke getPageList then create a dict from the page list. See
@@ -1741,7 +1741,7 @@
         @return: user readable pages
         """
         pages = {}
-        for name in self.getPageList(user=user, exists=exists, filter=filter):
+        for name in self.getPageList(user=user, exists=exists, filter=filter, include_underlay=include_underlay):
             pages[name] = Page(self.request, name)
         return pages
 
--- a/MoinMoin/action/sitemap.py	Fri Mar 02 21:44:28 2007 +0100
+++ b/MoinMoin/action/sitemap.py	Fri Mar 02 23:46:44 2007 +0100
@@ -82,7 +82,11 @@
     }))
 
     # Get page dict readable by current user
-    pages = request.rootpage.getPageDict()
+    try:
+        underlay = int(form.get('underlay', [1])[0])
+    except ValueError:
+        underlay = 1
+    pages = request.rootpage.getPageDict(include_underlay=underlay)
     pagelist = pages.keys()
     pagelist.sort()
     for name in pagelist: