added readOnly option to user form field
This commit is contained in:
parent
d39c2c81d9
commit
590fb186c9
1 changed files with 9 additions and 2 deletions
|
|
@ -57,6 +57,10 @@ The name of the field. Defaults to "userId".
|
|||
|
||||
Defaults to "User".
|
||||
|
||||
=head4 readOnly
|
||||
|
||||
Defaults to 0. Use for displaying a read-only user field.
|
||||
|
||||
=cut
|
||||
|
||||
sub definition {
|
||||
|
|
@ -74,6 +78,9 @@ sub definition {
|
|||
name=>{
|
||||
defaultValue=>"userId",
|
||||
},
|
||||
readOnly=>{
|
||||
defaultValue=>0,
|
||||
},
|
||||
});
|
||||
return $class->SUPER::definition($session, $definition);
|
||||
}
|
||||
|
|
@ -101,10 +108,10 @@ sub toHtml {
|
|||
value=>$user->username,
|
||||
id=>$self->get('id')."_display"
|
||||
)->toHtml
|
||||
.WebGUI::Form::Button->new($self->session,
|
||||
.($self->get('readOnly')?'':WebGUI::Form::Button->new($self->session,
|
||||
value=>"...",
|
||||
extras=>'onclick="window.open(\''.$self->session->url->page("op=formUsers;formId=".$self->get('id')).'\',\'userPicker\',\'toolbar=no, location=no, status=no, directories=no, width=400, height=400\');"'
|
||||
)->toHtml;
|
||||
)->toHtml);
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue