Index: bin/edit
===================================================================
RCS file: /cvsroot/twiki/twiki/bin/edit,v
retrieving revision 1.58
diff -c -r1.58 edit
*** bin/edit 30 Oct 2002 15:52:56 -0000 1.58
--- bin/edit 9 Nov 2002 05:00:37 -0000
***************
*** 208,215 ****
--- 208,217 ----
# Don't want to render form fields, so this after getRenderedVersion
my %formMeta = $meta->findOne( "FORM" );
my $form = "";
+ my $formlabel = "";
$form = $formMeta{"name"} if( %formMeta );
if( $form && $saveCmd ne "repRev" ) {
+ $formlabel = "Change form";
my @fieldDefs = &TWiki::Form::getFormDef( $templateWeb, $form );
if( ! @fieldDefs ) {
***************
*** 220,234 ****
my $formText = &TWiki::Form::renderForEdit( $webName, $topic, $form, $meta, $query, @fieldDefs );
$tmpl =~ s/%FORMFIELDS%/$formText/go;
} elsif( $saveCmd ne "repRev" && TWiki::Prefs::getPreferencesValue( "WEBFORMS", $webName )) {
! $form = '
'
! . &TWiki::Form::chooseFormButton( "Add form" )
! . '
';
! $tmpl =~ s/%FORMFIELDS%/$form/go;
} else {
$tmpl =~ s/%FORMFIELDS%//go;
}
$tmpl =~ s/%FORMTEMPLATE%//go; # Clear if not being used
$tmpl =~ s/%TEXT%/$text/go;
$tmpl =~ s|( ?) **nop/*>\n?|$1|gois; # remove tags
--- 222,242 ----
my $formText = &TWiki::Form::renderForEdit( $webName, $topic, $form, $meta, $query, @fieldDefs );
$tmpl =~ s/%FORMFIELDS%/$formText/go;
} elsif( $saveCmd ne "repRev" && TWiki::Prefs::getPreferencesValue( "WEBFORMS", $webName )) {
! $formlabel = "Add form";
! $tmpl =~ s/%FORMFIELDS%//go;
} else {
$tmpl =~ s/%FORMFIELDS%//go;
}
$tmpl =~ s/%FORMTEMPLATE%//go; # Clear if not being used
+
+ if ($formlabel) {
+ $form = &TWiki::Form::chooseFormButton( $formlabel );
+ $tmpl =~ s/%FORMEDIT%/$form/go;
+ } else {
+ $tmpl =~ s/%FORMEDIT%//go;
+ }
+
$tmpl =~ s/%TEXT%/$text/go;
$tmpl =~ s|( ?) **nop/*>\n?|$1|gois; # remove tags
Index: lib/TWiki/Form.pm
===================================================================
RCS file: /cvsroot/twiki/twiki/lib/TWiki/Form.pm,v
retrieving revision 1.30
diff -c -r1.30 Form.pm
*** lib/TWiki/Form.pm 5 Jun 2002 06:17:35 -0000 1.30
--- lib/TWiki/Form.pm 9 Nov 2002 05:00:38 -0000
***************
*** 223,236 ****
{
my( $web, $topic, $form, $meta, $query, @fieldsInfo ) = @_;
- my $chooseForm = "";
- if( TWiki::Prefs::getPreferencesValue( "WEBFORMS", "$web" ) ) {
- $chooseForm = chooseFormButton( "Change" );
- }
-
# FIXME could do with some of this being in template
my $text = "\n " .
! &link( $web, $form, "", "h", "", 2, $chooseForm ) . " \n";
fieldVars2Meta( $web, $query, $meta, "override" );
--- 223,231 ----
{
my( $web, $topic, $form, $meta, $query, @fieldsInfo ) = @_;
# FIXME could do with some of this being in template
my $text = "\n " .
! &link( $web, $form, "", "h", "", 2, "" ) . " \n";
fieldVars2Meta( $web, $query, $meta, "override" );
Index: templates/edit.iejs.tmpl
===================================================================
RCS file: /cvsroot/twiki/twiki/templates/edit.iejs.tmpl,v
retrieving revision 1.20
diff -c -r1.20 edit.iejs.tmpl
*** templates/edit.iejs.tmpl 31 May 2002 07:20:21 -0000 1.20
--- templates/edit.iejs.tmpl 9 Nov 2002 05:00:38 -0000
***************
*** 360,366 ****
%FORMFIELDS%
! %TMPL:DEF{"topicaction"}%
%SEP% edit %TMPL:END%
%TMPL:P{"standardfooter"}%