Colin: adding avatar to collaboration systems and refactoring some user profile stuff. Added photo and avatar fields to user profile.

This commit is contained in:
Colin Kuskie 2005-11-13 18:42:08 +00:00
parent 852ba1ba15
commit e75988cd1f
37 changed files with 1000 additions and 279 deletions

View file

@ -61,6 +61,10 @@ An array reference of the items to be checked if no value is specified. Defaults
Boolean representing whether the checklist should be represented vertically or horizontally. If set to "1" will be displayed vertically. Defaults to "0".
=head4 profileEnabled
Flag that tells the User Profile system that this is a valid form element in a User Profile
=cut
sub definition {
@ -75,12 +79,28 @@ sub definition {
},
vertical=>{
defaultValue=>0
},
profileEnabled=>{
defaultValue=>1
}
});
return $class->SUPER::definition($definition);
}
#-------------------------------------------------------------------
=head2 displayValue ( )
Return the all options
=cut
sub displayValue {
my ($self) = @_;
return join ", ", @{ $self->{value} };
}
#-------------------------------------------------------------------
=head2 getName ()

View file

@ -55,6 +55,10 @@ Defaults to "0". Set to "1" if this field should be checked.
The value returned by this field if it is checked and no value is specified. Defaults to "1".
=head4 profileEnabled
Flag that tells the User Profile system that this is a valid form element in a User Profile
=cut
sub definition {
@ -65,6 +69,9 @@ sub definition {
defaultValue=> 0
},
defaultValue=>{
defaultValue=>1
},
profileEnabled=>{
defaultValue=>1
}
});

View file

@ -39,6 +39,33 @@ The following methods are specifically available from this class. Check the supe
=cut
#-------------------------------------------------------------------
=head2 definition ( [ additionalTerms ] )
See the super class for additional details.
=head3 additionalTerms
The following additional parameters have been added via this sub class.
=head4 profileEnabled
Flag that tells the User Profile system that this is a valid form element in a User Profile
=cut
sub definition {
my $class = shift;
my $definition = shift || [];
push(@{$definition}, {
profileEnabled=>{
defaultValue=>1
}
});
return $class->SUPER::definition($definition);
}
#-------------------------------------------------------------------
=head2 getName ()

View file

@ -39,6 +39,33 @@ The following methods are specifically available from this class. Check the supe
=cut
#-------------------------------------------------------------------
=head2 definition ( [ additionalTerms ] )
See the super class for additional details.
=head3 additionalTerms
The following additional parameters have been added via this sub class.
=head4 profileEnabled
Flag that tells the User Profile system that this is a valid form element in a User Profile
=cut
sub definition {
my $class = shift;
my $definition = shift || [];
push(@{$definition}, {
profileEnabled=>{
defaultValue=>1
}
});
return $class->SUPER::definition($definition);
}
#-------------------------------------------------------------------
=head2 getName ()

View file

