From: <de...@de...> - 2010-07-01 06:22:03
|
Author: PeterThoeny Date: 2010-07-01 01:21:57 -0500 (Thu, 01 Jul 2010) New Revision: 19190 Trac url: http://develop.twiki.org/trac/changeset/19190 Modified: twiki/trunk/core/lib/TWiki/UI/Edit.pm twiki/trunk/core/lib/TWiki/UI/Save.pm Log: Item6511: Adding parenttopic URL parameter with same function like existing topicparent URL parameter to edit and save script (undocumented feature for people who guess the parameter name from the PARENTTOPIC variable name Modified: twiki/trunk/core/lib/TWiki/UI/Edit.pm =================================================================== --- twiki/trunk/core/lib/TWiki/UI/Edit.pm 2010-07-01 04:24:41 UTC (rev 19189) +++ twiki/trunk/core/lib/TWiki/UI/Edit.pm 2010-07-01 06:21:57 UTC (rev 19190) @@ -56,7 +56,7 @@ | =formtemplate= | name of the form for the topic; will replace existing form | | =templatetopic= | name of the topic to copy if creating a new topic | | =skin= | skin(s) to use | -| =topicparent= | what to put in the topic prent meta data | +| =topicparent= | name of parent topic (optional), undocumented =parenttopic= parameter can be used as well | | =text= | text that will replace the old topic text if a formtemplate is defined (what the heck is this for?) | | =contenttype= | optional parameter that defines the application type to write into the CGI header. Defaults to text/html. | | =action= | Optional. If supplied, use the edit${action} template instead of the standard edit template. An empty value means edit both form and text, "form" means edit form only, "text" means edit text only | @@ -92,7 +92,7 @@ my $cgiAppType = $query->param( 'contenttype' ) || $query->param( 'apptype' ) || 'text/html'; my $skin = $session->getSkin(); - my $theParent = $query->param( 'topicparent' ) || ''; + my $theParent = $query->param( 'topicparent' ) || $query->param( 'parenttopic' ) || ''; my $ptext = $query->param( 'text' ); my $revision = $query->param( 'rev' ) || undef; my $store = $session->{store}; Modified: twiki/trunk/core/lib/TWiki/UI/Save.pm =================================================================== --- twiki/trunk/core/lib/TWiki/UI/Save.pm 2010-07-01 04:24:41 UTC (rev 19189) +++ twiki/trunk/core/lib/TWiki/UI/Save.pm 2010-07-01 06:21:57 UTC (rev 19190) @@ -184,7 +184,8 @@ my $forceNewRev = $query->param( 'forcenewrevision' ); $saveOpts->{forcenewrevision} = $forceNewRev; - my $newParent = $query->param( 'topicparent' ); + my $newParent = $query->param( 'topicparent' ) + || $query->param( 'parenttopic' ); # the latter is undocumented if( defined( $newText) ) { # text is defined in the query, save that text @@ -447,7 +448,7 @@ # redirect to a sensible place (a topic that exists) my( $w, $t ) = ( '', '' ); foreach my $test ( $topic, - $query->param( 'topicparent' ), + $query->param( 'topicparent' ) || $query->param( 'parenttopic' ), $TWiki::cfg{HomeTopicName} ) { ( $w, $t ) = $session->normalizeWebTopicName( $web, $test ); |