ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilMailFormCall Class Reference

Statically used helper class for generating links to the mail form user interface. More...

+ Collaboration diagram for ilMailFormCall:

Static Public Member Functions

static getLinkTarget ($gui, $cmd, Array $gui_params=array(), Array $mail_params=array(), $context_params=array())
 
static getRedirectTarget ($gui, $cmd, array $gui_params=array(), array $mail_params=array(), array $context_params=array())
 
static storeReferer ($request_params)
 
static getSignature ()
 Get preset signature. More...
 
static getRefererRedirectUrl ()
 
static isRefererStored ()
 
static getContextId ()
 
static setContextId ($id)
 
static getContextParameters ()
 
static setContextParameters (array $parameters)
 
static setRecipients (array $recipients)
 
static getRecipients ()
 

Data Fields

const SESSION_KEY = 'mail_transport'
 
const REFERER_KEY = 'r'
 HTTP-GET parameter for the referer url. More...
 
const SIGNATURE_KEY = 'sig'
 Session parameter for the hash. More...
 
const CONTEXT_PREFIX = 'ctx'
 Session parameter for the context. More...
 
const CONTEXT_KEY = 'ctx_template'
 Session parameter for the context. More...
 

Detailed Description

Statically used helper class for generating links to the mail form user interface.

Version
: $Id$
Author
Michael Jansen mjans.nosp@m.en@d.nosp@m.ataba.nosp@m.y.de

Definition at line 10 of file class.ilMailFormCall.php.

Member Function Documentation

◆ getContextId()

static ilMailFormCall::getContextId ( )
static
Returns
string|null

Definition at line 216 of file class.ilMailFormCall.php.

References ilSession\get().

Referenced by ilMailFormGUI\cancelMail(), ilMailFormGUI\editAttachments(), ilMailFormGUI\getTemplateDataById(), ilMail\replacePlaceholders(), ilMailFormGUI\saveDraft(), and ilMailFormGUI\searchUsers().

217  {
218  $session = ilSession::get(self::SESSION_KEY);
219  return (
220  isset($session[self::CONTEXT_PREFIX][self::CONTEXT_KEY]) &&
221  strlen($session[self::CONTEXT_PREFIX][self::CONTEXT_KEY]) ?
222  $session[self::CONTEXT_PREFIX][self::CONTEXT_KEY] : NULL
223  );
224  }
static get($a_var)
Get a value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getContextParameters()

static ilMailFormCall::getContextParameters ( )
static
Returns
array context parameters

Definition at line 239 of file class.ilMailFormCall.php.

References array, and ilSession\get().

Referenced by ilMailFormGUI\cancelMail(), ilMailFormGUI\editAttachments(), ilMail\replacePlaceholders(), ilMailFormGUI\saveDraft(), ilMailFormGUI\searchUsers(), and ilObjSurvey\sentReminderPlaceholders().

240  {
241  $session = ilSession::get(self::SESSION_KEY);
242  if(isset($session[self::CONTEXT_PREFIX]))
243  {
244  return (array)$session[self::CONTEXT_PREFIX];
245  }
246  return array();
247  }
static get($a_var)
Get a value.
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLinkTarget()

static ilMailFormCall::getLinkTarget (   $gui,
  $cmd,
Array  $gui_params = array(),
Array  $mail_params = array(),
  $context_params = array() 
)
static
Parameters
mixed$gui
string$cmd
array$gui_params
array$mail_params
array$context_params
Returns
string

Definition at line 46 of file class.ilMailFormCall.php.

References $cmd.

Referenced by ilMailUserActionProvider\collectActionsForTargetUser(), ilAssignedUsersTableGUI\fillRow(), ilUsersOnlineBlockGUI\fillRow(), ilPublicUserProfileGUI\getEmbeddable(), and ilObjCourseGUI\infoScreen().

47  {
48  return self::getTargetUrl('&', $gui, $cmd, $gui_params, $mail_params, $context_params);
49  }
$cmd
Definition: sahs_server.php:35
+ Here is the caller graph for this function:

◆ getRecipients()

static ilMailFormCall::getRecipients ( )
static
Returns
array