@ -17,6 +17,7 @@ package WebGUI::Form::Control;
use strict;
use WebGUI::Grouping;
use WebGUI::Session;
use WebGUI::Operation::Shared;
=head1 NAME
@ -133,6 +134,10 @@ A stylesheet class assigned to each label/field pair.
A text string that will pop up when the user hovers over the label when toHtmlWithWrapper() is called. This string should indicate how to use the field and is usually tied into the help system.
=head4 profileEnabled
Flag that tells the User Profile system that this is a valid form element in a User Profile
=cut
sub definition {
@ -183,13 +188,66 @@ sub definition {
},
idPrefix=>{
defaultValue=>undef
}
},
profileEnabled=>{
defaultValue=>0
},
});
return $definition;
}
#-------------------------------------------------------------------
=head2 displayForm ( )
This utility method is used to format values for the Profile system but can
be used in other areas as well. Most form elements will just return toHtml.
=cut
sub displayForm {
my ($self) = @_;
$self->toHtml;
}
#-------------------------------------------------------------------
=head2 displayFormWithWrapper ( )
This utility method is used to format values for the Profile system but can
be used in other areas as well. Most form elements will just return displayForm.
=cut
sub displayFormWithWrapper {
my $self = shift;
if ($self->passUiLevelCheck) {
my ($fieldClass, $rowClass, $labelClass, $hoverHelp, $subtext) = $self->prepareWrapper;
return '<tr'.$rowClass.'>
<td'.$labelClass.$hoverHelp.' valign="top" style="width: 25%;">'.$self->{label}.'</td>
<td valign="top"'.$fieldClass.' style="width: 75%;">'.$self->displayForm().$subtext."</td>
</tr>\n";
} else {
return $self->toHtmlAsHidden;
}
}
#-------------------------------------------------------------------
=head2 displayValue ( )
This utility method is used to format values for the Profile system. Most
form elements will just return their value.
=cut
sub displayValue {
my ($self) = @_;
return $self->{value};
}
#-------------------------------------------------------------------
=head2 generateIdParameter ( name )
A class method that returns a value to be used as the autogenerated ID for this field instance. Unless overriden, it simply returns the name with "_formId" appended to it.
@ -375,6 +433,40 @@ sub new {
$params{id} = $params{idPrefix}.$params{id};
bless \%params, $class;
}
#-------------------------------------------------------------------
=head2 prepareWrapper ( )
Common code for preparing wrappers for *WithWrapper
=cut
sub prepareWrapper {
my $self = shift;
my $rowClass = $self->{rowClass};
$rowClass = qq| class="$rowClass" | if($self->{rowClass});
my $labelClass = $self->{labelClass};
$labelClass = qq| class="$labelClass" | if($self->{labelClass});
my $fieldClass = $self->{fieldClass};
$fieldClass = qq| class="$fieldClass" | if($self->{fieldClass});
my $hoverHelp = $self->{hoverHelp};
$hoverHelp =~ s/\r/ /g;
$hoverHelp =~ s/\n/ /g;
$hoverHelp =~ s/&amp;/& amp;/g;
$hoverHelp =~ s/&gt;/& gt;/g;
$hoverHelp =~ s/&lt;/& lt;/g;
$hoverHelp =~ s/&/&amp;/g;
$hoverHelp =~ s/>/&gt;/g;
$hoverHelp =~ s/</&lt;/g;
$hoverHelp =~ s/"/&quot;/g;
$hoverHelp =~ s/'/\\'/g;
$hoverHelp =~ s/^\s+//;
$hoverHelp = qq| onmouseover="return escape('$hoverHelp')"| if ($hoverHelp);
my $subtext = $self->{subtext};
$subtext = qq| <span class="formSubtext">$subtext</span>| if ($subtext);
return ($fieldClass, $rowClass, $labelClass, $hoverHelp, $subtext);
}
#-------------------------------------------------------------------
@ -412,35 +504,8 @@ Renders the form field to HTML as a table row complete with labels, subtext, hov
sub toHtmlWithWrapper {
my $self = shift;
my $passUiLevelCheck = 0;
if ($session{config}{$self->{uiLevelOverride}."_uiLevel"}{$self->{name}}) { # use override if it exists
$passUiLevelCheck = ($session{config}{$self->{uiLevelOverride}."_uiLevel"}{$self->{name}} <= $session{user}{uiLevel});
} else { # use programmed default
$passUiLevelCheck = ($self->{uiLevel} <= $session{user}{uiLevel});
}
$passUiLevelCheck = WebGUI::Grouping::isInGroup(3) unless ($passUiLevelCheck); # override if in admins group
if ($passUiLevelCheck) {
my $rowClass = $self->{rowClass};
$rowClass = qq| class="$rowClass" | if($self->{rowClass});
my $labelClass = $self->{labelClass};
$labelClass = qq| class="$labelClass" | if($self->{labelClass});
my $fieldClass = $self->{fieldClass};
$fieldClass = qq| class="$fieldClass" | if($self->{fieldClass});
my $hoverHelp = $self->{hoverHelp};
$hoverHelp =~ s/\r/ /g;
$hoverHelp =~ s/\n/ /g;
$hoverHelp =~ s/&amp;/& amp;/g;
$hoverHelp =~ s/&gt;/& gt;/g;
$hoverHelp =~ s/&lt;/& lt;/g;
$hoverHelp =~ s/&/&amp;/g;
$hoverHelp =~ s/>/&gt;/g;
$hoverHelp =~ s/</&lt;/g;
$hoverHelp =~ s/"/&quot;/g;
$hoverHelp =~ s/'/\\'/g;
$hoverHelp =~ s/^\s+//;
$hoverHelp = qq| onmouseover="return escape('$hoverHelp')"| if ($hoverHelp);
my $subtext = $self->{subtext};
$subtext = qq| <span class="formSubtext">$subtext</span>| if ($subtext);
if ($self->passUiLevelCheck) {
my ($fieldClass, $rowClass, $labelClass, $hoverHelp, $subtext) = $self->prepareWrapper;
return '<tr'.$rowClass.'>
<td'.$labelClass.$hoverHelp.' valign="top" style="width: 25%;">'.$self->{label}.'</td>
<td valign="top"'.$fieldClass.' style="width: 75%;">'.$self->toHtml().$subtext."</td>
@ -450,5 +515,27 @@ sub toHtmlWithWrapper {
}
}
#-------------------------------------------------------------------
=head2 passUiLevelCheck ( )
Renders the form field to HTML as a table row complete with labels, subtext, hoverhelp, etc.
=cut
sub passUiLevelCheck {
my $self = shift;
my $passUiLevelCheck = 0;
if ($session{config}{$self->{uiLevelOverride}."_uiLevel"}{$self->{name}}) { # use override if it exists
$passUiLevelCheck = ($session{config}{$self->{uiLevelOverride}."_uiLevel"}{$self->{name}} <= $session{user}{uiLevel});
} else { # use programmed default
$passUiLevelCheck = ($self->{uiLevel} <= $session{user}{uiLevel});
}
$passUiLevelCheck = WebGUI::Grouping::isInGroup(3) unless ($passUiLevelCheck); # override if in admins group
return $passUiLevelCheck;
}
1;

View file

@ -67,6 +67,10 @@ A default date is placed in the value field. Set this to "1" to leave it empty.
If no value is specified, this will be used. Defaults to today and now.
=head4 profileEnabled
Flag that tells the User Profile system that this is a valid form element in a User Profile
=cut
sub definition {
@ -84,13 +88,29 @@ sub definition {
},
noDate=>{
defaultValue=>0
}
},
profileEnabled=>{
defaultValue=>1
},
});
return $class->SUPER::definition($definition);
}
#-------------------------------------------------------------------
=head2 displayValue ( )
Return the date in a human readable format for the Profile system.
=cut
sub displayValue {
my ($self) = @_;
return WebGUI::DateTime::epochToHuman($self->{value},"%z");
}
#-------------------------------------------------------------------
=head2 getName ()
Returns the human readable name or type of this form control.

