// Remove unused dynamic method call in AdminController
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@13020 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -489,43 +489,20 @@ class AdminControllerCore extends Controller
|
|||||||
if ($this->filter)
|
if ($this->filter)
|
||||||
$this->processFilter();
|
$this->processFilter();
|
||||||
|
|
||||||
|
// If the method named after the action exists, call "before" hooks, then call action method, then call "after" hooks
|
||||||
// Methods tests
|
if (!empty($this->action) && method_exists($this, 'process'.ucfirst(Tools::toCamelCase($this->action))))
|
||||||
$case1 = false;
|
|
||||||
$case2 = false;
|
|
||||||
if (!empty($this->action))
|
|
||||||
{
|
{
|
||||||
$case1 = method_exists($this, 'process'.ucfirst(Tools::toCamelCase($this->action)));
|
// Hook before action
|
||||||
$case2 = method_exists($this, $this->action);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Hook before action
|
|
||||||
if ($case1 || $case2)
|
|
||||||
{
|
|
||||||
/* Hook Before Action */
|
|
||||||
Hook::exec('actionAdmin'.ucfirst($this->action).'Before', array('controller' => $this));
|
Hook::exec('actionAdmin'.ucfirst($this->action).'Before', array('controller' => $this));
|
||||||
Hook::exec('action'.get_class($this).ucfirst($this->action).'Before', array('controller' => $this));
|
Hook::exec('action'.get_class($this).ucfirst($this->action).'Before', array('controller' => $this));
|
||||||
}
|
// Call process
|
||||||
|
|
||||||
|
|
||||||
// Call process
|
|
||||||
if ($case1)
|
|
||||||
$return = $this->{'process'.Tools::toCamelCase($this->action)}($token);
|
$return = $this->{'process'.Tools::toCamelCase($this->action)}($token);
|
||||||
else if ($case2)
|
// Hook After Action
|
||||||
$return = $this->{$this->action}($this->boxes);
|
|
||||||
|
|
||||||
|
|
||||||
// Hook after action
|
|
||||||
if ($case1 || $case2)
|
|
||||||
{
|
|
||||||
/* Hook After Action */
|
|
||||||
Hook::exec('actionAdmin'.ucfirst($this->action).'After', array('controller' => $this, 'return' => $return));
|
Hook::exec('actionAdmin'.ucfirst($this->action).'After', array('controller' => $this, 'return' => $return));
|
||||||
Hook::exec('action'.get_class($this).ucfirst($this->action).'After', array('controller' => $this, 'return' => $return));
|
Hook::exec('action'.get_class($this).ucfirst($this->action).'After', array('controller' => $this, 'return' => $return));
|
||||||
|
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user