ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 $DIC;
27
28 $lng = $DIC['lng'];
29 $ilSetting = $DIC['ilSetting'];
30
31 $this->wsp_activated = (!$ilSetting->get("disable_personal_workspace"));
32 $lng->loadLanguageModule("wsp");
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("ildashboardgui", "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}
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
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $ilSetting
Definition: privfeed.php:17
$DIC
Definition: xapitoken.php:46