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

Static Protected Member Functions

static getTargetUrl ($argument_separator, $gui, $cmd, array $gui_params=array(), array $mail_params=array(), array $context_params=array())
 

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 193 of file class.ilMailFormCall.php.

194 {
195 $session = ilSession::get(self::SESSION_KEY);
196 return (
197 isset($session[self::CONTEXT_PREFIX][self::CONTEXT_KEY]) &&
198 strlen($session[self::CONTEXT_PREFIX][self::CONTEXT_KEY]) ?
199 $session[self::CONTEXT_PREFIX][self::CONTEXT_KEY] : null
200 );
201 }
static get($a_var)
Get a value.
$session

References $session, and ilSession\get().

Referenced by ilMailFormGUI\editAttachments(), ilMail\replacePlaceholders(), ilMailFormGUI\saveDraft(), ilMailFormGUI\saveMailBeforeSearch(), ilMailFormGUI\searchUsers(), and ilMailFormGUI\showForm().

+ 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 216 of file class.ilMailFormCall.php.

217 {
218 $session = ilSession::get(self::SESSION_KEY);
219 if (isset($session[self::CONTEXT_PREFIX])) {
220 return (array) $session[self::CONTEXT_PREFIX];
221 }
222 return array();
223 }
const CONTEXT_PREFIX
Session parameter for the context.

References $session, CONTEXT_PREFIX, and ilSession\get().

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

+ 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.

47 {
48 return self::getTargetUrl('&', $gui, $cmd, $gui_params, $mail_params, $context_params);
49 }
static getTargetUrl($argument_separator, $gui, $cmd, array $gui_params=array(), array $mail_params=array(), array $context_params=array())

References getTargetUrl().

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

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

◆ getRecipients()

static ilMailFormCall::getRecipients ( )
static
Returns
array

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

250 {
251 $session = ilSession::get(self::SESSION_KEY);
252 return (array) $session['rcp_to'];
253 }

References $session, and ilSession\get().

Referenced by ilMailGUI\executeCommand().

+ 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.

61 {
62 return self::getTargetUrl('&', $gui, $cmd, $gui_params, $mail_params, $context_params);
63 }

References getTargetUrl().

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

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

◆ getRefererRedirectUrl()

static ilMailFormCall::getRefererRedirectUrl ( )
static
Returns
string

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

161 {
162 $session = ilSession::get(self::SESSION_KEY);
163
165 if (strlen($url)) {
166 $parts = parse_url($url);
167 if (isset($parts['query']) && strlen($parts['query'])) {
168 $url .= '&returned_from_mail=1';
169 } else {
170 $url .= '?returned_from_mail=1';
171 }
172 }
173
174 unset($session[self::REFERER_KEY]);
175 ilSession::set(self::SESSION_KEY, $session);
176
177 return $url;
178 }
const REFERER_KEY
HTTP-GET parameter for the referer url.
static set($a_var, $a_val)
Set a value.
$url

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

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

+ 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 144 of file class.ilMailFormCall.php.

145 {
146 $session = ilSession::get(self::SESSION_KEY);
147
149
150 unset($session[self::SIGNATURE_KEY]);
151 ilSession::set(self::SESSION_KEY, $session);
152
153 return $sig;
154 }
const SIGNATURE_KEY
Session parameter for the hash.

References $session, ilSession\get(), ilSession\set(), and SIGNATURE_KEY.

Referenced by ilMailFormGUI\showForm().

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

◆ getTargetUrl()

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

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

75 {
76 global $DIC;
77
78 $mparams = '';
79 $referer = '';
80
81 foreach ($mail_params as $key => $value) {
82 $mparams .= $argument_separator . $key . '=' . urlencode($value);
83 }
84
85 foreach ($context_params as $key => $value) {
86 if ($key == self::CONTEXT_KEY) {
87 $mparams .= $argument_separator . $key . '=' . urlencode($value);
88 } else {
89 $mparams .= $argument_separator . self::CONTEXT_PREFIX . '_' . $key . '=' . urlencode($value);
90 }
91 }
92
93 if (is_object($gui)) {
94 $ilCtrlTmp = clone $DIC->ctrl();
95 foreach ($gui_params as $key => $value) {
96 $ilCtrlTmp->setParameter($gui, $key, $value);
97 }
98 $referer = $ilCtrlTmp->getLinkTarget($gui, $cmd, '', false, false);
99 } elseif (is_string($gui)) {
100 $referer = $gui;
101 }
102
103 $referer = $argument_separator . self::REFERER_KEY . '=' . rawurlencode(base64_encode($referer));
104
105 return 'ilias.php?baseClass=ilMailGUI' . $referer . $mparams;
106 }
$key
Definition: croninfo.php:18
global $DIC
Definition: saml.php:7

