sort dashboard widgets through priority

agranig/1_0_subfix
Gerhard Jungwirth 13 years ago committed by Andreas Granig
parent 8ff5c4e427
commit 8d781eb898

@ -26,7 +26,7 @@ sub instantiate_plugins {
push @instances, $inst;
}
}
return @instances;
return sort {$a->priority > $b->priority} @instances;
}
no Moose;

@ -13,6 +13,12 @@ has 'type' => (
default => 'dashboard_widgets',
);
has 'priority' => (
is => 'ro',
isa => 'Int',
default => 11,
);
around handle => sub {
my ($foo, $self, $c) = @_;

@ -13,6 +13,12 @@ has 'type' => (
default => 'dashboard_widgets',
);
has 'priority' => (
is => 'ro',
isa => 'Int',
default => 12,
);
around handle => sub {
my ($foo, $self, $c) = @_;

@ -13,6 +13,12 @@ has 'type' => (
default => 'dashboard_widgets',
);
has 'priority' => (
is => 'ro',
isa => 'Int',
default => 10,
);
around handle => sub {
my ($foo, $self, $c) = @_;

@ -13,6 +13,12 @@ has 'type' => (
default => 'dashboard_widgets',
);
has 'priority' => (
is => 'ro',
isa => 'Int',
default => 1,
);
around handle => sub {
my ($foo, $self, $c) = @_;

@ -13,6 +13,12 @@ has 'type' => (
default => 'dashboard_widgets',
);
has 'priority' => (
is => 'ro',
isa => 'Int',
default => 100,
);
around handle => sub {
my ($foo, $self, $c) = @_;

Loading…
Cancel
Save