diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a82827c30ee..015adde7eca 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -13,7 +13,7 @@ * Copyright (C) 2014 Cédric GROSS * Copyright (C) 2014-2015 Marcos García * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2018-2021 Frédéric France + * Copyright (C) 2018-2022 Frédéric France * Copyright (C) 2019 Thibault Foucart * Copyright (C) 2020 Open-Dsi * Copyright (C) 2021 Gauthier VERDOL @@ -68,6 +68,17 @@ function getDolGlobalInt($key, $default = 0) return (int) (empty($conf->global->$key) ? $default : $conf->global->$key); } +/** + * Is Dolibarr module enabled + * @param string $module module name to check + * @return int + */ +function isModEnabled($module) +{ + global $conf; + return !empty($conf->$module->enabled); +} + /** * Return a DoliDB instance (database handler). *