-// elseif (x($a->theme_info,"extends") && file_exists("view/theme/".$a->theme_info["extends"]."/theme.php")) {
-// require_once("view/theme/".$a->theme_info["extends"]."/theme.php");
-// if(function_exists(str_replace('-','_',$a->theme_info["extends"]) . '_init')) {
-// $func = str_replace('-','_',$a->theme_info["extends"]) . '_init';
-// $func($a);
-// }
-// }
-
- if(($_SERVER['REQUEST_METHOD'] === 'POST') && (! $a->error)
- && (function_exists($a->module . '_post'))
- && (! x($_POST,'auth-params'))) {
- call_hooks($a->module . '_mod_post', $_POST);
- $func = $a->module . '_post';
- $func($a);
+
+ if (! $a->error && $_SERVER['REQUEST_METHOD'] === 'POST') {
+ Addon::callHooks($a->module . '_mod_post', $_POST);
+ if ($a->module_class) {
+ call_user_func([$a->module_class, 'post']);
+ } else if (function_exists($a->module . '_post')) {
+ $func = $a->module . '_post';
+ $func($a);
+ }