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
|
|
@ -1,7 +1,18 @@
|
|||
insert into webguiVersion values ('4.7.0','upgrade',unix_timestamp());
|
||||
update international set internationalId=728, namespace='WebGUI' where internationalId=12 and namespace='Product';
|
||||
|
||||
|
||||
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (728,1,'WebGUI','UI Level', 1033832377);
|
||||
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (738,1,'WebGUI','9 Guru', 1033836704);
|
||||
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (737,1,'WebGUI','8 Master', 1033836698);
|
||||
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (736,1,'WebGUI','7 Expert', 1033836692);
|
||||
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (735,1,'WebGUI','6 Professional', 1033836686);
|
||||
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (734,1,'WebGUI','5 Adept', 1033836678);
|
||||
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (733,1,'WebGUI','4 Skilled', 1033836668);
|
||||
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (732,1,'WebGUI','3 Rookie', 1033836660);
|
||||
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (731,1,'WebGUI','2 Trained', 1033836651);
|
||||
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (730,1,'WebGUI','1 Novice', 1033836642);
|
||||
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (729,1,'WebGUI','0 Beginner', 1033836631);
|
||||
INSERT INTO userProfileField VALUES ('uiLevel','WebGUI::International::get(728,\"WebGUI\");',0,0,'select','{\r\n0=>WebGUI::International::get(729,\"WebGUI\"),\r\n1=>WebGUI::International::get(730,\"WebGUI\"),\r\n2=>WebGUI::International::get(731,\"WebGUI\"),\r\n3=>WebGUI::International::get(732,\"WebGUI\"),\r\n4=>WebGUI::International::get(733,\"WebGUI\"),\r\n5=>WebGUI::International::get(734,\"WebGUI\"),\r\n6=>WebGUI::International::get(735,\"WebGUI\"),\r\n7=>WebGUI::International::get(736,\"WebGUI\"),\r\n8=>WebGUI::International::get(737,\"WebGUI\"),\r\n9=>WebGUI::International::get(738,\"WebGUI\")\r\n}','[5]',8,4,1);
|
||||
INSERT INTO userProfileData VALUES (3,'uiLevel','9');
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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