References $DIC, and $key.

Referenced by getLinkTarget(), and getRedirectTarget().

+ Here is the caller graph for this function:

◆ isRefererStored()

static ilMailFormCall::isRefererStored ( )
static
Returns
bool

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

185 {
186 $session = ilSession::get(self::SESSION_KEY);
187 return isset($session[self::REFERER_KEY]) && strlen($session[self::REFERER_KEY]) ? true : false;
188 }

References $session, and ilSession\get().

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

+ 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 206 of file class.ilMailFormCall.php.

207 {
208 $session = ilSession::get(self::SESSION_KEY);
210 ilSession::set(self::SESSION_KEY, $session);
211 }
const CONTEXT_KEY
Session parameter for the context.
if(!array_key_exists('StateId', $_REQUEST)) $id

References $id, $session, CONTEXT_KEY, ilSession\get(), and ilSession\set().

Referenced by ilMailFormGUI\showForm().

+ 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 229 of file class.ilMailFormCall.php.

230 {
231 $session = ilSession::get(self::SESSION_KEY);
232 $session[self::CONTEXT_PREFIX] = $parameters;
233 ilSession::set(self::SESSION_KEY, $session);
234 }

References $session, CONTEXT_PREFIX, ilSession\get(), and ilSession\set().

Referenced by ilMailFormGUI\showForm().

+ 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 239 of file class.ilMailFormCall.php.

240 {
241 $session = ilSession::get(self::SESSION_KEY);
242 $session['rcp_to'] = $recipients;
243 ilSession::set(self::SESSION_KEY, $session);
244 }

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

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

+ 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 112 of file class.ilMailFormCall.php.

113 {
114 $session = ilSession::get(self::SESSION_KEY);
115 if (isset($request_params[self::REFERER_KEY])) {
116 $session[self::REFERER_KEY] = base64_decode(rawurldecode($request_params[self::REFERER_KEY]));
117 $session[self::SIGNATURE_KEY] = base64_decode(rawurldecode($request_params[self::SIGNATURE_KEY]));
118
119 $ctx_params = array();
120 foreach ($request_params as $key => $value) {
121 $prefix = substr($key, 0, strlen(self::CONTEXT_PREFIX));
122 if ($prefix == self::CONTEXT_PREFIX) {
123 if ($key == self::CONTEXT_KEY) {
124 $ctx_params[$key] = $value;
125 } else {
126 $ctx_params[substr($key, strlen(self::CONTEXT_PREFIX . '_'))] = $value;
127 }
128 }
129 }
130 $session[self::CONTEXT_PREFIX] = $ctx_params;
131 } else {
132 unset($session[self::REFERER_KEY]);
133 unset($session[self::SIGNATURE_KEY]);
134 unset($session[self::CONTEXT_PREFIX]);
135 }
136 ilSession::set(self::SESSION_KEY, $session);
137 }

References $key, $session, CONTEXT_PREFIX, ilSession\get(), REFERER_KEY, ilSession\set(), and SIGNATURE_KEY.

Referenced by ilMailGUI\executeCommand().

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

Field Documentation

◆ CONTEXT_KEY

◆ CONTEXT_PREFIX

const ilMailFormCall::CONTEXT_PREFIX = 'ctx'

Session parameter for the context.

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

Referenced by getContextParameters(), setContextParameters(), and storeReferer().

◆ REFERER_KEY

const ilMailFormCall::REFERER_KEY = 'r'

HTTP-GET parameter for the referer url.

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

Referenced by getRefererRedirectUrl(), and storeReferer().

◆ 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 getSignature(), ilExerciseManagementGUI\redirectFeedbackMailObject(), and storeReferer().


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