From a3614f521152fae8de6e87cee600ef4c183e4e07 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Tue, 9 Mar 2010 12:58:55 -0800 Subject: [PATCH] Move uiLevel from a define to a property so it can be inherited. --- lib/WebGUI/Asset.pm | 6 +++++- lib/WebGUI/Definition/Meta/Asset.pm | 11 +---------- t/Definition.t | 3 +-- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/lib/WebGUI/Asset.pm b/lib/WebGUI/Asset.pm index 69f1c86b1..1e76ef540 100644 --- a/lib/WebGUI/Asset.pm +++ b/lib/WebGUI/Asset.pm @@ -25,7 +25,6 @@ use WebGUI::Definition::Asset; define assetName => 'asset'; define tableName => 'assetData'; define icon => 'assets.gif'; -define uiLevel => 1; property title => ( tab => "properties", label => ['99','Asset'], @@ -273,6 +272,11 @@ has assetId => ( has revisionDate => ( is => 'rw', ); +has uiLevel => ( + is => 'ro', + default => 1, + init_arg => undef, + ); property revisedBy => ( is => 'rw', noFormPost => 1, diff --git a/lib/WebGUI/Definition/Meta/Asset.pm b/lib/WebGUI/Definition/Meta/Asset.pm index 7e89320c4..3e70971bc 100644 --- a/lib/WebGUI/Definition/Meta/Asset.pm +++ b/lib/WebGUI/Definition/Meta/Asset.pm @@ -57,7 +57,7 @@ has 'property_metaroles' => ( default => sub { [ 'WebGUI::Definition::Meta::Property', 'WebGUI::Definition::Meta::Property::Asset'] }, ); -has [ qw{tableName icon assetName uiLevel} ] => ( +has [ qw{tableName icon assetName} ] => ( is => 'rw', ); @@ -113,13 +113,4 @@ The second is the i18n namespace to find the asset's name. =cut -#------------------------------------------------------------------- - -=head2 uiLevel ( ) - -An integer, representing how difficult the Asset will be to use. The default uiLevel is -1. uiLevels for an asset can be overridden in the config file for each site. - -=cut - 1; diff --git a/t/Definition.t b/t/Definition.t index 842b0a01e..2da54b569 100644 --- a/t/Definition.t +++ b/t/Definition.t @@ -16,7 +16,7 @@ use lib "$FindBin::Bin/lib"; use WebGUI::Test; -use Test::More tests => 15; +use Test::More tests => 16; use Test::Deep; use Test::Exception; @@ -48,7 +48,6 @@ my $session = WebGUI::Test->session; ::can_ok +__PACKAGE__, 'get'; ::can_ok +__PACKAGE__, 'set'; - ::ok +__PACKAGE__->meta->does_role('WebGUI::Definition'); ::ok +__PACKAGE__->meta->does_role('WebGUI::Definition::Role::Object'); ::cmp_deeply(