Merge pull request #8581 from defrance/patch-110

printTopRightMenu trigger : numeric result never empty
This commit is contained in:
Laurent Destailleur 2018-04-13 10:37:51 +02:00 committed by GitHub
commit 85161f91ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1493,11 +1493,16 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
$result=$hookmanager->executeHooks('printTopRightMenu',$parameters); // Note that $action and $object may have been modified by some hooks
if (is_numeric($result))
{
if (empty($result)) $toprightmenu.=$hookmanager->resPrint; // add
else $toprightmenu=$hookmanager->resPrint; // replace
if ($result == 0)
$toprightmenu.=$hookmanager->resPrint; // add
else
$toprightmenu=$hookmanager->resPrint; // replace
}
else $toprightmenu.=$result; // For backward compatibility
else
{
$toprightmenu.=$result; // For backward compatibility
}
// Link to module builder
if (! empty($conf->modulebuilder->enabled))
{