View file

@ -58,6 +58,10 @@ Defaults to 19. Determines the maximum number of characters allowed in this fiel
Defaults to 19. The displayed size of the box for the date to be typed in.
=head4 profileEnabled
Flag that tells the User Profile system that this is a valid form element in a User Profile
=head4 defaultValue
If no value is specified, this will be used. Defaults to today and now.
@ -76,7 +80,10 @@ sub definition {
},
size=>{
defaultValue=> 19
}
},
profileEnabled=>{
defaultValue=>1
},
});
return $class->SUPER::definition($definition);
}

View file

@ -40,6 +40,33 @@ The following methods are specifically available from this class. Check the supe
#-------------------------------------------------------------------
=head2 definition ( [ additionalTerms ] )
See the super class for additional details.
=head3 additionalTerms
The following additional parameters have been added via this sub class.
=head4 profileEnabled
Flag that tells the User Profile system that this is a valid form element in a User Profile
=cut
sub definition {
my $class = shift;
my $definition = shift || [];
push(@{$definition}, {
profileEnabled=>{
defaultValue=>1
}
});
return $class->SUPER::definition($definition);
}
#-------------------------------------------------------------------
=head2 getName ()
Returns the human readable name or type of this form control.

View file

@ -57,6 +57,10 @@ If no name is specified a default name of "file" will be used.
Defaults to 1. Determines how many files the user can upload with this form control.
=head4 profileEnabled
Flag that tells the User Profile system that this is a valid form element in a User Profile
=cut
sub definition {
@ -68,11 +72,61 @@ sub definition {
},
maxAttachments=>{
defaultValue=>1
}
},
profileEnabled=>{
defaultValue=>1
},
});
return $class->SUPER::definition($definition);
}
#-------------------------------------------------------------------
=head2 displayForm ( )
If an image is uploaded, then return the image and a control to
delete it. Otherwise, display a form element to upload a file.
=cut
sub displayForm {
my ($self) = @_;
return $self->toHtml unless $self->{value};
##There are files inside here, for each one, display the image
##and another form control for deleting it.
my $location = WebGUI::Storage->get($self->{value});
my $id = $location->getId;
my $fileForm = '';
foreach my $file ( @{ $location->getFiles } ) {
$fileForm .= sprintf qq!<img src="%s" /><br />!, $location->getUrl($file);
my $action = join '_', '_', $self->{name}, 'delete';
$fileForm .= WebGUI::International::get(392)
. "&nbsp"x4
. WebGUI::Form::YesNo->new({-name=>$action, -value=>0})->toHtml;
}
my $hid = $self->toHtmlAsHidden();
$fileForm .= $hid;
return $fileForm;
}
#-------------------------------------------------------------------
=head2 displayValue ( )
This utility method is used to format values for the Profile system. Most
form elements will just return their value.
=cut
sub displayValue {
my ($self) = @_;
return '' unless $self->{value};
my $location = WebGUI::Storage->get($self->{value});
local $_;
my @files = map { sprintf qq!<img src="%s" />&nbsp;%s!, $location->getFileIconUrl($_), $_; } @{ $location->getFiles };
my $fileValue = join "<br />\n", @files;
return $fileValue;
}
#-------------------------------------------------------------------
@ -92,20 +146,37 @@ sub getName {
=head2 getValueFromPost ( )
Returns the storageId for the storage location that the file(s) got uploaded to. Returns undef if no files were uploaded.
Returns the storageId for the storage location that the file(s) got
uploaded to. Returns undef if no files were uploaded. Also handles
deleting the file if it was specified.
=cut
sub getValueFromPost {
my $self = shift;
my $storage = WebGUI::Storage->create;
$storage->addFileFromFormPost($self->{name});
my @files = @{ $storage->getFiles };
if (scalar(@files) < 1) {
my $value = $session{req}->param($self->{name});
if ($session{req}->param(join '_', '_', $self->{name}, 'delete')) {
my $storage = WebGUI::Storage->get($value);
$storage->delete;
return undef;
} else {
return $storage->getId;
return '';
}
else {
my $storage;
if ($value) {
$storage = WebGUI::Storage::Image->get($value);
}
else {
$storage = WebGUI::Storage::Image->create;
}
$storage->addFileFromFormPost($self->{name});
my @files = @{ $storage->getFiles };
if (scalar(@files) < 1) {
$storage->delete;
return undef;
} else {
my $id = $storage->getId;
return $id;
}
}
}
@ -139,18 +210,5 @@ sub toHtml {
return $uploadControl;
}
#-------------------------------------------------------------------
=head4 toHtmlAsHidden ( )
Returns undef.
=cut
sub toHtmlAsHidden {
return undef;
}
1;

View file

@ -60,6 +60,10 @@ Defaults to 0. Used if no value is specified.
Defaults to 11. The number of characters that will be displayed at once in this field. Usually no need to override the default.
=head4 profileEnabled
Flag that tells the User Profile system that this is a valid form element in a User Profile
=cut
sub definition {
@ -74,7 +78,10 @@ sub definition {
},
size=>{
defaultValue=>11
}
},
profileEnabled=>{
defaultValue=>1
},
});
return $class->SUPER::definition($definition);
}

