[CMF-checkins] CVS: CMF/CMFWiki/skins/wiki - wikipage_create_handler.dtml: wikipage_deleterename_handler.py:

Shane Hathaway shane@cvs.zope.org
Wed, 20 Feb 2002 15:15:27 -0500

Update of /cvs-repository/CMF/CMFWiki/skins/wiki
In directory cvs.zope.org:/tmp/cvs-serv27999/CMFWiki/skins/wiki

Modified Files:
      Tag: cmf-pre-1_3-branch
	wikipage_create_handler.dtml wikipage_deleterename_handler.py 
Log Message:
Merged changes from head, with a small change: the types tool does not need
to be extended in such a complex way.  I took out the type_type registry and
the __bobo_traverse__ hook and replaced it with the original code with only
minor mods that give you the same extensibility without all the hacking.
(If anyone actually wants to use the extensibility, which I suspect no one
is actually interested in doing, I will happily provide instructions and
will create a corrected unit test.)

=== CMF/CMFWiki/skins/wiki/wikipage_create_handler.dtml 1.1 => ===
                             , log=REQUEST['log']
-<dtml-call expr="REQUEST['RESPONSE'].redirect( absolute_url() +
-                     '?portal_status_message=Page+added.' )">
+<dtml-call expr="REQUEST['RESPONSE'].redirect(
+                           this().aq_parent[page].wiki_page_url()
+                           + '?portal_status_message=Page+added.' )">

=== CMF/CMFWiki/skins/wiki/wikipage_deleterename_handler.py 1.1 => ===
         raise ValueError, ("You must check the 'confirm delete'"
                            " box to commit the deletion.")
-    context.delete()
     url = REQUEST.get('URL2') + '/FrontPage'
+    # Try to get a parent url, so we can return there
+    folder = context.aq_parent
+    for p in context.parents:
+        if hasattr(folder, p):
+            url = folder[p].wiki_page_url()
+            break
+    context.delete()
 elif REQUEST.has_key('Rename'):
     url = context.rename(REQUEST.get('new_id'))
-RESPONSE.redirect('%s' % url)
\ No newline at end of file
+RESPONSE.redirect('%s' % url)