- api: You may now use a displayOnly attribute in your asset properties list

that will display a field, but is not settable via the update() method.
 - api: You may now use a customDrawMethod attribute in your asset properties
   list that will enable you to add custom display options for that fields when
   the edit form is automatically generated.
 - Added file attachments to the Wiki.
 - Added a new attachments form control.
 - Added a form control skeleton.
This commit is contained in:
JT Smith 2007-07-25 22:22:49 +00:00
parent 591fd954e3
commit 350d7f6e01
14 changed files with 599 additions and 85 deletions

View file

@ -334,7 +334,7 @@ sub definition {
hoverHelp=>$i18n->get('104 description'),
uiLevel=>3,
fieldType=>'text',
defaultValue=>undef,
defaultValue=>'',
filter=>'fixUrl'
},
isHidden=>{
@ -865,7 +865,16 @@ sub getEditForm {
}
my $tab = $fieldHash{tab} || "properties";
$tabform->getTab($tab)->dynamicField(%params);
# use a custom draw method
my $drawMethod = $properties->{$fieldName}{customDrawMethod};
if ($drawMethod) {
$params{value} = $self->$drawMethod(\%params);
$params{fieldType} = "readOnly";
}
#draw the field
$tabform->getTab($tab)->dynamicField(%params);
}
}
@ -1081,6 +1090,25 @@ sub getRoot {
}
#-------------------------------------------------------------------
=head2 getTempspace ( session )
Constructor. Returns the tempspace folder.
=head3 session
A reference to the current session.
=cut
sub getTempspace {
my $class = shift;
my $session = shift;
return WebGUI::Asset->newByDynamicClass($session, "tempspace0000000000000");
}
#-------------------------------------------------------------------
=head2 getTitle ( )
@ -2025,11 +2053,16 @@ sub update {
# deal with all the properties in this part of the definition
foreach my $property (keys %{$definition->{properties}}) {
# skip a property unless it was specified to be set by the properties field or has a default value
next unless (exists $properties->{$property} || exists $definition->{properties}{$property}{defaultValue});
# skip a property if it has the display only flag set
next if ($properties->{property}{displayOnly});
# use the update value
my $value = $properties->{$property};
# use the current value because the update value was undef
unless (defined $value) {
$value = $self->get($property);