ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 ()
 
 getActionTypes ()
 
 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

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

References ilMailGlobalServices\getMailObjectRefId().

Referenced by collectActionsForTargetUser().

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

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

References ilObjUser\_lookupName(), array, checkUserMailAccess(), ilUserActionCollection\getInstance(), ilMailFormCall\getLinkTarget(), and ilUserActionProvider\getUserId().

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

◆ getActionTypes()

ilMailUserActionProvider::getActionTypes ( )

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

References array.

48  {
49  return array(
50  "compose" => $this->lng->txt("mail")
51  );
52  }
Create styles array
The data for the language used.

◆ getComponentId()

ilMailUserActionProvider::getComponentId ( )

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

40  {
41  return "mail";
42  }

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: