- $action_bar = ($::request->layout->get('actionbar'))[0] unless blessed($action_bar);
- $action_bar->add(@actions) if @actions;
+ return @actions;
+}
+
+sub setup_action_bar {
+ my ($self, $variables, %params) = @_;
+
+ my @actions = $self->create_action_bar_actions($variables);
+
+ if ($params{action_bar_setup_hook}) {
+ $params{action_bar_setup_hook}->(@actions);
+
+ } elsif (@actions) {
+ my $action_bar = blessed($params{action_bar}) ? $params{action_bar} : ($::request->layout->get('actionbar'))[0];
+ $action_bar->add(@actions);
+ }