add helpers in the config file
This commit is contained in:
parent
945d78cb32
commit
a18463a32a
1 changed files with 16 additions and 0 deletions
|
|
@ -1131,6 +1131,8 @@ Get the AssetHelpers for this asset.
|
|||
|
||||
sub getHelpers {
|
||||
my ( $self ) = @_;
|
||||
my $session = $self->session;
|
||||
my ( $conf ) = $session->quick(qw{ config });
|
||||
|
||||
my $default = [
|
||||
{
|
||||
|
|
@ -1171,6 +1173,20 @@ sub getHelpers {
|
|||
},
|
||||
];
|
||||
|
||||
|
||||
# Get additional helpers for this class from config
|
||||
my $confHelpers = $conf->get('assets/' . $self->className . '/helpers');
|
||||
# Merge on label
|
||||
for my $helper ( @$confHelpers ) {
|
||||
WebGUI::Macro::process( \$helper->{label} );
|
||||
if ( my $replace = first { $_->{label} eq $helper->{label} } @$default ) {
|
||||
$replace = $helper; # replace in the default arrayref
|
||||
}
|
||||
else {
|
||||
push @$default, $helper;
|
||||
}
|
||||
}
|
||||
|
||||
return $default;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue