Add space to Add/Edit Event in the EMS.

Allow the Navigation Asset to set the MIME type of its output.
Upgrade script, Wobject code, documentation.
Add a new MimeType form element, stolen out of the Snippet and
generalized for use.
This commit is contained in:
Colin Kuskie 2006-02-17 01:23:31 +00:00
parent 3f7bffef88
commit e06331cae9
10 changed files with 175 additions and 16 deletions

View file

@ -0,0 +1,94 @@
package WebGUI::Form::MimeType;
=head1 LEGAL
-------------------------------------------------------------------
WebGUI is Copyright 2001-2006 Plain Black Corporation.
-------------------------------------------------------------------
Please read the legal notices (docs/legal.txt) and the license
(docs/license.txt) that came with this distribution before using
this software.
-------------------------------------------------------------------
http://www.plainblack.com info@plainblack.com
-------------------------------------------------------------------
=cut
use strict;
use base 'WebGUI::Form::Combo';
use WebGUI::International;
=head1 NAME
Package WebGUI::Form::MimeType
=head1 DESCRIPTION
Creates an Mime Type chooser control.
=head1 SEE ALSO
This is a subclass of WebGUI::Form::Combo.
=head1 METHODS
The following methods are specifically available from this class. Check the superclass for additional methods.
=cut
#-------------------------------------------------------------------
=head2 definition ( [ additionalTerms ] )
See the super class for additional details.
=head4 afterEdit
A URL that will be acted upon after editing an LDAP link.
=head4 label
A text label that will be displayed if toHtmlWithWrapper() is called. Defaults to getName().
=cut
sub definition {
my $class = shift;
my $session = shift;
my $definition = shift || [];
my $i18n = WebGUI::International->new($session, 'Form_MimeType');
push(@{$definition}, {
formName=>{
defaultValue=>$i18n->get('mimeType'),
},
label=>{
defaultValue=>$i18n->get('mimeType'),
},
profileEnabled=>{
defaultValue=>0
}
});
return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
=head2 toHtml ( )
Renders a database connection picker control.
=cut
sub toHtml {
my $self = shift;
my $mimeTypes;
foreach ('text/html','text/css','text/javascript','text/plain','text/xml','application/xml') {
$mimeTypes->{$_}=$_;
}
$self->set("options", $mimeTypes);
return $self->SUPER::toHtml();
}
1;