ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilAccessibilitySupportContactsGUI.php
Go to the documentation of this file.
1<?php
2
25{
26 protected ilLanguage $lng;
27 protected ilCtrl $ctrl;
29
30 public function __construct()
31 {
32 global $DIC;
33
34 $ctrl = $DIC->ctrl();
35 $lng = $DIC->language();
36 $http = $DIC->http();
37
38 $this->ctrl = $ctrl;
39 $this->lng = $lng;
40 $this->http = $http;
41 }
42
43 public function executeCommand(): void
44 {
45 $cmd = $this->ctrl->getCmd("sendIssueMail");
46 if (in_array($cmd, array("sendIssueMail"))) {
47 $this->$cmd();
48 }
49 }
50
51 public function sendIssueMail(): void
52 {
53 $back_url = $this->http->request()->getServerParams()["HTTP_REFERER"];
54 $this->ctrl->redirectToURL(
56 $back_url,
57 "",
58 [],
59 [
60 "type" => "new",
61 "rcp_to" => $this->getContactLogins(),
62 "sig" => $this->getAccessibilityIssueMailMessage($back_url)
63 ]
64 )
65 );
66 }
67
68 private function getAccessibilityIssueMailMessage(string $back_url): string
69 {
70 $sig = chr(13) . chr(10) . chr(13) . chr(10) . chr(13) . chr(10);
71 $sig .= $this->lng->txt("report_accessibility_link");
72 $sig .= chr(13) . chr(10);
73 $sig .= $back_url;
74 $sig = rawurlencode(base64_encode($sig));
75
76 return $sig;
77 }
78
82 private function getContactLogins(): string
83 {
84 $logins = [];
85
87 $logins[] = ilObjUser::_lookupLogin($contact_id);
88 }
89
90 return implode(",", $logins);
91 }
92
93 public static function getFooterLink(): string
94 {
95 global $DIC;
96
97 $ctrl = $DIC->ctrl();
98 $user = $DIC->user();
99 $http = $DIC->http();
100 $lng = $DIC->language();
101 $rbac_system = $DIC->rbac()->system();
102
104 if (count($contacts) > 0) {
105 if ($rbac_system->checkAccess("internal_mail", ilMailGlobalServices::getMailObjectRefId())) {
106 return ILIAS_HTTP_PATH . "/" . $ctrl->getLinkTargetByClass("ilaccessibilitysupportcontactsgui", "");
107 } else {
110 );
111 $request_scheme =
112 isset($http->request()->getServerParams()["HTTPS"])
113 && $http->request()->getServerParams()["HTTPS"] !== "off"
114 ? "https" : "http";
115 $url = $request_scheme . "://"
116 . $http->request()->getServerParams()["HTTP_HOST"]
117 . $http->request()->getServerParams()["REQUEST_URI"];
118 return "mailto:" . $mails . "?body=%0D%0A%0D%0A" . $lng->txt("report_accessibility_link_mailto") . "%0A" . rawurlencode($url);
119 }
120 }
121 return "";
122 }
123
124 public static function getFooterText(): string
125 {
126 global $DIC;
127
128 $lng = $DIC->language();
129 return $lng->txt("report_accessibility_issue");
130 }
131}
Class Services.
Definition: Services.php:38
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getContactLogins()
Get accessibility support contacts as comma separated string.
static getValidSupportContactIds()
Get valid support contacts.
Class ilCtrl provides processing control methods.
getLinkTargetByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc
language handling
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static prepareFormOutput($a_str, bool $a_strip=false)
static getRedirectTarget( $gui, string $cmd, array $gui_params=[], array $mail_params=[], array $context_params=[])
static _lookupLogin(int $a_user_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:26
$url
Definition: shib_logout.php:68