"Fossies" - the Fresh Open Source Software Archive

Member "ILIAS-5.4.9/goto.php" (24 Jan 2020, 9064 Bytes) of package /linux/www/ILIAS-5.4.9.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "goto.php" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 5.4.8_vs_5.4.9.

    1 <?php
    2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
    3 
    4 /**
    5 * redirection script
    6 * todo: (a better solution should control the processing
    7 * via a xml file)
    8 *
    9 * $_GET["target"]  should be of format <type>_<id>
   10 *
   11 * @author Alex Killing <alex.killing@gmx.de>
   12 * @package ilias-core
   13 * @version $Id$
   14 */
   15 
   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");
   22 ilInitialisation::initILIAS();
   23 
   24 // special handling for direct navigation request
   25 require_once "./Services/Navigation/classes/class.ilNavigationHistoryGUI.php";
   26 $nav_hist = new ilNavigationHistoryGUI();
   27 $nav_hist->handleNavigationRequest();
   28 
   29 // store original parameter before plugin slot may influence it
   30 $orig_target = $_GET['target'];
   31 
   32 // user interface plugin slot hook
   33 if (is_object($ilPluginAdmin)) {
   34     // get user interface plugins
   35     $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
   36 
   37     // search
   38     foreach ($pl_names as $pl) {
   39         $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
   40         $gui_class = $ui_plugin->getUIClassInstance();
   41         $gui_class->gotoHook();
   42     }
   43 }
   44 
   45 $r_pos = strpos($_GET["target"], "_");
   46 $rest = substr($_GET["target"], $r_pos+1);
   47 $target_arr = explode("_", $_GET["target"]);
   48 $target_type = $target_arr[0];
   49 $target_id = $target_arr[1];
   50 $additional = $target_arr[2];       // optional for pages
   51 
   52 // imprint has no ref id...
   53 if ($target_type == "impr") {
   54     ilUtil::redirect('ilias.php?baseClass=ilImprintGUI');
   55 }
   56 
   57 // goto is not granted?
   58 include_once("Services/Init/classes/class.ilStartUpGUI.php");
   59 if (!ilStartUpGUI::_checkGoto($_GET["target"])) {
   60     // if anonymous: go to login page
   61     if (!$ilUser->getId() || $ilUser->isAnonymous()) {
   62         ilUtil::redirect("login.php?target=" . $orig_target . "&cmd=force_login&lang=" . $ilUser->getCurrentLanguage());
   63     } else {
   64         // message if target given but not accessible
   65         $tarr = explode("_", $_GET["target"]);
   66         if ($tarr[0] != "pg" && $tarr[0] != "st" && $tarr[1] > 0) {
   67             ilUtil::sendFailure(sprintf(
   68                 $lng->txt("msg_no_perm_read_item"),
   69                 ilObject::_lookupTitle(ilObject::_lookupObjId($tarr[1]))
   70             ), true);
   71         }
   72     
   73         ilUtil::redirect('ilias.php?baseClass=ilPersonalDesktopGUI');
   74     }
   75 }
   76 
   77 
   78 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   79 //
   80 //               FOR NEW OBJECT TYPES:
   81 //       PLEASE USE DEFAULT IMPLEMENTATION ONLY
   82 //
   83 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   84 
   85 switch ($target_type) {
   86     // exception, must be kept for now
   87     case "pg":
   88         require_once("./Modules/LearningModule/classes/class.ilLMPageObjectGUI.php");
   89         ilLMPageObjectGUI::_goto($rest);
   90         break;
   91 
   92     // exception, must be kept for now
   93     case "st":
   94         require_once("./Modules/LearningModule/classes/class.ilStructureObjectGUI.php");
   95         ilStructureObjectGUI::_goto($target_id, $additional);
   96         break;
   97 
   98     // exception, must be kept for now
   99     case "git":
  100         require_once("./Modules/Glossary/classes/class.ilGlossaryTermGUI.php");
  101         $target_ref_id = $target_arr[2];
  102         ilGlossaryTermGUI::_goto($target_id, $target_ref_id);
  103         break;
  104 
  105     // please migrate to default branch implementation
  106     case "glo":
  107         require_once("./Modules/Glossary/classes/class.ilObjGlossaryGUI.php");
  108         ilObjGlossaryGUI::_goto($target_id);
  109         break;
  110                 
  111     // please migrate to default branch implementation
  112     case "lm":
  113         require_once("./Modules/LearningModule/classes/class.ilObjContentObjectGUI.php");
  114         ilObjContentObjectGUI::_goto($target_id);
  115         break;
  116 
  117     // please migrate to default branch implementation
  118     case "htlm":
  119         require_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMGUI.php");
  120         ilObjFileBasedLMGUI::_goto($target_id);
  121         break;
  122         
  123     // please migrate to default branch implementation
  124     case "frm":
  125         require_once("./Modules/Forum/classes/class.ilObjForumGUI.php");
  126         $target_thread = $target_arr[2];
  127         $target_posting = $target_arr[3];
  128         ilObjForumGUI::_goto($target_id, $target_thread, $target_posting);
  129         break;
  130         
  131     // please migrate to default branch implementation
  132     case "exc":
  133         require_once("./Modules/Exercise/classes/class.ilObjExerciseGUI.php");
  134         ilObjExerciseGUI::_goto($target_id, $rest);
  135         break;
  136         
  137     // please migrate to default branch implementation
  138     case "tst":
  139         require_once("./Modules/Test/classes/class.ilObjTestGUI.php");
  140         ilObjTestGUI::_goto($target_id);
  141         break;
  142     
  143     // please migrate to default branch implementation
  144     case "qpl":
  145         require_once("./Modules/TestQuestionPool/classes/class.ilObjQuestionPoolGUI.php");
  146         ilObjQuestionPoolGUI::_goto($target_id);
  147         break;
  148 
  149     // please migrate to default branch implementation
  150     case "spl":
  151         require_once("./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPoolGUI.php");
  152         ilObjSurveyQuestionPoolGUI::_goto($target_id);
  153         break;
  154 
  155     // please migrate to default branch implementation
  156     case "svy":
  157         require_once("./Modules/Survey/classes/class.ilObjSurveyGUI.php");
  158         if (array_key_exists("accesscode", $_GET)) {
  159             ilObjSurveyGUI::_goto($target_id, $_GET["accesscode"]);
  160         } else {
  161             ilObjSurveyGUI::_goto($target_id);
  162         }
  163         break;
  164 
  165     // please migrate to default branch implementation
  166     case "webr":
  167         require_once("./Modules/WebResource/classes/class.ilObjLinkResourceGUI.php");
  168         ilObjLinkResourceGUI::_goto($target_id, $rest);
  169         break;
  170 
  171     // please migrate to default branch implementation
  172     case "sahs":
  173         require_once("./Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleGUI.php");
  174         ilObjSAHSLearningModuleGUI::_goto($target_id);
  175         break;
  176 
  177     // please migrate to default branch implementation
  178     case "cat":
  179         require_once("./Modules/Category/classes/class.ilObjCategoryGUI.php");
  180         ilObjCategoryGUI::_goto($target_id);
  181         break;
  182 
  183     // please migrate to default branch implementation
  184     case "crs":
  185         require_once("Modules/Course/classes/class.ilObjCourseGUI.php");
  186         ilObjCourseGUI::_goto($target_id, $additional);
  187         break;
  188 
  189     // please migrate to default branch implementation
  190     case "grp":
  191         require_once("./Modules/Group/classes/class.ilObjGroupGUI.php");
  192         ilObjGroupGUI::_goto($target_id, $additional);
  193         break;
  194         
  195     // please migrate to default branch implementation
  196     case 'fold':
  197         require_once("./Modules/Folder/classes/class.ilObjFolderGUI.php");
  198         ilObjFolderGUI::_goto($target_id);
  199         break;
  200     
  201     // please migrate to default branch implementation
  202     case "file":
  203         require_once("./Modules/File/classes/class.ilObjFileGUI.php");
  204         ilObjFileGUI::_goto($target_id, $rest);
  205         break;
  206 
  207     // please migrate to default branch implementation
  208     case "mcst":
  209         require_once("./Modules/MediaCast/classes/class.ilObjMediaCastGUI.php");
  210         ilObjMediaCastGUI::_goto($target_id);
  211         break;
  212 
  213     // please migrate to default branch implementation
  214     case 'root':
  215         require_once('./Modules/RootFolder/classes/class.ilObjRootFolderGUI.php');
  216         ilObjRootFolderGUI::_goto($target_id);
  217         break;
  218         
  219     // please migrate to default branch implementation
  220     case 'cert':
  221         require_once('./Services/Certificate/classes/class.ilCertificate.php');
  222         ilCertificate::_goto($target_id);
  223         break;
  224 
  225     // links to the documentation of the kitchen sink in the administration
  226     case 'stys':
  227         require_once('./Services/Style/System/classes/class.ilSystemStyleMainGUI.php');
  228         ilSystemStyleMainGUI::_goto($target_id, $target_arr);
  229         break;
  230 
  231     //
  232     // default implementation (should be used by all new object types)
  233     //
  234     default:
  235         if (!$objDefinition->isPlugin($target_type)) {
  236             $class_name = "ilObj" . $objDefinition->getClassName($target_type) . "GUI";
  237             $location = $objDefinition->getLocation($target_type);
  238             if (is_file($location . "/class." . $class_name . ".php")) {
  239                 include_once($location . "/class." . $class_name . ".php");
  240                 call_user_func(array($class_name, "_goto"), $rest);
  241             }
  242         } else {
  243             $class_name = "ilObj" . $objDefinition->getClassName($target_type) . "GUI";
  244             $location = $objDefinition->getLocation($target_type);
  245             if (is_file($location . "/class." . $class_name . ".php")) {
  246                 include_once($location . "/class." . $class_name . ".php");
  247                 call_user_func(array($class_name, "_goto"), array($rest, $class_name));
  248             }
  249         }
  250         break;
  251 }