mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 07:04:57 +00:00
pass array passed to __invoke() to hooks preRun and postRun
This commit is contained in:
parent
525eea082c
commit
6421aa94ed
|
@ -54,17 +54,18 @@ class SeedDMS_Controller_Common {
|
|||
* @return mixed return value of called method
|
||||
*/
|
||||
function __invoke($get=array()) {
|
||||
$this->callHook('preRun', isset($get['action']) ? $get['action'] : 'run');
|
||||
if(isset($get['action']) && $get['action']) {
|
||||
if(method_exists($this, $get['action'])) {
|
||||
return $this->{$get['action']}();
|
||||
} else {
|
||||
echo "Missing action '".$get['action']."'";
|
||||
return false;
|
||||
}
|
||||
} else
|
||||
return $this->run();
|
||||
$this->callHook('postRun', isset($get['action']) ? $get['action'] : 'run');
|
||||
if(!$this->callHook('preRun', get_class($this), isset($get['action']) ? $get['action'] : 'run', $get)) {
|
||||
if(isset($get['action']) && $get['action']) {
|
||||
if(method_exists($this, $get['action'])) {
|
||||
return $this->{$get['action']}();
|
||||
} else {
|
||||
echo "Missing action '".$get['action']."'";
|
||||
return false;
|
||||
}
|
||||
} else
|
||||
return $this->run();
|
||||
}
|
||||
$this->callHook('postRun', get_class($this), isset($get['action']) ? $get['action'] : 'run', $get);
|
||||
}
|
||||
|
||||
function setParams($params) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user