Skip to content

Commit

Permalink
Add delegation to plugin hooks to backend action map.
Browse files Browse the repository at this point in the history
  • Loading branch information
racke committed Sep 15, 2010
1 parent d1d1509 commit dd640ef
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions plugins/backend/code/backend.sub
Expand Up @@ -65,8 +65,24 @@ sub {
}
return 1;
} else {
$Tag->perl({tables => 'categories'});
$CGI->{mv_nextpage} = 'backend/products/list';
# delegate to a plugin?
my (@ret, @path);

@path = @args;
shift @path;

@ret = $Tag->call_hooks({name => 'backend', mode => 'collect', plugins => $args[0],
path => \@path});

if ($ret[0]) {
return 1;
}
else {
$Tag->error({name => 'backend', set => 'No appropriate backend action found.'});
$Tag->perl({tables => 'categories'});
$CGI->{mv_nextpage} = 'backend/products/list';
}

return 1;
}

Expand Down

0 comments on commit dd640ef

Please sign in to comment.