ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilAccessibilitySupportContactsGUI.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
4
11{
15 protected $tpl;
16
20 protected $lng;
21
25 protected $ctrl;
26
30 protected $http;
31
35 public function __construct()
36 {
37 global $DIC;
38
39 $ctrl = $DIC->ctrl();
40 $tpl = $DIC["tpl"];
41 $lng = $DIC->language();
42 $http = $DIC->http();
43
44 $this->ctrl = $ctrl;
45 $this->tpl = $tpl;
46 $this->lng = $lng;
47 $this->http = $http;
48 }
49
50
54 public function executeCommand()
55 {
56 $cmd = $this->ctrl->getCmd("sendIssueMail");
57 if (in_array($cmd, array("sendIssueMail"))) {
58 $this->$cmd();
59 }
60 }
61
62
63 public function sendIssueMail() : void
64 {
65 $back_url = $this->http->request()->getServerParams()['HTTP_REFERER'];
66 $this->ctrl->redirectToURL(
68 $back_url,
69 '',
70 [],
71 [
72 'type' => 'new',
73 'rcp_to' => $this->getContactLogins(),
74 'sig' => $this->getAccessibilityIssueMailMessage($back_url)
75 ]
76 )
77 );
78 }
79
83 private function getAccessibilityIssueMailMessage(string $back_url) : string
84 {
85 $sig = chr(13) . chr(10) . chr(13) . chr(10) . chr(13) . chr(10);
86 $sig .= $this->lng->txt('report_accessibility_link');
87 $sig .= chr(13) . chr(10);
88 $sig .= $back_url;
89 $sig = rawurlencode(base64_encode($sig));
90
91 return $sig;
92 }
93
99 private function getContactLogins() : string
100 {
101 $logins = [];
102
104 $logins[] = ilObjUser::_lookupLogin($contact_id);
105 }
106
107 return implode(',', $logins);
108 }
109
115 public static function getFooterLink()
116 {
117 global $DIC;
118
119 $ctrl = $DIC->ctrl();
120 $user = $DIC->user();
121 $http = $DIC->http();
122 $lng = $DIC->language();
123 $rbac_system = $DIC->rbac()->system();
124
126 if (count($contacts) > 0) {
127 if ($rbac_system->checkAccess("internal_mail", ilMailGlobalServices::getMailObjectRefId())) {
128 return $ctrl->getLinkTargetByClass("ilaccessibilitysupportcontactsgui", "");
129 } else {
132 );
133 $request_scheme =
134 isset($http->request()->getServerParams()['HTTPS'])
135 && $http->request()->getServerParams()['HTTPS'] !== 'off'
136 ? 'https' : 'http';
137 $url = $request_scheme . '://'
138 . $http->request()->getServerParams()['HTTP_HOST']
139 . $http->request()->getServerParams()['REQUEST_URI'];
140 return "mailto:" . $mails . "?body=%0D%0A%0D%0A" . $lng->txt("report_accessibility_link_mailto") . "%0A" . rawurlencode($url);
141 }
142 }
143 return "";
144 }
145
151 public static function getFooterText()
152 {
153 global $DIC;
154
155 $lng = $DIC->language();
156 return $lng->txt("report_accessibility_issue");
157 }
158}
An exception for terminatinating execution or to throw for unit testing.
getContactLogins()
Get accessibility support contacts as comma separated string.
static getValidSupportContactIds()
Get valid support contacts.
static getRedirectTarget( $gui, string $cmd, array $gui_params=[], array $mail_params=[], array $context_params=[])
static getMailObjectRefId()
Determines the reference id of the mail object and stores this information in a local cache variable.
static _lookupLogin($a_user_id)
lookup login
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
global $DIC
Definition: goto.php:24
static http()
Fetches the global http state from ILIAS.
$url