View file

@ -72,6 +72,10 @@ This will be used if no value is specified. Should be passed as an array referen
A text label that will be displayed if toHtmlWithWrapper() is called. Defaults to getName().
=head4 profileEnabled
Flag that tells the User Profile system that this is a valid form element in a User Profile
=cut
sub definition {
@ -92,7 +96,10 @@ sub definition {
},
excludeGroups=>{
defaultValue=>[]
}
},
profileEnabled=>{
defaultValue=>1
},
});
return $class->SUPER::definition($definition);
}

View file

@ -63,6 +63,10 @@ The number of columns (in characters) wide the box should be. Defaults to the se
The ID of the WebGUI::Asset::RichEdit object to load. Defaults to the richEditor setting or "PBrichedit000000000001" if that's not set.
=head4 profileEnabled
Flag that tells the User Profile system that this is a valid form element in a User Profile
=cut
sub definition {
@ -77,7 +81,10 @@ sub definition {
},
richEditId=>{
defaultValue=>$session{setting}{richEditor} || "PBrichedit000000000001"
}
},
profileEnabled=>{
defaultValue=>1
},
});
return $class->SUPER::definition($definition);
}

View file

@ -39,6 +39,33 @@ The following methods are specifically available from this class. Check the supe
#-------------------------------------------------------------------
=head2 definition ( [ additionalTerms ] )
See the super class for additional details.
=head3 additionalTerms
The following additional parameters have been added via this sub class.
=head4 profileEnabled
Flag that tells the User Profile system that this is a valid form element in a User Profile
=cut
sub definition {
my $class = shift;
my $definition = shift || [];
push(@{$definition}, {
profileEnabled=>{
defaultValue=>1
}
});
return $class->SUPER::definition($definition);
}
#-------------------------------------------------------------------
=head2 generateIdParameter ( )
A class method that returns a value to be used as the autogenerated ID for this field instance. Returns undef because this field type can have more than one with the same name, therefore autogenerated ID's aren't terribly useful.

