Added UI Level basics to wobjects and preferences.
This commit is contained in:
parent
7bc98eed07
commit
95c08144f0
9 changed files with 64 additions and 9 deletions
|
|
@ -144,13 +144,14 @@ sub _loadWobjects {
|
|||
unless ($@) {
|
||||
$exclude = $session{config}{excludeWobject};
|
||||
$exclude =~ s/ //g;
|
||||
unless (isIn($namespace, split(/,/,$exclude))) {
|
||||
$cmd = "\$WebGUI::Wobject::".$namespace."::name";
|
||||
$session{wobject}{$namespace} = eval($cmd);
|
||||
if ($@) {
|
||||
WebGUI::ErrorHandler::warn("No name method in wobject: $namespace. ".$@);
|
||||
$session{wobject}{$namespace} = "ERROR: ".$namespace;
|
||||
}
|
||||
next if (isIn($namespace, split(/,/,$exclude)));
|
||||
$cmd = "\WebGUI::Wobject::".$namespace."::uiLevel";
|
||||
next if (eval($cmd) > $session{user}{uiLevel});
|
||||
$cmd = "\$WebGUI::Wobject::".$namespace."::name";
|
||||
$session{wobject}{$namespace} = eval($cmd);
|
||||
if ($@) {
|
||||
WebGUI::ErrorHandler::warn("No name method in wobject: $namespace. ".$@);
|
||||
$session{wobject}{$namespace} = "ERROR: ".$namespace;
|
||||
}
|
||||
} else {
|
||||
WebGUI::ErrorHandler::warn("Wobject failed to compile: $namespace. ".$@);
|
||||
|
|
|
|||
|
|
@ -672,6 +672,19 @@ sub setCollateral {
|
|||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 uiLevel
|
||||
|
||||
Returns the UI Level of a wobject. Defaults to "0" for all wobjects.
|
||||
Override to set the UI Level higher for a given wobject.
|
||||
|
||||
=cut
|
||||
|
||||
sub uiLevel {
|
||||
return 0;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_approvePost ( )
|
||||
|
|
|
|||
|
|
@ -89,6 +89,11 @@ sub set {
|
|||
$_[0]->SUPER::set($_[1],[qw(paginateAfter displayThumbnails)]);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub uiLevel {
|
||||
return 4;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_deleteFile {
|
||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
||||
|
|
|
|||
|
|
@ -43,6 +43,11 @@ sub set {
|
|||
$_[0]->SUPER::set($_[1],[qw(spacer width class)]);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub uiLevel {
|
||||
return 1;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_edit {
|
||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
||||
|
|
|
|||
|
|
@ -77,6 +77,11 @@ sub set {
|
|||
$_[0]->SUPER::set($_[1],[@fields]);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub uiLevel {
|
||||
return 5;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_deleteField {
|
||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
||||
|
|
|
|||
|
|
@ -51,6 +51,11 @@ sub set {
|
|||
$_[0]->SUPER::set($_[1],[qw(template dbQuery DSN username identifier convertCarriageReturns paginateAfter preprocessMacros debugMode)]);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub uiLevel {
|
||||
return 9;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_edit {
|
||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
||||
|
|
|
|||
|
|
@ -43,6 +43,11 @@ sub set {
|
|||
$_[0]->SUPER::set($_[1], [qw(rssUrl content lastFetched)]);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub uiLevel {
|
||||
return 6;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_edit {
|
||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
||||
|
|
|
|||
|
|
@ -41,6 +41,11 @@ sub set {
|
|||
$_[0]->SUPER::set($_[1],[qw(proxiedWobjectId)]);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub uiLevel {
|
||||
return 8;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_edit {
|
||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Privilege::canEditPage());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue