From e9061c50d5b69b21e5fdbe591647d4ffaaa4fcc2 Mon Sep 17 00:00:00 2001 From: leiyong Date: Thu, 17 Aug 2023 05:34:33 +0000 Subject: [PATCH] * Action module built-in hook function. --- module/action/model.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/module/action/model.php b/module/action/model.php index 6c6b98ce05..e3d7b65782 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -90,6 +90,9 @@ class actionModel extends model /* Add index for global search. */ $this->saveIndex($objectType, $objectID, $actionType); + $changeFunc = 'after' . ucfirst($objectType); + if(method_exists($this, $changeFunc)) call_user_func_array(array($this, $changeFunc), array($action, $actionID)); + return $actionID; } @@ -907,6 +910,13 @@ class actionModel extends model } $this->dao->insert(TABLE_HISTORY)->data($change)->exec(); } + + if(isset($this->session->calllbackActionList[$actionID])) + { + $callbackMethod = $this->session->calllbackActionList[$actionID]; + unset($this->session->calllbackActionList[$actionID]); + if(method_exists($this, $callbackMethod)) call_user_func_array(array($this, $callbackMethod), array($actionID)); + } } /**