Definition at line 273 of file class.ilMailFormCall.php.

References array, and ilSession\get().

Referenced by ilMailGUI\executeCommand().

274  {
275  $session = ilSession::get(self::SESSION_KEY);
276  return (array)$session['rcp_to'];
277  }
static get($a_var)
Get a value.
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRedirectTarget()

static ilMailFormCall::getRedirectTarget (   $gui,
  $cmd,
array  $gui_params = array(),
array  $mail_params = array(),
array  $context_params = array() 
)
static
Parameters
mixed$gui
string$cmd
array$gui_params
array$mail_params
array$context_params
Returns
string

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

References $cmd, $ilCtrl, and array.

Referenced by ilObjUserFolderGUI\mailObject(), ilObjRoleGUI\mailToRoleObject(), ilMailMemberSearchGUI\nextMailForm(), ilExerciseManagementGUI\redirectFeedbackMailObject(), ilLPTableBaseGUI\sendMail(), ilBookmarkAdministrationGUI\sendmail(), ilObjContentObjectGUI\sendMailToBlockedUsers(), ilMembershipMailGUI\sendMailToSelectedUsers(), ilMailMemberSearchGUI\sendMailToSelectedUsers(), and ilMembershipGUI\sendMailToSelectedUsers().

61  {
62  return self::getTargetUrl('&', $gui, $cmd, $gui_params, $mail_params, $context_params);
63  }
$cmd
Definition: sahs_server.php:35
+ Here is the caller graph for this function:

◆ getRefererRedirectUrl()

static ilMailFormCall::getRefererRedirectUrl ( )
static
Returns
string

Definition at line 179 of file class.ilMailFormCall.php.

References $url, ilSession\get(), and ilSession\set().

Referenced by ilMailFormGUI\cancelMail(), ilMailFormGUI\saveDraft(), and ilMailFormGUI\sendMessage().

180  {
181  $session = ilSession::get(self::SESSION_KEY);
182 
183  $url = $session[self::REFERER_KEY];
184  if(strlen($url))
185  {
186  $parts = parse_url($url);
187  if(isset($parts['query']) && strlen($parts['query']))
188  {
189  $url .= '&returned_from_mail=1';
190  }
191  else
192  {
193  $url .= '?returned_from_mail=1';
194  }
195  }
196 
197  unset($session[self::REFERER_KEY]);
198  ilSession::set(self::SESSION_KEY, $session);
199 
200  return $url;
201  }
static get($a_var)
Get a value.
static set($a_var, $a_val)
Set a value.
$url
Definition: shib_logout.php:72
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSignature()

static ilMailFormCall::getSignature ( )
static

Get preset signature.

Returns
string signature

Definition at line 163 of file class.ilMailFormCall.php.

References ilSession\get(), and ilSession\set().

Referenced by ilMailFormGUI\getTemplateDataById().

164  {
165  $session = ilSession::get(self::SESSION_KEY);
166 
167  $sig = $session[self::SIGNATURE_KEY];
168 
169  unset($session[self::SIGNATURE_KEY]);
170  ilSession::set(self::SESSION_KEY, $session);
171 
172  return $sig;
173  }
static get($a_var)
Get a value.
static set($a_var, $a_val)
Set a value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isRefererStored()

static ilMailFormCall::isRefererStored ( )
static
Returns
bool

Definition at line 207 of file class.ilMailFormCall.php.

References ilSession\get().

Referenced by ilMailFormGUI\cancelMail(), ilMailFormGUI\getTemplateDataById(), ilMailFormGUI\saveDraft(), and ilMailFormGUI\sendMessage().

208  {
209  $session = ilSession::get(self::SESSION_KEY);
210  return isset($session[self::REFERER_KEY]) && strlen($session[self::REFERER_KEY]) ? true : false;
211  }
static get($a_var)
Get a value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setContextId()

static ilMailFormCall::setContextId (   $id)
static
Parameters
$idstring

Definition at line 229 of file class.ilMailFormCall.php.

References ilSession\get(), and ilSession\set().

