mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-08 18:12:53 +01:00
Merge pull request #19226 from andreubisquerra/develop
TakePOS hooks improvements
This commit is contained in:
@@ -1121,14 +1121,24 @@ if ($resql) {
|
||||
}
|
||||
|
||||
$hookmanager->initHooks(array('takeposfrontend'));
|
||||
$reshook = $hookmanager->executeHooks('ActionButtons');
|
||||
if (!empty($reshook)) {
|
||||
if (is_array($reshook) && !isset($reshook['title'])) {
|
||||
foreach ($reshook as $reshook) {
|
||||
$menus[$r++] = $reshook;
|
||||
$parameters = array('menus'=>$menus);
|
||||
$reshook = $hookmanager->executeHooks('ActionButtons', $parameters);
|
||||
if ($reshook == 0) { //add buttons
|
||||
if (is_array($hookmanager->resArray) ) {
|
||||
foreach ($hookmanager->resArray as $resArray) {
|
||||
foreach ($resArray as $butmenu) {
|
||||
$menus[$r++] = $butmenu;
|
||||
}
|
||||
}
|
||||
} elseif ($reshook == 1) {
|
||||
$r = 0; //replace buttons
|
||||
if (is_array($hookmanager->resArray) ) {
|
||||
foreach ($hookmanager->resArray as $resArray) {
|
||||
foreach ($resArray as $butmenu) {
|
||||
$menus[$r++] = $butmenu;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$menus[$r++] = $reshook;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user