ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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
5include_once("./Services/User/Actions/classes/class.ilUserActionProvider.php");
6
15{
16 protected $wsp_activated;
17
24 public function __construct()
25 {
26 global $lng, $ilSetting;
27
28 $this->wsp_activated = (!$ilSetting->get("disable_personal_workspace"));
29 $lng->loadLanguageModule("wsp");
30 parent::__construct();
31 }
32
36 public function getComponentId()
37 {
38 return "pwsp";
39 }
40
44 public function getActionTypes()
45 {
46 return array(
47 "shared_res" => $this->lng->txt("wsp_shared_resources")
48 );
49 }
50
57 public function collectActionsForTargetUser($a_target_user)
58 {
59 global $ilCtrl, $lng;
60
62 include_once("./Services/User/Actions/classes/class.ilUserAction.php");
63
64 if (!$this->wsp_activated) {
65 return $coll;
66 }
67
68 $f = new ilUserAction();
69 $f->setType("shared_res");
70 $f->setText($lng->txt("wsp_shared_resources"));
71 $ilCtrl->setParameterByClass("ilobjworkspacerootfoldergui", "user", ilObjUser::_lookupLogin($a_target_user));
72 $f->setHref($ilCtrl->getLinkTargetByClass(
73 array("ilpersonaldesktopgui", "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}
An exception for terminatinating execution or to throw for unit testing.
static _lookupLogin($a_user_id)
lookup login
A class that provides a collection of actions on users.
Action that can be performed on a user.
getComponentId()
string component id as defined in services.xml/module.xml
getActionTypes()
array[string] keys must be unique action ids (strings), values should be the names of the actions (fr...
collectActionsForTargetUser($a_target_user)
Collect all actions.
global $ilCtrl
Definition: ilias.php:18
global $ilSetting
Definition: privfeed.php:17