From 3ecff7b4db9099aa2f5784ed16ec9e7024a05d82 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Dec 2011 18:31:39 +0100 Subject: [PATCH] Fix: Avoid warning messages with some modules --- htdocs/core/lib/functions.lib.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a57e4748518..5f1c193719e 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4283,7 +4283,8 @@ function picto_from_langcode($codelang) } /** - * Complete or removed entries into a head array (used to build tabs) with value added by external modules + * Complete or removed entries into a head array (used to build tabs) with value added by external modules. + * Such values are declared into $conf->tabs_modules. * * @param Conf $conf Object conf * @param Translate $langs Object langs @@ -4313,12 +4314,13 @@ function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode= foreach ($conf->tabs_modules[$type] as $value) { $values=explode(':',$value); - + if ($mode == 'add' && ! preg_match('/^\-/',$values[1])) { - if (count($values) == 6) // new declaration with permissions + if (count($values) == 6) // new declaration with permissions: $value='objecttype:+tabname1:Title1:langfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__' { if ($values[0] != $type) continue; + if (verifCond($values[4])) { if ($values[3]) $langs->load($values[3]); @@ -4347,7 +4349,7 @@ function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode= $h++; } } - else if ($mode == 'remove') + else if ($mode == 'remove' && preg_match('/^\-/',$values[1])) { if ($values[0] != $type) continue; $tabname=str_replace('-','',$values[1]);