Update functions.lib.php
This commit is contained in:
parent
f0e3c33dc3
commit
eac3a6cf86
@ -8771,11 +8771,13 @@ function complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type,
|
|||||||
complete_substitutions_array($substitutionarray, $langs, $object, array('needforkey'=>$values[2]));
|
complete_substitutions_array($substitutionarray, $langs, $object, array('needforkey'=>$values[2]));
|
||||||
$label = make_substitutions($reg[1], $substitutionarray);
|
$label = make_substitutions($reg[1], $substitutionarray);
|
||||||
} else {
|
} else {
|
||||||
$labeltemp = explode(',', $values[2]);
|
$labeltemp = explode(':', $values[2]);
|
||||||
$label = $langs->trans($labeltemp[0]);
|
$label = $langs->trans($labeltemp[0]);
|
||||||
if (!empty($labeltemp[1]) && is_object($object) && !empty($object->id)) {
|
if (!empty($labeltemp[1]) && is_object($object) && !empty($object->id)) {
|
||||||
dol_include_once($labeltemp[2]);
|
dol_include_once($labeltemp[2]);
|
||||||
$obj = new $labeltemp[1]($db);
|
$classtoload = $labeltemp[1];
|
||||||
|
if (class_exists($classtoload)) {
|
||||||
|
$obj = new $classtoload($db);
|
||||||
$function = $labeltemp[3];
|
$function = $labeltemp[3];
|
||||||
if (method_exists($obj, $function)) {
|
if (method_exists($obj, $function)) {
|
||||||
$nbrec = $obj->$function($object->id, $obj);
|
$nbrec = $obj->$function($object->id, $obj);
|
||||||
@ -8783,6 +8785,7 @@ function complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i', ((is_object($object) && !empty($object->id)) ? $object->id : ''), $values[5]), 1);
|
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i', ((is_object($object) && !empty($object->id)) ? $object->id : ''), $values[5]), 1);
|
||||||
$head[$h][1] = $label;
|
$head[$h][1] = $label;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user