Referenced by ilMailFormGUI\getTemplateDataById().

230  {
231  $session = ilSession::get(self::SESSION_KEY);
232  $session[self::CONTEXT_KEY] = $id;
233  ilSession::set(self::SESSION_KEY, $session);
234  }
static get($a_var)
Get a value.
static set($a_var, $a_val)
Set a value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setContextParameters()

static ilMailFormCall::setContextParameters ( array  $parameters)
static
Parameters
array$parameters
Returns
array

Definition at line 253 of file class.ilMailFormCall.php.

References ilSession\get(), and ilSession\set().

Referenced by ilMailFormGUI\getTemplateDataById().

254  {
255  $session = ilSession::get(self::SESSION_KEY);
256  $session[self::CONTEXT_PREFIX] = $parameters;
257  ilSession::set(self::SESSION_KEY, $session);
258  }
static get($a_var)
Get a value.
static set($a_var, $a_val)
Set a value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setRecipients()

static ilMailFormCall::setRecipients ( array  $recipients)
static
Parameters
array$recipients

Definition at line 263 of file class.ilMailFormCall.php.

References ilSession\get(), and ilSession\set().

Referenced by ilMailGUI\executeCommand(), ilMailMemberSearchGUI\sendMailToSelectedUsers(), and ilMembershipGUI\sendMailToSelectedUsers().

264  {
265  $session = ilSession::get(self::SESSION_KEY);
266  $session['rcp_to'] = $recipients;
267  ilSession::set(self::SESSION_KEY, $session);
268  }
static get($a_var)
Get a value.
static set($a_var, $a_val)
Set a value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ storeReferer()

static ilMailFormCall::storeReferer (   $request_params)
static
Parameters
array$request_params

Definition at line 123 of file class.ilMailFormCall.php.

References array, ilSession\get(), and ilSession\set().

Referenced by ilMailGUI\executeCommand().

124  {
125  $session = ilSession::get(self::SESSION_KEY);
126  if(isset($request_params[self::REFERER_KEY]))
127  {
128  $session[self::REFERER_KEY] = base64_decode(rawurldecode($request_params[self::REFERER_KEY]));
129  $session[self::SIGNATURE_KEY] = base64_decode(rawurldecode($request_params[self::SIGNATURE_KEY]));
130 
131  $ctx_params = array();
132  foreach($request_params as $key => $value)
133  {
134  $prefix = substr($key, 0, strlen(self::CONTEXT_PREFIX));
135  if($prefix == self::CONTEXT_PREFIX)
136  {
137  if($key == self::CONTEXT_KEY)
138  {
139  $ctx_params[$key] = $value;
140  }
141  else
142  {
143  $ctx_params[substr($key, strlen(self::CONTEXT_PREFIX . '_'))] = $value;
144  }
145  }
146  }
147  $session[self::CONTEXT_PREFIX] = $ctx_params;
148  }
149  else
150  {
151  unset($session[self::REFERER_KEY]);
152  unset($session[self::SIGNATURE_KEY]);
153  unset($session[self::CONTEXT_PREFIX]);
154  }
155  ilSession::set(self::SESSION_KEY, $session);
156  }
static get($a_var)
Get a value.
static set($a_var, $a_val)
Set a value.
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ CONTEXT_KEY

const ilMailFormCall::CONTEXT_KEY = 'ctx_template'

◆ CONTEXT_PREFIX

const ilMailFormCall::CONTEXT_PREFIX = 'ctx'

Session parameter for the context.

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

◆ REFERER_KEY

const ilMailFormCall::REFERER_KEY = 'r'

HTTP-GET parameter for the referer url.

Definition at line 20 of file class.ilMailFormCall.php.

◆ SESSION_KEY

const ilMailFormCall::SESSION_KEY = 'mail_transport'

Definition at line 15 of file class.ilMailFormCall.php.

◆ SIGNATURE_KEY

const ilMailFormCall::SIGNATURE_KEY = 'sig'

Session parameter for the hash.

Definition at line 25 of file class.ilMailFormCall.php.

Referenced by ilExerciseManagementGUI\redirectFeedbackMailObject().


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