2
0
forked from Wavyzz/dolibarr

use isModEnabled

This commit is contained in:
Frédéric FRANCE
2023-04-18 23:39:02 +02:00
parent b1aee4dda6
commit 77441f2dd2
5 changed files with 14 additions and 14 deletions

View File

@@ -3801,22 +3801,22 @@ function dol_print_address($address, $htmlid, $element, $id, $noprint = 0, $char
// TODO Remove this block, we can add this using the hook now // TODO Remove this block, we can add this using the hook now
$showgmap = $showomap = 0; $showgmap = $showomap = 0;
if (($element == 'thirdparty' || $element == 'societe') && !empty($conf->google->enabled) && !empty($conf->global->GOOGLE_ENABLE_GMAPS)) { if (($element == 'thirdparty' || $element == 'societe') && isModEnabled('google') && !empty($conf->global->GOOGLE_ENABLE_GMAPS)) {
$showgmap = 1; $showgmap = 1;
} }
if ($element == 'contact' && !empty($conf->google->enabled) && !empty($conf->global->GOOGLE_ENABLE_GMAPS_CONTACTS)) { if ($element == 'contact' && isModEnabled('google') && !empty($conf->global->GOOGLE_ENABLE_GMAPS_CONTACTS)) {
$showgmap = 1; $showgmap = 1;
} }
if ($element == 'member' && !empty($conf->google->enabled) && !empty($conf->global->GOOGLE_ENABLE_GMAPS_MEMBERS)) { if ($element == 'member' && isModEnabled('google') && !empty($conf->global->GOOGLE_ENABLE_GMAPS_MEMBERS)) {
$showgmap = 1; $showgmap = 1;
} }
if (($element == 'thirdparty' || $element == 'societe') && !empty($conf->openstreetmap->enabled) && !empty($conf->global->OPENSTREETMAP_ENABLE_MAPS)) { if (($element == 'thirdparty' || $element == 'societe') && isModEnabled('openstreetmap') && !empty($conf->global->OPENSTREETMAP_ENABLE_MAPS)) {
$showomap = 1; $showomap = 1;
} }
if ($element == 'contact' && !empty($conf->openstreetmap->enabled) && !empty($conf->global->OPENSTREETMAP_ENABLE_MAPS_CONTACTS)) { if ($element == 'contact' && isModEnabled('openstreetmap') && !empty($conf->global->OPENSTREETMAP_ENABLE_MAPS_CONTACTS)) {
$showomap = 1; $showomap = 1;
} }
if ($element == 'member' && !empty($conf->openstreetmap->enabled) && !empty($conf->global->OPENSTREETMAP_ENABLE_MAPS_MEMBERS)) { if ($element == 'member' && isModEnabled('openstreetmap') && !empty($conf->global->OPENSTREETMAP_ENABLE_MAPS_MEMBERS)) {
$showomap = 1; $showomap = 1;
} }
if ($showgmap) { if ($showgmap) {
@@ -9779,7 +9779,7 @@ function printCommonFooter($zone = 'private')
// Google Analytics // Google Analytics
// TODO Add a hook here // TODO Add a hook here
if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AN_ID)) { if (isModEnabled('google') && !empty($conf->global->MAIN_GOOGLE_AN_ID)) {
$tmptagarray = explode(',', $conf->global->MAIN_GOOGLE_AN_ID); $tmptagarray = explode(',', $conf->global->MAIN_GOOGLE_AN_ID);
foreach ($tmptagarray as $tmptag) { foreach ($tmptagarray as $tmptag) {
print "\n"; print "\n";

View File

@@ -447,7 +447,7 @@ if (!empty($morelogincontent) && is_array($morelogincontent)) {
// Google Analytics // Google Analytics
// TODO Remove this, and add content into hook getLoginPageExtraOptions() instead // TODO Remove this, and add content into hook getLoginPageExtraOptions() instead
if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AN_ID)) { if (isModEnabled('google') && !empty($conf->global->MAIN_GOOGLE_AN_ID)) {
$tmptagarray = explode(',', $conf->global->MAIN_GOOGLE_AN_ID); $tmptagarray = explode(',', $conf->global->MAIN_GOOGLE_AN_ID);
foreach ($tmptagarray as $tmptag) { foreach ($tmptagarray as $tmptag) {
print "\n"; print "\n";
@@ -468,7 +468,7 @@ if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AN_ID))
// TODO Replace this with a hook // TODO Replace this with a hook
// Google Adsense (need Google module) // Google Adsense (need Google module)
if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && !empty($conf->global->MAIN_GOOGLE_AD_SLOT)) { if (isModEnabled('google') && !empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && !empty($conf->global->MAIN_GOOGLE_AD_SLOT)) {
if (empty($conf->dol_use_jmobile)) { if (empty($conf->dol_use_jmobile)) {
?> ?>
<div class="center"><br> <div class="center"><br>

View File

@@ -287,7 +287,7 @@ if (!empty($morelogincontent) && is_array($morelogincontent)) {
// Google Analytics // Google Analytics
// TODO Remove this, and add content into hook getPasswordForgottenPageExtraOptions() instead // TODO Remove this, and add content into hook getPasswordForgottenPageExtraOptions() instead
if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AN_ID)) { if (isModEnabled('google') && !empty($conf->global->MAIN_GOOGLE_AN_ID)) {
$tmptagarray = explode(',', $conf->global->MAIN_GOOGLE_AN_ID); $tmptagarray = explode(',', $conf->global->MAIN_GOOGLE_AN_ID);
foreach ($tmptagarray as $tmptag) { foreach ($tmptagarray as $tmptag) {
print "\n"; print "\n";
@@ -308,7 +308,7 @@ if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AN_ID))
// TODO Replace this with a hook // TODO Replace this with a hook
// Google Adsense (need Google module) // Google Adsense (need Google module)
if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && !empty($conf->global->MAIN_GOOGLE_AD_SLOT)) { if (isModEnabled('google') && !empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && !empty($conf->global->MAIN_GOOGLE_AD_SLOT)) {
if (empty($conf->dol_use_jmobile)) { if (empty($conf->dol_use_jmobile)) {
?> ?>
<div class="center"><br> <div class="center"><br>

View File

@@ -328,7 +328,7 @@ if (!empty($morelogincontent) && is_array($morelogincontent)) {
// Google Analytics // Google Analytics
// TODO Remove this, and add content into hook getPasswordForgottenPageExtraOptions() instead // TODO Remove this, and add content into hook getPasswordForgottenPageExtraOptions() instead
if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AN_ID)) { if (isModEnabled('google') && !empty($conf->global->MAIN_GOOGLE_AN_ID)) {
$tmptagarray = explode(',', $conf->global->MAIN_GOOGLE_AN_ID); $tmptagarray = explode(',', $conf->global->MAIN_GOOGLE_AN_ID);
foreach ($tmptagarray as $tmptag) { foreach ($tmptagarray as $tmptag) {
print "\n"; print "\n";
@@ -349,7 +349,7 @@ if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AN_ID))
// TODO Replace this with a hook // TODO Replace this with a hook
// Google Adsense (need Google module) // Google Adsense (need Google module)
if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && !empty($conf->global->MAIN_GOOGLE_AD_SLOT)) { if (isModEnabled('google') && !empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && !empty($conf->global->MAIN_GOOGLE_AD_SLOT)) {
if (empty($conf->dol_use_jmobile)) { if (empty($conf->dol_use_jmobile)) {
?> ?>
<div class="center"><br> <div class="center"><br>

View File

@@ -434,7 +434,7 @@ print '<br>';
// TODO Replace this with a hook // TODO Replace this with a hook
// Google Adsense (need Google module) // Google Adsense (need Google module)
if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && !empty($conf->global->MAIN_GOOGLE_AD_SLOT)) { if (isModEnabled('google') && !empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && !empty($conf->global->MAIN_GOOGLE_AD_SLOT)) {
if (empty($conf->dol_use_jmobile)) { if (empty($conf->dol_use_jmobile)) {
print '<div align="center">'."\n"; print '<div align="center">'."\n";
print '<script><!--'."\n"; print '<script><!--'."\n";