Skip to content

Commit

Permalink
Remove the @todo and optimize the gallery_event call for 3 and 4 argu…
Browse files Browse the repository at this point in the history
…ments... context menu events have 4 arguments.
  • Loading branch information
Tim Almdal committed Sep 29, 2009
1 parent 89a67db commit e6f6239
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions modules/gallery/helpers/module.php
Expand Up @@ -294,13 +294,18 @@ static function event($name, &$data=null) {
case 2:
gallery_event::$function($args[0], $args[1]);
break;
case 3:
gallery_event::$function($args[0], $args[1], $args[2]);
break;
case 4: // Context menu events have 4 arguments so lets optimize them
gallery_event::$function($args[0], $args[1], $args[2], $args[3]);
break;
default:
Kohana::log("error", "Number of arguments: " . count($args));
call_user_func_array(array("gallery_event", $function), $args);
}
}

// @todo: consider calling gallery_event first, since for things menus we need it to do some
// setup
foreach (self::$active as $module) {
if ($module->name == "gallery") {
continue;
Expand Down

0 comments on commit e6f6239

Please sign in to comment.