ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilWorkspaceUserActionProvider.php
Go to the documentation of this file.
1<?php
2
24{
25 protected bool $wsp_activated;
26
27 public function __construct()
28 {
29 global $DIC;
30
31 $lng = $DIC['lng'];
32 $ilSetting = $DIC['ilSetting'];
33
34 $this->wsp_activated = (!$ilSetting->get("disable_personal_workspace"));
35 $lng->loadLanguageModule("wsp");
37 }
38
39 public function getComponentId(): string
40 {
41 return "pwsp";
42 }
43
47 public function getActionTypes(): array
48 {
49 return [
50 "shared_res" => $this->lng->txt("wsp_shared_resources")
51 ];
52 }
53
54 public function collectActionsForTargetUser(int $a_target_user): ilUserActionCollection
55 {
56 global $DIC;
57
58 $ilCtrl = $DIC['ilCtrl'];
59 $lng = $DIC['lng'];
60
61 $coll = new ilUserActionCollection();
62
63 if (!$this->wsp_activated) {
64 return $coll;
65 }
66
67 $f = new ilUserAction();
68 $f->setType("shared_res");
69 $f->setText($lng->txt("wsp_shared_resources"));
70 $ilCtrl->setParameterByClass("ilobjworkspacerootfoldergui", "user", ilObjUser::_lookupLogin($a_target_user));
71 $ilCtrl->setParameterByClass("ilobjworkspacerootfoldergui", "shr_id", $a_target_user);
72 $f->setHref($ilCtrl->getLinkTargetByClass(
73 ["ildashboardgui", "ilpersonalworkspacegui", "ilobjworkspacerootfoldergui"],
74 "listSharedResourcesOfOtherUser"
75 ));
76
77 //$f->setData(array("test" => "you", "user" => $a_target_user));
78
79 $coll->addAction($f);
80
81 return $coll;
82 }
83}
static _lookupLogin(int $a_user_id)
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.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
collectActionsForTargetUser(int $a_target_user)
Collect actions for a target user.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $ilSetting
Definition: privfeed.php:31
global $DIC
Definition: shib_login.php:26