ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
ilUserUserActionProvider Class Reference

Adds link to profile. More...

+ Inheritance diagram for ilUserUserActionProvider:
+ Collaboration diagram for ilUserUserActionProvider:

Public Member Functions

 __construct ()
 
 getComponentId ()
 
 getActionTypes ()
 
 collectActionsForTargetUser (int $target_user)
 Collect actions for a target user. More...
 
- Public Member Functions inherited from ilUserActionProvider
 __construct ()
 
 setUserId (int $a_val)
 
 getUserId ()
 
 collectActionsForTargetUser (int $a_target_user)
 Collect actions for a target user. More...
 
 getComponentId ()
 
 getActionTypes ()
 
 getJsScripts (string $a_action_type)
 

Private Attributes

readonly StaticURLServices $static_url
 

Additional Inherited Members

- Protected Attributes inherited from ilUserActionProvider
int $user_id
 
Language $lng
 
ilDBInterface $db
 

Detailed Description

Adds link to profile.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 28 of file class.ilUserUserActionProvider.php.

Constructor & Destructor Documentation

◆ __construct()

ilUserUserActionProvider::__construct ( )

Reimplemented from ilUserActionProvider.

Definition at line 32 of file class.ilUserUserActionProvider.php.

33 {
34 global $DIC;
35 $this->static_url = $DIC['static_url'];
36
38 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, and ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ collectActionsForTargetUser()

ilUserUserActionProvider::collectActionsForTargetUser ( int  $a_target_user)

Collect actions for a target user.

Reimplemented from ilUserActionProvider.

Definition at line 55 of file class.ilUserUserActionProvider.php.

56 {
57 $coll = new ilUserActionCollection();
58 if (!in_array(
59 ilObjUser::_lookupPref($target_user, "public_profile"),
60 ["y", "g"]
61 )) {
62 return $coll;
63 }
64
65 $f = new ilUserAction();
66 $f->setType("profile");
67 $f->setText($this->lng->txt('profile'));
68 $f->setHref(
69 $this->static_url->builder()->build(
70 StaticURLHandler::NAMESPACE,
71 null,
72 [$target_user]
73 )->__toString()
74 );
75 $coll->addAction($f);
76
77 return $coll;
78 }
static _lookupPref(int $a_usr_id, string $a_keyword)
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...

References Vendor\Package\$f, ilObjUser\_lookupPref(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getActionTypes()

ilUserUserActionProvider::getActionTypes ( )
Returns
array<string,string>

Reimplemented from ilUserActionProvider.

Definition at line 48 of file class.ilUserUserActionProvider.php.

48 : array
49 {
50 return [
51 "profile" => $this->lng->txt("profile")
52 ];
53 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getComponentId()

ilUserUserActionProvider::getComponentId ( )
Returns
string component id as defined in services.xml/module.xml

Reimplemented from ilUserActionProvider.

Definition at line 40 of file class.ilUserUserActionProvider.php.

40 : string
41 {
42 return 'user';
43 }

Field Documentation

◆ $static_url

readonly StaticURLServices ilUserUserActionProvider::$static_url
private

Definition at line 30 of file class.ilUserUserActionProvider.php.


The documentation for this class was generated from the following file: