various fixes and enhancements for the asset configuration stuff i checked in earlier

This commit is contained in:
JT Smith 2008-09-29 00:14:49 +00:00
parent 79c5425bcf
commit 72edbfd628
7 changed files with 14 additions and 284 deletions

View file

@ -127,12 +127,6 @@ If specified, this will be prepended to the id (whether autogenerated or not) to
The UI Level that the user must meet or exceed if this field should be displayed with toHtmlWithWrapper() is called.
=head4 uiLevelOverride
An identifier that will be grabbed from the config file to determine the uiLevel. If the uiLevelOverride is "Article" and the name is "title" then the entry in the config file would look like:
Article_uiLevel = title => 5
=head4 subtext
A text string that will be appended after the field when toHtmlWithWrapper() is called.
@ -181,9 +175,6 @@ sub definition {
uiLevel=>{
defaultValue=>1
},
uiLevelOverride=>{
defaultValue=>undef
},
labelClass=>{
defaultValue=>"formDescription"
},
@ -576,19 +567,11 @@ Renders the form field to HTML as a table row complete with labels, subtext, hov
sub passUiLevelCheck {
my $self = shift;
my $passUiLevelCheck = 0;
my $override = $self->session->config->get($self->get("uiLevelOverride")."_uiLevel");
if (defined $override && $override->{$self->get("name")}) { # use override if it exists
$passUiLevelCheck = ($override->{$self->get("name")} <= $self->session->user->profileField("uiLevel"));
} else { # use programmed default
$passUiLevelCheck = ($self->get("uiLevel") <= $self->session->user->profileField("uiLevel"));
}
$passUiLevelCheck = $self->session->user->isAdmin unless ($passUiLevelCheck); # override if in admins group
return $passUiLevelCheck;
my $user = $self->session->user;
return $self->get("uiLevel") <= $user->profileField("uiLevel") || $user->isAdmin;
}
#-------------------------------------------------------------------
=head2 prepareWrapper ( )