ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilMailUserActionProvider Class Reference

Adds link to mail. More...

+ Inheritance diagram for ilMailUserActionProvider:
+ Collaboration diagram for ilMailUserActionProvider:

Public Member Functions

 checkUserMailAccess ($a_user_id)
 Check user chat access. More...
 
 getComponentId ()
 
Returns
string component id as defined in services.xml/module.xml
More...
 
 getActionTypes ()
 
Returns
array[string] keys must be unique action ids (strings), values should be the names of the actions (from ilLanguage)
More...
 
 collectActionsForTargetUser ($a_target_user)
 Collect user actions. More...
 
- Public Member Functions inherited from ilUserActionProvider
 __construct ()
 Constructor. More...
 
 setUserId ($a_val)
 Set user id. More...
 
 getUserId ()
 Get user id. More...
 
 collectActionsForTargetUser ($a_target_user)
 Collect actions for a target user. More...
 
 getComponentId ()
 
 getActionTypes ()
 
 getJsScripts ($a_action_type)
 Get js scripts. More...
 

Static Public Attributes

static $user_access = array()
 

Additional Inherited Members

- Protected Attributes inherited from ilUserActionProvider
 $user_id
 
 $lng
 
 $db
 

Detailed Description

Adds link to mail.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 14 of file class.ilMailUserActionProvider.php.

Member Function Documentation

◆ checkUserMailAccess()

ilMailUserActionProvider::checkUserMailAccess (   $a_user_id)

Check user chat access.

Parameters

return

Definition at line 24 of file class.ilMailUserActionProvider.php.

25 {
26 global $DIC;
27
28 $rbacsystem = $DIC['rbacsystem'];
29
30 if (!isset(self::$user_access[$a_user_id])) {
31 include_once("./Services/Mail/classes/class.ilMailGlobalServices.php");
32 self::$user_access[$a_user_id] =
33 $rbacsystem->checkAccessOfUser($a_user_id, 'internal_mail', ilMailGlobalServices::getMailObjectRefId());
34 }
35 return self::$user_access[$a_user_id];
36 }
static getMailObjectRefId()
Determines the reference id of the mail object and stores this information in a local cache variable.
$DIC
Definition: xapitoken.php:46

References $DIC, and ilMailGlobalServices\getMailObjectRefId().

Referenced by collectActionsForTargetUser().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ collectActionsForTargetUser()

ilMailUserActionProvider::collectActionsForTargetUser (   $a_target_user)

Collect user actions.

Parameters
int$a_target_usertarget user
Returns
ilUserActionCollection collection

Reimplemented from ilUserActionProvider.

Definition at line 62 of file class.ilMailUserActionProvider.php.

63 {
65 include_once("./Services/User/Actions/classes/class.ilUserAction.php");
66 include_once("./Services/Mail/classes/class.ilMailFormCall.php");
67
68 // check mail permission of user
69 if ($this->getUserId() == ANONYMOUS_USER_ID || !$this->checkUserMailAccess($this->getUserId())) {
70 return $coll;
71 }
72
73 // check mail permission of target user
74 if ($this->checkUserMailAccess($a_target_user)) {
75 $f = new ilUserAction();
76 $f->setType("compose");
77 $f->setText($this->lng->txt("mail"));
78 $tn = ilObjUser::_lookupName($a_target_user);
79 $f->setHref(ilMailFormCall::getLinkTarget("", '', array(), array('type' => 'new', 'rcp_to' => $tn["login"])));
80 $coll->addAction($f);
81 }
82
83 return $coll;
84 }
static getLinkTarget($gui, $cmd, array $gui_params=array(), array $mail_params=array(), $context_params=array())
checkUserMailAccess($a_user_id)
Check user chat access.
static _lookupName($a_user_id)
lookup user name
Action that can be performed on a user.

References Vendor\Package\$f, ilObjUser\_lookupName(), checkUserMailAccess(), ilUserActionCollection\getInstance(), ilMailFormCall\getLinkTarget(), and ilUserActionProvider\getUserId().

+ Here is the call graph for this function:

◆ getActionTypes()

ilMailUserActionProvider::getActionTypes ( )

Returns
array[string] keys must be unique action ids (strings), values should be the names of the actions (from ilLanguage)

Reimplemented from ilUserActionProvider.

Definition at line 49 of file class.ilMailUserActionProvider.php.

50 {
51 return array(
52 "compose" => $this->lng->txt("mail")
53 );
54 }

◆ getComponentId()

ilMailUserActionProvider::getComponentId ( )

Returns
string component id as defined in services.xml/module.xml

Reimplemented from ilUserActionProvider.

Definition at line 41 of file class.ilMailUserActionProvider.php.

42 {
43 return "mail";
44 }

Field Documentation

◆ $user_access

ilMailUserActionProvider::$user_access = array()
static

Definition at line 16 of file class.ilMailUserActionProvider.php.


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