#?SuikaWikiConfig/2.0

Plugin:
  @Name: WikiFormButton
  @FullName:
    WikiForm: Common Buttons
  @Description:
    @@@: This module provides common buttons.
    @@lang: en
  @License: %%GPL%%
  @Author[list]:
     Wakaba <w@suika.fam.cx>
  @Date.RCS: $Date: 2004/11/08 10:03:42 $
  @RequiredModule[list]:
    WikiFormCore

PluginConst:
  @NS_XHTML1:
    http://www.w3.org/1999/xhtml

FormattingRule:
  @Category[list]:
    form-input
  @Name: mode-button
  @Description:
    @@@@: Submitting form button, with mode specification
    @@@lang:en
  @Parameter:
    @@Name: class
    @@Type: class-list
    @@Default:(none)
    @@Description:
      @@@@: Class name list
      @@@lang:en
  @Parameter:
    @@Name:description
    @@Type: CDATA
    @@Default:(none)
    @@Description:
      @@@@: Human readable long description text
      @@lang:en
  @Parameter:
    @@Name: label
    @@Type: CDATA
    @@Default:(implied)
    @@Description:
      @@@@: Label
      @@@lang:en
  @Parameter:
    @@Name: mode
    @@Type: mode
    @@Default: "default"
    @@Description:
      @@@@: Mode name
      @@@lang: en
  @Formatting:
    my $SUBMIT = $p->{-parent}->append_new_node
                                  (type => '#element',
                                   namespace_uri => $NS_XHTML1,
                                   local_name => 'input');
    for ($SUBMIT) {
      $_->set_attribute (type => 'submit');
      $_->set_attribute (name => 'mode');
      __ATTRTEXT:%mode__;
      $_->set_attribute (value => $p->{mode} || 'default');
      __ATTRTEXT:%class__;__ATTRTEXT:%description__;__ATTRTEXT:%accesskey__;
      $_->set_attribute (class => $p->{class}) if $p->{class};
      $_->set_attribute (title => $p->{description}) if $p->{description};
      $_->set_attribute (accesskey => $p->{accesskey}) if defined $p->{accesskey};
      $_->set_attribute (disabled => 'disabled') if $o->{form}->{disabled};
      __ATTRTEXT:%label__;
      $_->set_attribute (value => $p->{label} || $p->{mode} || 'default');
      $_->option (use_EmptyElemTag => 1);
    }
    $o->{form}->{output}->{submit_button} = 0;
    $o->{form}->{output}->{mode_specification} = 0;
