diff --git a/main/document/document.php b/main/document/document.php index 937332aebe..31253ab487 100755 --- a/main/document/document.php +++ b/main/document/document.php @@ -1843,8 +1843,10 @@ if ($isAllowedToEdit || $hook = HookDocumentAction::create(); if (!empty($hook)) { $data = $hook->notifyDocumentAction(HOOK_EVENT_TYPE_PRE); - if (isset($data['action'])) { - $actionsLeft .= $data['action']; + if (isset($data['actions'])) { + foreach ($data['actions'] as $action) { + $actionsLeft .= $action; + } } } } diff --git a/main/inc/lib/document.lib.php b/main/inc/lib/document.lib.php index c5f2fbc589..f5d49151ee 100644 --- a/main/inc/lib/document.lib.php +++ b/main/inc/lib/document.lib.php @@ -5600,8 +5600,10 @@ class DocumentManager if (!empty($hook)) { $hook->setEventData($document_data); $data = $hook->notifyDocumentItemAction(HOOK_EVENT_TYPE_PRE); - if (isset($data['action'])) { - $modify_icons[] = $data['action']; + if (isset($data['actions'])) { + foreach ($data['actions'] as $action) { + $modify_icons[] = $action; + } } } diff --git a/plugin/createdrupaluser/src/CreateDrupalUser.php b/plugin/createdrupaluser/src/CreateDrupalUser.php index b1d49dd666..476037e908 100644 --- a/plugin/createdrupaluser/src/CreateDrupalUser.php +++ b/plugin/createdrupaluser/src/CreateDrupalUser.php @@ -132,4 +132,25 @@ class CreateDrupalUser extends Plugin implements HookPluginInterface $extraField->delete($extraFieldInfo['id']); } } + + /* + public function notifyDocumentAction(HookDocumentActionEventInterface $hook) + { + $data = $hook->getEventData(); + if ($data['type'] === HOOK_EVENT_TYPE_PRE) { + $data['actions'][] = Display::return_icon('edit.png'); + } + + return $data; + } + + public function notifyDocumentItemAction(HookDocumentItemActionEventInterface $hook) + { + $data = $hook->getEventData(); + if ($data['type'] === HOOK_EVENT_TYPE_PRE) { + $data['actions'][] = $data['id'].' - '.$data['title']; + } + + return $data; + }*/ }