ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilAccessibilityControlConceptGUI.php
Go to the documentation of this file.
1<?php
2
24{
27 protected ilLanguage $lng;
28 protected ilCtrl $ctrl;
29 protected \ILIAS\HTTP\Services $http;
30 protected ilObjUser $user;
32
33 public function __construct()
34 {
35 global $DIC;
36
37 $ilCtrl = $DIC->ctrl();
38 $tpl = $DIC["tpl"];
39 $lng = $DIC->language();
40 $http = $DIC->http();
41 $user = $DIC->user();
42 $settings = $DIC->settings();
43 $accessibilityEvaluation = $DIC['acc.document.evaluator'];
44
45 $this->ctrl = $ilCtrl;
46 $this->tpl = $tpl;
47 $this->lng = $lng;
48 $this->http = $http;
49 $this->user = $user;
50 $this->settings = $settings;
51 $this->accessibilityEvaluation = $accessibilityEvaluation;
52
53 $this->user->setLanguage($this->lng->getLangKey());
54 }
55
56
57 public function executeCommand()
58 {
59 $cmd = $this->ctrl->getCmd("showControlConcept");
60 if (in_array($cmd, array("showControlConcept"))) {
61 $this->$cmd();
62 }
63 }
64
66 {
67 global $DIC;
68 $gtpl = $DIC['tpl'];
69 $gtpl->setContent($tpl->get());
70 $gtpl->printToStdout("DEFAULT", false, true);
71 }
72
73 protected function initTemplate(string $a_tmpl): ilGlobalTemplate
74 {
75 $tpl = new ilGlobalTemplate("tpl.main.html", true, true);
76 $template_file = $a_tmpl;
77 $template_dir = 'components/ILIAS/Accessibility';
78 $tpl->addBlockFile('CONTENT', 'content', $template_file, $template_dir);
79 return $tpl;
80 }
81
85 protected function showControlConcept(): void
86 {
87 if (!$this->user->getId()) {
88 $this->user->setId(ANONYMOUS_USER_ID);
89 }
90
91 $this->tpl->loadStandardTemplate();
92 $this->tpl->setTitle($this->lng->txt("accessibility_control_concept"));
93
94 $tpl = $this->initTemplate('tpl.view_accessibility_control_concept.html');
95
96 $handleDocument = $this->accessibilityEvaluation->hasDocument();
97 if ($handleDocument) {
98 $document = $this->accessibilityEvaluation->document();
99 $tpl->setVariable('ACCESSIBILITY_CONTROL_CONCEPT_CONTENT', $document->content());
100 } else {
103 : $this->settings->get("admin_email");
104 $tpl->setVariable(
105 'ACCESSIBILITY_CONTROL_CONCEPT_CONTENT',
106 sprintf(
107 $this->lng->txt('no_accessibility_control_concept_description'),
108 'mailto:' . $mails
109 )
110 );
111 }
112
113 $this->printToGlobalTemplate($tpl);
114 }
115
116 public static function getFooterLink(): string
117 {
118 global $DIC;
119 $ilCtrl = $DIC->ctrl();
120
122 return "";
123 }
124
125 return $ilCtrl->getLinkTargetByClass("ilaccessibilitycontrolconceptgui");
126 }
127
128 public static function getFooterText(): string
129 {
130 global $DIC;
131
132 $lng = $DIC->language();
133 return $lng->txt("accessibility_control_concept");
134 }
135}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilAccessibilitySequentialDocumentEvaluation $accessibilityEvaluation
showControlConcept()
Show accessibility control concept.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilCtrl provides processing control methods.
special template class to simplify handling of ITX/PEAR
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)
User class.
ILIAS Setting Class.
const ANONYMOUS_USER_ID
Definition: constants.php:27
setVariable(string $variable, $value='')
Sets the given variable to the given value.
addBlockFile(string $var, string $block, string $template_name, ?string $in_module=null)
overwrites ITX::addBlockFile
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
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