View file

@ -55,6 +55,10 @@ A hash reference containing name value pairs. The name of each pair will be used
value and defaultValue are array referneces containing the names from the options list that should be stored.
=head4 profileEnabled
Flag that tells the User Profile system that this is a valid form element in a User Profile
=cut
sub definition {
@ -66,7 +70,10 @@ sub definition {
},
defaultValue=>{
defaultValue=>[]
}
},
profileEnabled=>{
defaultValue=>1
},
});
return $class->SUPER::definition($definition);
}

120
lib/WebGUI/Form/Image.pm Normal file
View file

@ -0,0 +1,120 @@
package WebGUI::Form::Image;
=head1 LEGAL
-------------------------------------------------------------------
WebGUI is Copyright 2001-2005 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::File';
use WebGUI::International;
use WebGUI::Session;
use WebGUI::Storage;
use WebGUI::Style;
use WebGUI::Form::YesNo;
use WebGUI::Session;
=head1 NAME
Package WebGUI::Form::Image
=head1 DESCRIPTION
Creates a text input box form field.
=head1 SEE ALSO
This is a subclass of WebGUI::Form::File, and thereform WebGUI::Form::Image.
=head1 METHODS
The following methods are specifically available from this class. Check the superclasses for additional methods.
=cut
#-------------------------------------------------------------------
=head2 definition ( [ additionalTerms ] )
See the super class for additional details.
=head3 additionalTerms
The following additional parameters have been added via this sub class.
=head4 name
If no name is specified a default name of "file" will be used.
=head4 maxAttachments
Defaults to 1. Determines how many files the user can upload with this form control.
=head4 profileEnabled
Flag that tells the User Profile system that this is a valid form element in a User Profile
=cut
sub definition {
my $class = shift;
my $definition = shift || [];
push(@{$definition}, {
name=>{
defaultValue=>"file"
},
maxAttachments=>{
defaultValue=>1
},
profileEnabled=>{
defaultValue=>1
},
});
return $class->SUPER::definition($definition);
}
#-------------------------------------------------------------------
=head2 displayValue ( )
This utility method is used to format values for the Profile system. It
displays each image in the storage location that is the value of the
profile field.
=cut
sub displayValue {
my ($self) = @_;
return '' unless $self->{value};
my $location = WebGUI::Storage->get($self->{value});
local $_;
my @files = map { sprintf qq!<img src="%s" />!, $location->getUrl($_) } @{ $location->getFiles };
my $fileValue = join "<br />\n", @files;
return $fileValue;
}
#-------------------------------------------------------------------
=head2 getName ()
Returns the human readable name or type of this form control.
=cut
sub getName {
return WebGUI::International::get("image","WebGUI");
}
1;

