fix categories after refactor
This commit is contained in:
parent
12c0732f50
commit
5f7cd09f57
1 changed files with 3 additions and 1 deletions
|
|
@ -102,6 +102,7 @@ asset class. Info will include at least the following keys:
|
||||||
uiLevel => The UI Level of the asset
|
uiLevel => The UI Level of the asset
|
||||||
canAdd => True if the current user can add the asset
|
canAdd => True if the current user can add the asset
|
||||||
url => URL to add the asset
|
url => URL to add the asset
|
||||||
|
category => A string or an arrayref of categories
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -120,6 +121,7 @@ sub getAssetTypes {
|
||||||
next unless defined $dummy;
|
next unless defined $dummy;
|
||||||
|
|
||||||
$assetList{ $class } = {
|
$assetList{ $class } = {
|
||||||
|
( %$assetConfig ),
|
||||||
url => 'func=add;className=' . $class,
|
url => 'func=add;className=' . $class,
|
||||||
icon => $dummy->getIcon(1), # default icon is small for back-compat
|
icon => $dummy->getIcon(1), # default icon is small for back-compat
|
||||||
icon_full => $dummy->getIcon,
|
icon_full => $dummy->getIcon,
|
||||||
|
|
@ -176,7 +178,7 @@ sub getNewContentTemplateVars {
|
||||||
my $assetConfig = $assetList{$assetClass};
|
my $assetConfig = $assetList{$assetClass};
|
||||||
|
|
||||||
next unless $assetConfig->{canAdd};
|
next unless $assetConfig->{canAdd};
|
||||||
next unless $assetConfig->{uiLevel} > $userUiLevel;
|
next unless $assetConfig->{uiLevel} <= $userUiLevel;
|
||||||
|
|
||||||
# Add the asset to all categories it should appear in
|
# Add the asset to all categories it should appear in
|
||||||
my @assetCategories = ref $assetConfig->{category} ? @{ $assetConfig->{category} } : $assetConfig->{category};
|
my @assetCategories = ref $assetConfig->{category} ? @{ $assetConfig->{category} } : $assetConfig->{category};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue