19 declare(strict_types=1);
44 $this->
lng->loadLanguageModule(
'usr');
54 public function init(): void
56 foreach ($this->user_action_provider_factory->getProviders() as $prov) {
57 foreach (array_keys($prov->getActionTypes()) as $act_type) {
58 if ($this->user_action_admin->isActionActive(
59 $this->user_action_context->getComponentId(),
60 $this->user_action_context->getContextId(),
61 $prov->getComponentId(),
64 foreach ($prov->getJsScripts($act_type) as $script) {
65 $this->tpl->addJavaScript($script);
74 $action_collection = $this->user_action_collector->getActionsForTargetUser($target_user_id);
76 foreach ($action_collection->getActions() as $action) {
77 $action_link = $this->ui_factory->link()->standard($action->getText(), $action->getHref());
78 if ($action->getData() !== []) {
79 $data = $action->getData();
80 $action_link = $action_link->withAdditionalOnLoadCode(
81 static function (
$id) use (
$data):
string {
83 foreach (
$data as $key => $datum) {
84 $js .=
"{$id}.setAttribute('data-{$key}', '{$datum}');";
91 $actions[] = $action_link;
93 $action_list = $this->ui_factory->dropdown()->standard($actions)
94 ->withAriaLabel($this->
lng->txt(
'user_actions'));
95 return $this->ui_renderer->render($action_list);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
A class that provides a collection of actions on users.
renderDropDown(int $target_user_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilUserActionAdmin $user_action_admin
User action administration.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilUserActionCollector $user_action_collector
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(private ilUserActionProviderFactory $user_action_provider_factory, private ilUserActionContext $user_action_context, private ilGlobalTemplateInterface $tpl, private UIFactory $ui_factory, private Renderer $ui_renderer, private Language $lng, ilDBInterface $db, int $user_id)