Fixed deactive_extension hook execution on extension deactivation.
[fa-stable.git] / includes / hooks.inc
index 71717fc154202a4071612a4060bb428b3f371e6b..6f15d0b0b7138c7a8f3542b89d4e55144fab7bec 100644 (file)
@@ -246,7 +246,7 @@ function install_hooks()
        Non active hooks are not included in $Hooks array, so we can use special function to 
        activate.
 */
-function activate_hooks($ext, $comp)
+function activate_hooks($ext, $comp, $on=true)
 {
        global $Hooks;
        
@@ -260,8 +260,10 @@ function activate_hooks($ext, $comp)
        }
        if (!$hooks)
                return false;
-       else
+       elseif ($on)
                return $hooks->activate_extension($comp, false);
+       else
+               return $hooks->deactivate_extension($comp, false);
 }
 /*
        Calls hook $method defined in extension $ext (if any)