ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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.

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:26

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

+ Here is the call graph for this function:

Member Function Documentation

◆ createMailSignature()

ilMembershipMailGUI::createMailSignature ( )
protected

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

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 }

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

Referenced by sendMailToSelectedUsers().

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

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 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ getCurrentObject()

ilMembershipMailGUI::getCurrentObject ( )

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

52 {
53 return $this->object;
54 }
Class ilObjectGUI Basic methods of all Output classes.

References $object.

Referenced by createMailSignature(), and sendMailToSelectedUsers().

+ Here is the caller graph for this function:

◆ initMemberIdFromGet()

ilMembershipMailGUI::initMemberIdFromGet ( )
protected

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

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 }

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

Referenced by sendMailToSelectedUsers().

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

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 }

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

Referenced by sendMailToSelectedUsers().

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

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 getRedirectTarget( $gui, string $cmd, array $gui_params=[], array $mail_params=[], array $context_params=[])
static _lookupLogin(int $a_user_id)

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

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