projects
/
fa-stable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Dimension is missing in Supplier Invoice View, GL Rows.
[fa-stable.git]
/
includes
/
hooks.inc
diff --git
a/includes/hooks.inc
b/includes/hooks.inc
index ab2d2bdc6af5b1cb00f193e5fb1158c603f6c6b8..6f15d0b0b7138c7a8f3542b89d4e55144fab7bec 100644
(file)
--- a/
includes/hooks.inc
+++ b/
includes/hooks.inc
@@
-225,9
+225,10
@@
function install_hooks()
$Hooks = array();
// include current language related $Hooks object if locale file exists
$Hooks = array();
// include current language related $Hooks object if locale file exists
- if (file_exists($path_to_root . "/lang/".$_SESSION['language']->code."/locale.inc"))
+ $lang_code = clean_file_name($_SESSION['language']->code);
+ if (file_exists($path_to_root . "/lang/" . $lang_code . "/locale.inc"))
{
{
- include_once($path_to_root . "/lang/"
.$_SESSION['language']->code.
"/locale.inc");
+ include_once($path_to_root . "/lang/"
. $lang_code .
"/locale.inc");
$code = $_SESSION['language']->code;
$hook_class = 'hooks_'.$code;
$Hooks[$code] = new $hook_class;
$code = $_SESSION['language']->code;
$hook_class = 'hooks_'.$code;
$Hooks[$code] = new $hook_class;
@@
-245,7
+246,7
@@
function install_hooks()
Non active hooks are not included in $Hooks array, so we can use special function to
activate.
*/
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;
{
global $Hooks;
@@
-259,8
+260,10
@@
function activate_hooks($ext, $comp)
}
if (!$hooks)
return false;
}
if (!$hooks)
return false;
- else
+ else
if ($on)
return $hooks->activate_extension($comp, false);
return $hooks->activate_extension($comp, false);
+ else
+ return $hooks->deactivate_extension($comp, false);
}
/*
Calls hook $method defined in extension $ext (if any)
}
/*
Calls hook $method defined in extension $ext (if any)