View file

@ -60,6 +60,10 @@ Defaults to 0. Used if no value is specified.
Defaults to 11. The number of characters that will be displayed at once in this field. Usually no need to override the default.
=head4 profileEnabled
Flag that tells the User Profile system that this is a valid form element in a User Profile
=cut
sub definition {
@ -74,7 +78,10 @@ sub definition {
},
size=>{
defaultValue=>11
}
},
profileEnabled=>{
defaultValue=>1
},
});
return $class->SUPER::definition($definition);
}

View file

@ -57,6 +57,10 @@ The following additional parameters have been added via this sub class.
A time interval in seconds that is used if value is not specified. Defaults to 1.
=head4 profileEnabled
Flag that tells the User Profile system that this is a valid form element in a User Profile
=cut
sub definition {
@ -65,7 +69,10 @@ sub definition {
push(@{$definition}, {
defaultValue=>{
defaultValue=>1,
}
},
profileEnabled=>{
defaultValue=>1
},
});
return $class->SUPER::definition($definition);
}

View file

@ -55,6 +55,10 @@ Defaults to 35. Determines the maximum number of characters allowed in this fiel
Defaults to 30. Specifies how big of a text box to display.
=head4 profileEnabled
Flag that tells the User Profile system that this is a valid form element in a User Profile
=cut
sub definition {
@ -66,7 +70,10 @@ sub definition {
},
size=>{
defaultValue=>30
}
},
profileEnabled=>{
defaultValue=>1
},
});
return $class->SUPER::definition($definition);
}

View file

@ -40,6 +40,33 @@ The following methods are specifically available from this class. Check the supe
#-------------------------------------------------------------------
=head2 definition ( [ additionalTerms ] )
See the super class for additional details.
=head3 additionalTerms
The following additional parameters have been added via this sub class.
=head4 profileEnabled
Flag that tells the User Profile system that this is a valid form element in a User Profile
=cut
sub definition {
my $class = shift;
my $definition = shift || [];
push(@{$definition}, {
profileEnabled=>{
defaultValue=>1
}
});
return $class->SUPER::definition($definition);
}
#-------------------------------------------------------------------
=head2 getName ()
Returns the human readable name or type of this form control.

View file

@ -51,6 +51,10 @@ The following additional parameters have been added via this sub class.
Defaults to "0". Set to "1" if this field should be checked.
=head4 profileEnabled
Flag that tells the User Profile system that this is a valid form element in a User Profile
=cut
sub definition {
@ -59,7 +63,10 @@ sub definition {
push(@{$definition}, {
checked=>{
defaultValue=> 0
}
},
profileEnabled=>{
defaultValue=>1
},
});
return $class->SUPER::definition($definition);
}

View file

@ -56,6 +56,10 @@ A hash reference containing key values that will be returned with the form post
Boolean representing whether the checklist should be represented vertically or horizontally. If set to "1" will be displayed vertically. Defaults to "0".
=head4 profileEnabled
Flag that tells the User Profile system that this is a valid form element in a User Profile
=cut
sub definition {
@ -67,12 +71,28 @@ sub definition {
},
vertical=>{
defaultValue=>0
}
},
profileEnabled=>{
defaultValue=>1
},
});
return $class->SUPER::definition($definition);
}
#-------------------------------------------------------------------
=head2 displayValue ( )
Return the all options
=cut
sub displayValue {
my ($self) = @_;
return join ", ", @{ $self->{value} };
}
#-------------------------------------------------------------------
=head2 getName ()

View file

@ -38,6 +38,33 @@ The following methods are specifically available from this class. Check the supe
=cut
#-------------------------------------------------------------------
=head2 definition ( [ additionalTerms ] )
See the super class for additional details.
=head3 additionalTerms
The following additional parameters have been added via this sub class.
=head4 profileEnabled
Flag that tells the User Profile system that this is a valid form element in a User Profile
=cut
sub definition {
my $class = shift;
my $definition = shift || [];
push(@{$definition}, {
profileEnabled=>{
defaultValue=>1
}
});
return $class->SUPER::definition($definition);
}
#-------------------------------------------------------------------
=head2 getName ()

