ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilWorkspaceUserActionProvider.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2015 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 include_once("./Services/User/Actions/classes/class.ilUserActionProvider.php");
6 
15 {
16  protected $wsp_activated;
17 
24  public function __construct()
25  {
26  global $DIC;
27 
28  $lng = $DIC['lng'];
29  $ilSetting = $DIC['ilSetting'];
30 
31  $this->wsp_activated = (!$ilSetting->get("disable_personal_workspace"));
32  $lng->loadLanguageModule("wsp");
33  parent::__construct();
34  }
35 
39  public function getComponentId()
40  {
41  return "pwsp";
42  }
43 
47  public function getActionTypes()
48  {
49  return array(
50  "shared_res" => $this->lng->txt("wsp_shared_resources")
51  );
52  }
53 
60  public function collectActionsForTargetUser($a_target_user)
61  {
62  global $DIC;
63 
64  $ilCtrl = $DIC['ilCtrl'];
65  $lng = $DIC['lng'];
66 
68  include_once("./Services/User/Actions/classes/class.ilUserAction.php");
69 
70  if (!$this->wsp_activated) {
71  return $coll;
72  }
73 
74  $f = new ilUserAction();
75  $f->setType("shared_res");
76  $f->setText($lng->txt("wsp_shared_resources"));
77  $ilCtrl->setParameterByClass("ilobjworkspacerootfoldergui", "user", ilObjUser::_lookupLogin($a_target_user));
78  $f->setHref($ilCtrl->getLinkTargetByClass(
79  array("ilpersonaldesktopgui", "ilpersonalworkspacegui", "ilobjworkspacerootfoldergui"),
80  "listSharedResourcesOfOtherUser"
81  ));
82 
83  //$f->setData(array("test" => "you", "user" => $a_target_user));
84 
85  $coll->addAction($f);
86 
87  return $coll;
88  }
89 }
static _lookupLogin($a_user_id)
lookup login
A class that provides a collection of actions on users.
static getInstance()
Get instance.
global $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18
global $ilSetting
Definition: privfeed.php:17
collectActionsForTargetUser($a_target_user)
Collect all actions.
Action that can be performed on a user.