Skip to content

Commit

Permalink
Avoid hooks naming conflicts and naming consistency
Browse files Browse the repository at this point in the history
Signed-off-by: emanuele <emanuele45@gmail.com>
  • Loading branch information
emanuele45 committed Mar 14, 2014
1 parent 943ca64 commit 692ce07
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sources/Dispatcher.class.php
Expand Up @@ -73,7 +73,7 @@ public function __construct()
);

// Reminder: hooks need to account for multiple addons setting this hook.
call_integration_hook('integrate_frontpage', array(&$default_action));
call_integration_hook('integrate_action_frontpage', array(&$default_action));

// Maintenance mode: you're out of here unless you're admin
if (!empty($maintenance) && !allowedTo('admin_forum'))
Expand Down Expand Up @@ -304,7 +304,7 @@ public function dispatch()

$hook = strtolower(str_replace('_Controller', '', $this->_controller_name));
$hook = substr($hook, -1) == 2 ? substr($hook, 0, -1) : $hook;
call_integration_hook('integrate_' . $hook . '_before', array($this->_function_name));
call_integration_hook('integrate_action_' . $hook . '_before', array($this->_function_name));

// 3, 2, ... and go
if (method_exists($controller, $this->_function_name))
Expand All @@ -321,13 +321,13 @@ public function dispatch()
// Things went pretty bad, huh?
// board index :P
require_once(CONTROLLERDIR . '/BoardIndex.controller.php');
call_integration_hook('integrate_boardindex_before');
call_integration_hook('integrate_action_boardindex_before');
$controller = new BoardIndex_Controller();
$controller->action_boardindex();
call_integration_hook('integrate_boardindex_after');
call_integration_hook('integrate_action_boardindex_after');
}

call_integration_hook('integrate_' . $hook . '_after', array($this->_function_name));
call_integration_hook('integrate_action_' . $hook . '_after', array($this->_function_name));
}
else
{
Expand Down

0 comments on commit 692ce07

Please sign in to comment.