ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 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 function getComponentId()
37 {
38 return "pwsp";
39 }
40
44 function getActionTypes()
45 {
46 return array(
47 "shared_res" => $this->lng->txt("wsp_shared_resources")
48 );
49 }
50
57 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 {
66 return $coll;
67 }
68
69 $f = new ilUserAction();
70 $f->setType("shared_res");
71 $f->setText($lng->txt("wsp_shared_resources"));
72 $ilCtrl->setParameterByClass("ilobjworkspacerootfoldergui", "user", ilObjUser::_lookupLogin($a_target_user));
73 $f->setHref($ilCtrl->getLinkTargetByClass(array("ilpersonaldesktopgui", "ilpersonalworkspacegui", "ilobjworkspacerootfoldergui"),
74 "listSharedResourcesOfOtherUser"));
75
76 //$f->setData(array("test" => "you", "user" => $a_target_user));
77
78 $coll->addAction($f);
79
80 return $coll;
81 }
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