ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilMembershipMailGUI Class Reference

Membership Mail GUI. More...

+ Collaboration diagram for ilMembershipMailGUI:

Public Member Functions

 __construct (ilObjectGUI $object)
 
 getCurrentObject ()
 
 executeCommand ()
 
 sendMailToSelectedUsers ()
 

Protected Member Functions

 initRecipientsFromPost (string $name)
 
 initMemberIdFromGet ()
 
 createMailSignature ()
 

Protected Attributes

ilCtrlInterface $ctrl
 
ilLanguage $lng
 
GlobalHttpState $http
 
Factory $refinery
 

Private Attributes

ilObjectGUI $object
 
ilGlobalTemplateInterface $main_tpl
 

Detailed Description

Membership Mail GUI.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 31 of file class.ilMembershipMailGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilMembershipMailGUI::__construct ( ilObjectGUI  $object)

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

References $DIC, $object, ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

41  {
42  global $DIC;
43  $this->main_tpl = $DIC->ui()->mainTemplate();
44  $this->http = $DIC->http();
45  $this->refinery = $DIC->refinery();
46  $this->object = $object;
47  $this->ctrl = $DIC->ctrl();
48  $this->lng = $DIC->language();
49  }
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

Member Function Documentation

◆ createMailSignature()

ilMembershipMailGUI::createMailSignature ( )
protected

Definition at line 130 of file class.ilMembershipMailGUI.php.

References getCurrentObject(), and ILIAS\Repository\lng().

Referenced by sendMailToSelectedUsers().

130  : string
131  {
132  $this->lng->loadLanguageModule($this->getCurrentObject()->getObject()->getType());
133 
134  $link = chr(13) . chr(10) . chr(13) . chr(10);
135  $link .= $this->lng->txt($this->getCurrentObject()->getObject()->getType() . '_mail_permanent_link');
136  $link .= chr(13) . chr(10) . chr(13) . chr(10);
137  $link .= ilLink::_getLink($this->getCurrentObject()->getObject()->getRefId());
138  return rawurlencode(base64_encode($link));
139  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilMembershipMailGUI::executeCommand ( )

Definition at line 56 of file class.ilMembershipMailGUI.php.

References ILIAS\Repository\ctrl().

56  : void
57  {
58  $next_class = $this->ctrl->getNextClass($this);
59  $cmd = $this->ctrl->getCmd();
60 
61  switch ($next_class) {
62  default:
63  $this->$cmd();
64  break;
65  }
66  }
+ Here is the call graph for this function:

◆ getCurrentObject()

ilMembershipMailGUI::getCurrentObject ( )

Definition at line 51 of file class.ilMembershipMailGUI.php.

References $object.

Referenced by createMailSignature(), and sendMailToSelectedUsers().

51  : ilObjectGUI
52  {
53  return $this->object;
54  }
Class ilObjectGUI Basic methods of all Output classes.
+ Here is the caller graph for this function:

◆ initMemberIdFromGet()

ilMembershipMailGUI::initMemberIdFromGet ( )
protected

Definition at line 81 of file class.ilMembershipMailGUI.php.

References ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

Referenced by sendMailToSelectedUsers().

81  : int
82  {
83  if ($this->http->wrapper()->query()->has('member_id')) {
84  return $this->http->wrapper()->query()->retrieve(
85  'member_id',
86  $this->refinery->kindlyTo()->int()
87  );
88  }
89  return 0;
90  }
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initRecipientsFromPost()

ilMembershipMailGUI::initRecipientsFromPost ( string  $name)
protected

Definition at line 68 of file class.ilMembershipMailGUI.php.

References ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

Referenced by sendMailToSelectedUsers().

68  : array
69  {
70  if ($this->http->wrapper()->post()->has($name)) {
71  return $this->http->wrapper()->post()->retrieve(
72  $name,
73  $this->refinery->kindlyTo()->listOf(
74  $this->refinery->kindlyTo()->int()
75  )
76  );
77  }
78  return [];
79  }
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendMailToSelectedUsers()

ilMembershipMailGUI::sendMailToSelectedUsers ( )

Definition at line 92 of file class.ilMembershipMailGUI.php.

References ilObjUser\_lookupLogin(), createMailSignature(), ILIAS\Repository\ctrl(), getCurrentObject(), ilMailFormCall\getRedirectTarget(), ILIAS\FileDelivery\http(), initMemberIdFromGet(), initRecipientsFromPost(), and ILIAS\Repository\lng().

92  : void
93  {
94  if ($this->http->wrapper()->query()->has('member_id')) {
95  $particpants = [$this->initMemberIdFromGet()];
96  } else {
97  $particpants = array_unique(array_merge(
98  $this->initRecipientsFromPost('admins'),
99  $this->initRecipientsFromPost('tutors'),
100  $this->initRecipientsFromPost('members'),
101  $this->initRecipientsFromPost('roles'),
102  $this->initRecipientsFromPost('waiting'),
103  $this->initRecipientsFromPost('subscribers')
104  ));
105  }
106 
107  if (!count($particpants)) {
108  $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
109  $this->ctrl->returnToParent($this);
110  return;
111  }
112  $rcps = [];
113  foreach ($particpants as $usr_id) {
114  $rcps[] = ilObjUser::_lookupLogin($usr_id);
115  }
116  $this->ctrl->redirectToURL(
118  $this->getCurrentObject(),
119  'members',
120  [],
121  [
122  'type' => 'new',
123  'rcp_to' => implode(',', $rcps),
124  'sig' => $this->createMailSignature()
125  ]
126  )
127  );
128  }
static http()
Fetches the global http state from ILIAS.
static getRedirectTarget( $gui, string $cmd, array $gui_params=[], array $mail_params=[], array $context_params=[])
static _lookupLogin(int $a_user_id)
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilCtrlInterface ilMembershipMailGUI::$ctrl
protected

Definition at line 33 of file class.ilMembershipMailGUI.php.

◆ $http

GlobalHttpState ilMembershipMailGUI::$http
protected

Definition at line 36 of file class.ilMembershipMailGUI.php.

◆ $lng

ilLanguage ilMembershipMailGUI::$lng
protected

Definition at line 34 of file class.ilMembershipMailGUI.php.

◆ $main_tpl

ilGlobalTemplateInterface ilMembershipMailGUI::$main_tpl
private

Definition at line 38 of file class.ilMembershipMailGUI.php.

◆ $object

ilObjectGUI ilMembershipMailGUI::$object
private

Definition at line 35 of file class.ilMembershipMailGUI.php.

Referenced by __construct(), and getCurrentObject().

◆ $refinery

Factory ilMembershipMailGUI::$refinery
protected

Definition at line 37 of file class.ilMembershipMailGUI.php.


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