[*] PROJECT - Dynamic hooks in ObjectModel retrieve object in param - Dynamic hooks have been added to AdminController
This commit is contained in:
@@ -466,10 +466,29 @@ class AdminControllerCore extends Controller
|
||||
$this->processFilter();
|
||||
|
||||
if (!empty($this->action) && method_exists($this, 'process'.ucfirst(Tools::toCamelCase($this->action))))
|
||||
return $this->{'process'.Tools::toCamelCase($this->action)}($token);
|
||||
else if (method_exists($this, $this->action))
|
||||
return call_user_func(array($this, $this->action), $this->boxes);
|
||||
{
|
||||
/* Hook Before Action */
|
||||
Hook::exec('action'.get_class($this).ucfirst($this->action).'Before', array('controller' => $this));
|
||||
|
||||
$return = $this->{'process'.Tools::toCamelCase($this->action)}($token);
|
||||
|
||||
/* Hook After Action */
|
||||
Hook::exec('action'.get_class($this).ucfirst($this->action).'After', array('controller' => $this, 'return' => $return));
|
||||
|
||||
return $return;
|
||||
}
|
||||
else if (method_exists($this, $this->action))
|
||||
{
|
||||
/* Hook Before Action */
|
||||
Hook::exec('action'.get_class($this).ucfirst($this->action).'Before', array('controller' => $this));
|
||||
|
||||
$return = call_user_func(array($this, $this->action), $this->boxes);
|
||||
|
||||
/* Hook After Action */
|
||||
Hook::exec('action'.get_class($this).ucfirst($this->action).'After', array('controller' => $this, 'return' => $return));
|
||||
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user