Use a more standard behaviour: If hook return non zero, it is a "replace

code" hook. Otherwise, it is "insert code" hook.
This commit is contained in:
Laurent Destailleur 2012-09-05 13:05:24 +02:00
parent 9496fdd20b
commit 0e1dcb9408

View File

@ -83,9 +83,9 @@ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefil
'loaddate' => $loaddate,
'loadsize' => $loadsize
);
$ret=$hookmanager->executeHooks('getDirList', $parameters);
$reshook=$hookmanager->executeHooks('getDirList', $parameters);
if (! empty($hookmanager->resArray))
if (! empty($reshook)) // If hook return non zero, it is a "replace code" hook. Otherwise, it is "insert code" hook.
{
return $hookmanager->resArray;
}