ILIAS  release_8 Revision v8.24
goto.php
Go to the documentation of this file.
1<?php
2
20require_once("libs/composer/vendor/autoload.php");
21
24
25$requested_target = $DIC->http()->wrapper()->query()->has("target")
26 ? $DIC->http()->wrapper()->query()->retrieve(
27 "target",
28 $DIC->refinery()->to()->string()
29 )
30 : '';
31
32// special handling for direct navigation request
34$nav_hist->handleNavigationRequest();
35
36// store original parameter before plugin slot may influence it
38
39// user interface plugin slot hook
40if (is_object($ilPluginAdmin)) {
41 // search
42 foreach ($DIC["component.factory"]->getActivePluginsInSlot("uihk") as $ui_plugin) {
43 $gui_class = $ui_plugin->getUIClassInstance();
44 $gui_class->gotoHook();
45 }
46}
47
52$target_id = $target_arr[1] ?? ''; // optional for plugins
53$additional = $target_arr[2] ?? ''; // optional for pages
54
55// imprint has no ref id...
56if ($target_type === "impr") {
57 $DIC->ctrl()->redirectToURL('ilias.php?baseClass=ilImprintGUI');
58}
59
60// goto is not granted?
62 // if anonymous: go to login page
63 if ($DIC->user()->getId() === 0 || $DIC->user()->isAnonymous()) {
64 $url = "login.php?target="
65 . $orig_target . "&cmd=force_login&lang="
66 . $DIC->user()->getCurrentLanguage();
67 if ($DIC->http()->wrapper()->query()->has('soap_pw')) {
69 $url,
70 'soap_pw=' . $DIC->http()->wrapper()->query()->retrieve(
71 'soap_pw',
72 $DIC->refinery()->kindlyTo()->string()
73 )
74 );
75 }
76 if ($DIC->http()->wrapper()->query()->has('ext_uid')) {
78 $url,
79 'ext_uid=' . $DIC->http()->wrapper()->query()->retrieve(
80 'ext_uid',
81 $DIC->refinery()->kindlyTo()->string()
82 )
83 );
84 }
85 $DIC->ctrl()->redirectToURL($url);
86 } else {
87 // message if target given but not accessible
88 $tarr = explode("_", $requested_target);
89 if ($tarr[0] !== "pg" && $tarr[0] !== "st" && isset($tarr[1]) && is_numeric($tarr[1]) && $tarr[1] > 0) {
90 $DIC->ui()->mainTemplate()->setOnScreenMessage(
91 'failure',
92 sprintf(
93 $DIC->language()->txt("msg_no_perm_read_item"),
95 ),
96 true
97 );
98 } else {
99 global $DIC;
100 $DIC->ui()->mainTemplate()->setOnScreenMessage('failure', $DIC->language()->txt('permission_denied'), true);
101 }
102 $DIC->ctrl()->redirectToURL(ilUserUtil::getStartingPointAsUrl());
103 }
104}
105
106
107// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
108//
109// FOR NEW OBJECT TYPES:
110// PLEASE USE DEFAULT IMPLEMENTATION ONLY
111//
112// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
113
114switch ($target_type) {
115 // exception, must be kept for now
116 case "pg":
118 break;
119
120 // exception, must be kept for now
121 case "st":
123 break;
124
125 // exception, must be kept for now
126 case "git":
127 $target_ref_id = $target_arr[2] ?? 0;
128 ilGlossaryTermGUI::_goto($target_id, $target_ref_id);
129 break;
130
131 // please migrate to default branch implementation
132 case "glo":
134 break;
135
136 // please migrate to default branch implementation
137 case "lm":
139 break;
140
141 // please migrate to default branch implementation
142 case "htlm":
144 break;
145
146 // please migrate to default branch implementation
147 case "frm":
148 $target_thread = isset($target_arr[2]) ? $target_arr[2] : 0;
149 $target_posting = isset($target_arr[3]) ? $target_arr[3] : 0;
150 ilObjForumGUI::_goto($target_id, $target_thread, $target_posting);
151 break;
152
153 // please migrate to default branch implementation
154 case "exc":
156 break;
157
158 // please migrate to default branch implementation
159 case "tst":
160 ilObjTestGUI::_goto($target_id, $target_arr);
161 break;
162
163 // please migrate to default branch implementation
164 case "qpl":
166 break;
167
168 // please migrate to default branch implementation
169 case "webr":
171 break;
172
173 // please migrate to default branch implementation
174 case "sahs":
176 break;
177
178 // please migrate to default branch implementation
179 case "crs":
181 break;
182
183 // please migrate to default branch implementation
184 case "grp":
186 break;
187
188 // please migrate to default branch implementation
189 case "file":
191 break;
192
193 // please migrate to default branch implementation
194 case 'cert':
195 ilCertificate::_goto($target_id);
196 break;
197
198 // links to the documentation of the kitchen sink in the administration
199 case 'stys':
200 (new ilKSDocumentationGotoLink())->redirectWithGotoLink($target_id, $target_arr, $DIC->ctrl());
201 break;
202
203 //
204 // default implementation (should be used by all new object types)
205 //
206 default:
207 global $objDefinition;
208 if (!$objDefinition->isPlugin($target_type)) {
209 $class_name = "ilObj" . $objDefinition->getClassName($target_type) . "GUI";
210 $location = $objDefinition->getLocation($target_type);
211 if (is_file($location . "/class." . $class_name . ".php")) {
212 include_once($location . "/class." . $class_name . ".php");
213 call_user_func(array($class_name, "_goto"), $rest);
214 }
215 } else {
216 $class_name = "ilObj" . $objDefinition->getClassName($target_type) . "GUI";
217 $location = $objDefinition->getLocation($target_type);
218 if (is_file($location . "/class." . $class_name . ".php")) {
219 call_user_func(array($class_name, "_goto"), array($rest, $class_name));
220 }
221 }
222 break;
223}
$location
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: buildRTE.php:22
static _goto(string $a_target, int $a_ref_id=0)
static initILIAS()
ilias initialisation
static _goto(string $a_target)
redirect script
User Interface Class for Navigation History.
static _goto(string $a_target)
static _goto($a_target, string $a_add="")
static _goto(string $a_target, string $a_raw)
static _goto(string $a_target)
static _goto($a_target, $a_additional=null)
static _goto($a_target, $a_thread=0, $a_posting=0)
static _goto(string $a_target)
static _goto(int $a_target, string $a_add="")
static _goto(string $a_target, $a_additional=null)
static _goto($a_target)
Redirect script to call a test with the question pool reference id.
static _goto(string $a_target)
goto target course
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
static _checkGoto($a_target)
Return type depends on _checkGoto calls.
static _goto(string $a_target, int $a_target_ref_id=0)
static appendUrlParameterString(string $a_url, string $a_par, bool $xml_style=false)
global $DIC
Definition: goto.php:23
$orig_target
Definition: goto.php:37
$nav_hist
Definition: goto.php:33
$target_id
Definition: goto.php:52
$target_arr
Definition: goto.php:50
$additional
Definition: goto.php:53
$requested_target
Definition: goto.php:25
if(is_object($ilPluginAdmin)) $r_pos
Definition: goto.php:48
$rest
Definition: goto.php:49
global $ilPluginAdmin
Definition: goto.php:23
$target_type
Definition: goto.php:51
$url