ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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 array(
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 
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  array("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 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
loadLanguageModule(string $a_module)
Load language module.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
global $ilSetting
Definition: privfeed.php:17
__construct(Container $dic, ilPlugin $plugin)
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...
static _lookupLogin(int $a_user_id)