View file

@ -68,6 +68,10 @@ Boolean indicating whether the user can select multiple items from this list lik
A boolean value for whether or not the values in the options hash should be sorted. Defaults to "0".
=head4 profileEnabled
Flag that tells the User Profile system that this is a valid form element in a User Profile
=cut
sub definition {
@ -88,12 +92,28 @@ sub definition {
},
size=>{
defaultValue=>1
}
},
profileEnabled=>{
defaultValue=>1
},
});
return $class->SUPER::definition($definition);
}
#-------------------------------------------------------------------
=head2 displayValue ( )
Return the all options
=cut
sub displayValue {
my ($self) = @_;
return join ", ", @{ $self->{value} };
}
#-------------------------------------------------------------------
=head2 getName ()

View file

@ -55,6 +55,10 @@ Defaults to 255. Determines the maximum number of characters allowed in this fie
Defaults to the setting textBoxSize or 30 if that's not set. Specifies how big of a text box to display.
=head4 profileEnabled
Flag that tells the User Profile system that this is a valid form element in a User Profile
=cut
sub definition {
@ -66,7 +70,10 @@ sub definition {
},
size=>{
defaultValue=>$session{setting}{textBoxSize} || 30
}
},
profileEnabled=>{
defaultValue=>1
},
});
return $class->SUPER::definition($definition);
}

View file

@ -59,6 +59,10 @@ The number of columns (in characters) wide the box should be. Defaults to the se
The style of wrapping this form should use. Defaults to "virtual". Other possible values are "off" and "physical".
=head4 profileEnabled
Flag that tells the User Profile system that this is a valid form element in a User Profile
=cut
sub definition {
@ -73,7 +77,10 @@ sub definition {
},
wrap=>{
defaultValue=>"virtual"
}
},
profileEnabled=>{
defaultValue=>1
},
});
return $class->SUPER::definition($definition);
}

View file

@ -59,6 +59,10 @@ Defaults to 8. Determines the maximum number of characters allowed in this field
Default to 8. Determines how many characters wide the field wlll be.
=head4 profileEnabled
Flag that tells the User Profile system that this is a valid form element in a User Profile
=cut
sub definition {
@ -70,7 +74,10 @@ sub definition {
},
size=>{
defaultValue=>8
}
},
profileEnabled=>{
defaultValue=>1
},
});
return $class->SUPER::definition($definition);
}

View file

@ -52,6 +52,10 @@ The following additional parameters have been added via this sub class.
Defaults to 2048. Determines the maximum number of characters allowed in this field.
=head4 profileEnabled
Flag that tells the User Profile system that this is a valid form element in a User Profile
=cut
sub definition {
@ -60,7 +64,10 @@ sub definition {
push(@{$definition}, {
maxlength=>{
defaultValue=> 2048
}
},
profileEnabled=>{
defaultValue=>1
},
});
return $class->SUPER::definition($definition);
}

View file

@ -52,6 +52,10 @@ The following additional parameters have been added via this sub class.
Can be a 1 or 0. Defaults to 0 if no value is specified.
=head4 profileEnabled
Flag that tells the User Profile system that this is a valid form element in a User Profile
=cut
sub definition {
@ -60,7 +64,10 @@ sub definition {
push(@{$definition}, {
defaultValue=>{
defaultValue=>0
}
},
profileEnabled=>{
defaultValue=>1
},
});
return $class->SUPER::definition($definition);
}

View file

@ -52,6 +52,10 @@ The following additional parameters have been added via this sub class.
Defaults to 10. Determines the maximum number of characters allowed in this field.
=head4 profileEnabled
Flag that tells the User Profile system that this is a valid form element in a User Profile
=cut
sub definition {
@ -60,7 +64,10 @@ sub definition {
push(@{$definition}, {
maxlength=>{
defaultValue=> 10
}
},
profileEnabled=>{
defaultValue=>1
},
});
return $class->SUPER::definition($definition);
}