[CMF-checkins] CVS: CMF/CMFWiki - CMFWikiPage.py:1.22

Ken Manheimer klm@zope.com
Tue, 5 Feb 2002 17:06:11 -0500


Update of /cvs-repository/CMF/CMFWiki
In directory cvs.zope.org:/tmp/cvs-serv6988

Modified Files:
	CMFWikiPage.py 
Log Message:
Make constructed links use absolute urls (via wiki_page_url() and
wiki_base_url()) as much as possible, so inadvertant acquisition
nesting (".../FrontPage/FrontPage") doesn't screw up at surprising
moments.

._makeCreationLink(): use self.wiki_page_url() instead of the id.

._simplewikilink_replace(), _wikilink_replace(): use absolute urls of
one sort or another for existing-page and new-target links.


=== CMF/CMFWiki/CMFWikiPage.py 1.21 => 1.22 ===
                )
         return fmt % ( wiki_name
-                     , quote( self.getId() )
+                     , quote( self.wiki_page_url() )
                      , action
                      , quote( wiki_name )
                      )
@@ -297,7 +297,8 @@
         # otherwise, provide a "?" creation link
         if hasattr(aq_base(folder), m): 
             # Actually contained within the folder:
-            return '<a href="%s">%s</a>' % (quote(m), m)
+            return '<a href="%s/%s">%s</a>' % (self.wiki_base_url(),
+                                               quote(m), m)
         elif hasattr(folder, m):
             obj = getattr(folder, m)
             if not hasattr(obj, 'absolute_url'):
@@ -355,7 +356,8 @@
         # it.
         elif hasattr(aq_base(folder), m):
             # Actually contained wihtin the folder:
-            return '<a href="%s">%s</a>' % (quote(m), m) + e
+            return '<a href="%s/%s">%s</a>' % (self.wiki_base_url(),
+                                               quote(m), m) + e
         elif hasattr(folder, m):
             # Obtained by acquisition - make sure to use the real URL:
             obj = getattr(folder, m)