ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
goto.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
16 //var_dump ($_SESSION);
17 //var_dump ($_COOKIE);
18 
19 // this should bring us all session data of the desired
20 // client
21 require_once("Services/Init/classes/class.ilInitialisation.php");
23 
24 global $DIC;
25 
26 // special handling for direct navigation request
27 require_once "./Services/Navigation/classes/class.ilNavigationHistoryGUI.php";
29 $nav_hist->handleNavigationRequest();
30 
31 // store original parameter before plugin slot may influence it
32 $orig_target = $_GET['target'];
33 
34 // user interface plugin slot hook
35 if (is_object($DIC['ilPluginAdmin'])) {
36  // get user interface plugins
37  $pl_names = $DIC['ilPluginAdmin']->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
38 
39  // search
40  foreach ($pl_names as $pl) {
41  $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
42  $gui_class = $ui_plugin->getUIClassInstance();
43  $gui_class->gotoHook();
44  }
45 }
46 
47 $r_pos = strpos($_GET["target"], "_");
48 $rest = substr($_GET["target"], $r_pos+1);
49 $target_arr = explode("_", $_GET["target"]);
52 $additional = $target_arr[2]; // optional for pages
53 
54 // imprint has no ref id...
55 if ($target_type == "impr") {
56  ilUtil::redirect('ilias.php?baseClass=ilImprintGUI');
57 }
58 
59 // goto is not granted?
60 include_once("Services/Init/classes/class.ilStartUpGUI.php");
61 if (!ilStartUpGUI::_checkGoto($_GET["target"])) {
62  // if anonymous: go to login page
63  if (!$DIC->user()->getId() || $DIC->user()->isAnonymous()) {
64  $url = "login.php?target=" . $orig_target . "&cmd=force_login&lang=" . $DIC->user()->getCurrentLanguage();
65  if (isset($DIC->http()->request()->getQueryParams()['soap_pw'])) {
66  $url = ilUtil::appendUrlParameterString($url, 'soap_pw=' . $DIC->http()->request()->getQueryParams()['soap_pw']);
67  }
68  if (isset($DIC->http()->request()->getQueryParams()['ext_uid'])) {
69  $url = ilUtil::appendUrlParameterString($url, 'ext_uid=' . $DIC->http()->request()->getQueryParams()['ext_uid']);
70  }
72  } else {
73  // message if target given but not accessible
74  $tarr = explode("_", $_GET["target"]);
75  if ($tarr[0] != "pg" && $tarr[0] != "st" && $tarr[1] > 0) {
76  ilUtil::sendFailure(sprintf(
77  $DIC->language()->txt("msg_no_perm_read_item"),
79  ), true);
80  } else {
81  ilUtil::sendFailure($lng->txt('permission_denied'), true);
82  }
83  ilUtil::redirect(ilUserUtil::getStartingPointAsUrl());
84  }
85 }
86 
87 
88 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
89 //
90 // FOR NEW OBJECT TYPES:
91 // PLEASE USE DEFAULT IMPLEMENTATION ONLY
92 //
93 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
94 
95 switch ($target_type) {
96  // exception, must be kept for now
97  case "pg":
99  break;
100 
101  // exception, must be kept for now
102  case "st":
104  break;
105 
106  // exception, must be kept for now
107  case "git":
108  $target_ref_id = $target_arr[2];
109  ilGlossaryTermGUI::_goto($target_id, $target_ref_id);
110  break;
111 
112  // please migrate to default branch implementation
113  case "glo":
115  break;
116 
117  // please migrate to default branch implementation
118  case "lm":
120  break;
121 
122  // please migrate to default branch implementation
123  case "htlm":
125  break;
126 
127  // please migrate to default branch implementation
128  case "frm":
129  require_once("./Modules/Forum/classes/class.ilObjForumGUI.php");
130  $target_thread = $target_arr[2];
131  $target_posting = $target_arr[3];
132  ilObjForumGUI::_goto($target_id, $target_thread, $target_posting);
133  break;
134 
135  // please migrate to default branch implementation
136  case "exc":
138  break;
139 
140  // please migrate to default branch implementation
141  case "tst":
142  require_once("./Modules/Test/classes/class.ilObjTestGUI.php");
144  break;
145 
146  // please migrate to default branch implementation
147  case "qpl":
148  require_once("./Modules/TestQuestionPool/classes/class.ilObjQuestionPoolGUI.php");
149  ilObjQuestionPoolGUI::_goto($target_id);
150  break;
151 
152  // please migrate to default branch implementation
153  case "spl":
154  require_once("./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPoolGUI.php");
156  break;
157 
158  // please migrate to default branch implementation
159  case "svy":
160  require_once("./Modules/Survey/classes/class.ilObjSurveyGUI.php");
161  if (array_key_exists("accesscode", $_GET)) {
162  ilObjSurveyGUI::_goto($target_id, $_GET["accesscode"]);
163  } else {
165  }
166  break;
167 
168  // please migrate to default branch implementation
169  case "webr":
170  require_once("./Modules/WebResource/classes/class.ilObjLinkResourceGUI.php");
172  break;
173 
174  // please migrate to default branch implementation
175  case "sahs":
176  require_once("./Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleGUI.php");
178  break;
179 
180  // please migrate to default branch implementation
181  case "cat":
182  require_once("./Modules/Category/classes/class.ilObjCategoryGUI.php");
184  break;
185 
186  // please migrate to default branch implementation
187  case "crs":
188  require_once("Modules/Course/classes/class.ilObjCourseGUI.php");
190  break;
191 
192  // please migrate to default branch implementation
193  case "grp":
194  require_once("./Modules/Group/classes/class.ilObjGroupGUI.php");
196  break;
197 
198  // please migrate to default branch implementation
199  case 'fold':
200  require_once("./Modules/Folder/classes/class.ilObjFolderGUI.php");
202  break;
203 
204  // please migrate to default branch implementation
205  case "file":
206  require_once("./Modules/File/classes/class.ilObjFileGUI.php");
208  break;
209 
210  // please migrate to default branch implementation
211  case "mcst":
213  break;
214 
215  // please migrate to default branch implementation
216  case 'root':
217  require_once('./Modules/RootFolder/classes/class.ilObjRootFolderGUI.php');
219  break;
220 
221  // please migrate to default branch implementation
222  case 'cert':
223  require_once('./Services/Certificate/classes/class.ilCertificate.php');
224  ilCertificate::_goto($target_id);
225  break;
226 
227  // links to the documentation of the kitchen sink in the administration
228  case 'stys':
229  require_once('./Services/Style/System/classes/class.ilSystemStyleMainGUI.php');
231  break;
232 
233  //
234  // default implementation (should be used by all new object types)
235  //
236  default:
237  if (!$DIC['objDefinition']->isPlugin($target_type)) {
238  $class_name = "ilObj" . $DIC['objDefinition']->getClassName($target_type) . "GUI";
239  $location = $DIC['objDefinition']->getLocation($target_type);
240  if (is_file($location . "/class." . $class_name . ".php")) {
241  include_once($location . "/class." . $class_name . ".php");
242  call_user_func(array($class_name, "_goto"), $rest);
243  }
244  } else {
245  $class_name = "ilObj" . $DIC['objDefinition']->getClassName($target_type) . "GUI";
246  $location = $DIC['objDefinition']->getLocation($target_type);
247  if (is_file($location . "/class." . $class_name . ".php")) {
248  include_once($location . "/class." . $class_name . ".php");
249  call_user_func(array($class_name, "_goto"), array($rest, $class_name));
250  }
251  }
252  break;
253 }
static _checkGoto($a_target)
$target_arr
Definition: goto.php:49
$rest
Definition: goto.php:48
static _goto($a_target, $a_access_code="")
redirect script
$target_type
Definition: goto.php:50
static _goto($a_target, $a_thread=0, $a_posting=0)
$_GET["client_id"]
$location
Definition: buildRTE.php:44
$orig_target
Definition: goto.php:32
static _goto($a_target)
Redirect script to call a test with the test reference id.
$target_id
Definition: goto.php:51
static _lookupTitle($a_id)
lookup object title
static _goto($a_target, $a_target_ref_id="")
redirect script
static _goto($a_target, $a_add="")
goto target course
static _goto($a_target)
redirect script
static _goto($a_target)
goto target group
static _goto($a_target)
Redirect script to call a survey question pool reference id.
static _goto($a_target, $a_additional=null)
static _goto($a_target, $a_raw)
redirect script
static _goto($a_target, $a_ref_id="")
redirect script
User Interface Class for Navigation History.
if(is_object($DIC['ilPluginAdmin'])) $r_pos
Definition: goto.php:47
static _goto($a_target)
goto target course
static initILIAS()
ilias initialisation
static _goto($a_target)
redirect script
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
$lng
static _lookupObjId($a_id)
global $DIC
Definition: goto.php:24
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get Plugin Object.
static _goto($ref_id, $params)
$additional
Definition: goto.php:52
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$nav_hist
Definition: goto.php:28
static _goto($a_target, $a_add="")
goto target group
static _goto($a_target)
redirect script
static _goto($a_target, $a_additional=null)
$url
static _goto($a_target)
goto target group
static redirect($a_script)
const IL_COMP_SERVICE
static _goto($a_target)
redirect script