19 declare(strict_types=1);
43 $this->
lng->loadLanguageModule(
'usr');
53 public function init(): void
55 foreach ($this->user_action_provider_factory->getProviders() as $prov) {
56 foreach ($prov->getActionTypes() as $act_type =>
$txt) {
57 if ($this->user_action_admin->isActionActive(
58 $this->user_action_context->getComponentId(),
59 $this->user_action_context->getContextId(),
60 $prov->getComponentId(),
63 foreach ($prov->getJsScripts($act_type) as $script) {
64 $this->tpl->addJavaScript($script);
73 $action_collection = $this->user_action_collector->getActionsForTargetUser($target_user_id);
75 foreach ($action_collection->getActions() as $action) {
76 $action_link = $this->ui_factory->link()->standard($action->getText(), $action->getHref());
77 if ($action->getData() !== []) {
78 $data = $action->getData();
79 $action_link = $action_link->withAdditionalOnLoadCode(
80 static function (
$id) use (
$data):
string {
83 $js .=
"{$id}.setAttribute('data-{$key}', '{$datum}');";
90 $actions[] = $action_link;
92 $action_list = $this->ui_factory->dropdown()->standard($actions)
93 ->withAriaLabel($this->
lng->txt(
'user_actions'));
94 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...
An entity that renders components to a string output.
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
__construct(private ilUserActionProviderFactory $user_action_provider_factory, private ilUserActionContext $user_action_context, private ilGlobalTemplateInterface $tpl, private UIFactory $ui_factory, private Renderer $ui_renderer, private ilLanguage $lng, ilDBInterface $db, int $user_id)
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...