/**
  * execute command
  *
  * @access public
  * @return
  */
 public function executeCommand()
 {
     global $ilUser, $ilCtrl;
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     $this->prepareOutput();
     switch ($next_class) {
         case "ilinfoscreengui":
             $this->checkPermission("visible");
             $this->infoScreen();
             // forwards command
             break;
         case 'ilpermissiongui':
             $this->tabs_gui->setTabActive('perm_settings');
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui = new ilPermissionGUI($this);
             $ret = $this->ctrl->forwardCommand($perm_gui);
             break;
         case 'ilobjectcopygui':
             include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
             $cp = new ilObjectCopyGUI($this);
             $cp->setType('sess');
             $this->ctrl->forwardCommand($cp);
             break;
         case "ilexportgui":
             //				$this->prepareOutput();
             $this->tabs_gui->setTabActive("export");
             include_once "./Services/Export/classes/class.ilExportGUI.php";
             $exp_gui = new ilExportGUI($this);
             $exp_gui->addFormat("xml");
             $ret = $this->ctrl->forwardCommand($exp_gui);
             //				$this->tpl->show();
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         default:
             if (!$cmd) {
                 $cmd = "infoScreen";
             }
             $cmd .= "Object";
             if ($cmd != "infoScreenObject") {
                 $this->checkPermission("read");
             } else {
                 $this->checkPermission("visible");
             }
             $this->{$cmd}();
             break;
     }
     $this->addHeaderAction();
     return true;
 }
 function &executeCommand()
 {
     switch ($this->ctrl->getNextClass($this)) {
         case 'ilobjectcopygui':
             include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
             $cp = new ilObjectCopyGUI($this);
             $cp->setType('crs');
             $this->ctrl->forwardCommand($cp);
             break;
         default:
             $cmd = $this->ctrl->getCmd();
             if (!($cmd = $this->ctrl->getCmd())) {
                 $cmd = "view";
             }
             $this->{$cmd}();
             break;
     }
 }
 /**
  * main switch
  */
 function executeCommand()
 {
     global $tpl, $ilTabs, $ilNavigationHistory;
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     if (!$next_class && $cmd == 'render') {
         $this->ctrl->setCmdClass('ilBookingObjectGUI');
         $next_class = $this->ctrl->getNextClass($this);
     }
     if (substr($cmd, 0, 4) == 'book') {
         $next_class = '';
     }
     $ilNavigationHistory->addItem($this->ref_id, "./goto.php?target=book_" . $this->ref_id, "book");
     $this->prepareOutput();
     switch ($next_class) {
         case 'ilpermissiongui':
             $this->tabs_gui->setTabActive('perm_settings');
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui =& new ilPermissionGUI($this);
             $ret =& $this->ctrl->forwardCommand($perm_gui);
             break;
         case 'ilbookingobjectgui':
             $this->tabs_gui->setTabActive('render');
             include_once "Modules/BookingManager/classes/class.ilBookingObjectGUI.php";
             $object_gui =& new ilBookingObjectGUI($this);
             $ret =& $this->ctrl->forwardCommand($object_gui);
             break;
         case 'ilbookingschedulegui':
             $this->tabs_gui->setTabActive('schedules');
             include_once "Modules/BookingManager/classes/class.ilBookingScheduleGUI.php";
             $schedule_gui =& new ilBookingScheduleGUI($this);
             $ret =& $this->ctrl->forwardCommand($schedule_gui);
             break;
         case 'ilpublicuserprofilegui':
             $ilTabs->clearTargets();
             include_once "Services/User/classes/class.ilPublicUserProfileGUI.php";
             $profile = new ilPublicUserProfileGUI((int) $_GET["user_id"]);
             $profile->setBackUrl($this->ctrl->getLinkTarget($this, 'log'));
             $ret = $this->ctrl->forwardCommand($profile);
             $tpl->setContent($ret);
             break;
         case 'ilinfoscreengui':
             $this->infoScreen();
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case "ilobjectcopygui":
             include_once "./Services/Object/classes/class.ilObjectCopyGUI.php";
             $cp = new ilObjectCopyGUI($this);
             $cp->setType("book");
             $this->ctrl->forwardCommand($cp);
             break;
         default:
             $cmd = $this->ctrl->getCmd();
             $cmd .= 'Object';
             $this->{$cmd}();
             break;
     }
     $this->addHeaderAction();
     return true;
 }
 function executeCommand()
 {
     global $ilUser, $ilCtrl, $ilTabs, $lng;
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     $this->prepareOutput();
     //echo "-".$next_class."-".$cmd."-"; exit;
     switch ($next_class) {
         case "ilfilesystemgui":
             $this->checkPermission("write");
             if ($_GET["fsmode"] == "peer") {
                 $ilCtrl->saveParameter($this, array("fu"));
                 // see self::downloadPeerReview()
                 $parts = explode("__", $_GET["fu"]);
                 $giver_id = $parts[0];
                 $peer_id = $parts[1];
                 if ($giver_id == $ilUser->getId() || $peer_id == $ilUser->getId()) {
                     $this->checkPermission("read");
                 } else {
                     $this->checkPermission("write");
                 }
                 $valid = false;
                 $peer_items = $this->ass->getPeerReviewsByPeerId($peer_id, true);
                 if (sizeof($peer_items)) {
                     foreach ($peer_items as $item) {
                         if ($item["giver_id"] == $giver_id) {
                             $valid = true;
                         }
                     }
                 }
                 if (!$valid) {
                     $ilCtrl->redirect($this, "editPeerReview");
                 }
                 $ilTabs->clearTargets();
                 $ilTabs->setBackTarget($lng->txt("back"), $ilCtrl->getLinkTarget($this, "editPeerReview"));
                 include_once "./Modules/Exercise/classes/class.ilFSStorageExercise.php";
                 $fstorage = new ilFSStorageExercise($this->object->getId(), $this->ass->getId());
                 $fstorage->create();
                 include_once "./Services/FileSystem/classes/class.ilFileSystemGUI.php";
                 $fs_gui = new ilFileSystemGUI($fstorage->getPeerReviewUploadPath($peer_id, $giver_id));
                 $fs_gui->setTableId("excfbpeer");
                 $fs_gui->setAllowDirectories(false);
                 $fs_gui->setTitle($this->ass->getTitle() . ": " . $lng->txt("exc_peer_review") . " - " . $lng->txt("exc_peer_review_give"));
                 $ret = $this->ctrl->forwardCommand($fs_gui);
             } else {
                 if ($_GET["fsmode"] == "feedback" || $_GET["fsmode"] == "feedbackpart") {
                     $ilCtrl->saveParameter($this, array("member_id"));
                     //$this->setAssignmentHeader();
                     //$ilTabs->activateTab("ass_files");
                     $ilTabs->clearTargets();
                     if ($_GET["fsmode"] != "feedbackpart") {
                         $ilTabs->setBackTarget($lng->txt("back"), $ilCtrl->getLinkTarget($this, "members"));
                     } else {
                         $ilTabs->setBackTarget($lng->txt("back"), $ilCtrl->getLinkTarget($this, "showParticipant"));
                     }
                     ilUtil::sendInfo($lng->txt("exc_fb_tutor_info"));
                     include_once "./Modules/Exercise/classes/class.ilFSStorageExercise.php";
                     $fstorage = new ilFSStorageExercise($this->object->getId(), (int) $_GET["ass_id"]);
                     $fstorage->create();
                     include_once "./Services/User/classes/class.ilUserUtil.php";
                     $noti_rec_ids = array();
                     if ($this->ass->getType() == ilExAssignment::TYPE_UPLOAD_TEAM) {
                         $team_id = $this->ass->getTeamId((int) $_GET["member_id"]);
                         $feedback_id = "t" . $team_id;
                         $fs_title = array();
                         foreach ($this->ass->getTeamMembers($team_id) as $team_user_id) {
                             $fs_title[] = ilUserUtil::getNamePresentation($team_user_id, false, false, "", true);
                             $noti_rec_ids[] = $team_user_id;
                         }
                         $fs_title = implode(" / ", $fs_title);
                     } else {
                         $feedback_id = $noti_rec_ids = (int) $_GET["member_id"];
                         $fs_title = ilUserUtil::getNamePresentation((int) $_GET["member_id"], false, false, "", true);
                     }
                     include_once "./Services/FileSystem/classes/class.ilFileSystemGUI.php";
                     $fs_gui = new ilFileSystemGUI($fstorage->getFeedbackPath($feedback_id));
                     $fs_gui->setTableId("excfbfil" . (int) $_GET["ass_id"] . "_" . $feedback_id);
                     $fs_gui->setAllowDirectories(false);
                     $fs_gui->setTitle($lng->txt("exc_fb_files") . " - " . ilExAssignment::lookupTitle((int) $_GET["ass_id"]) . " - " . $fs_title);
                     $pcommand = $fs_gui->getLastPerformedCommand();
                     if (is_array($pcommand) && $pcommand["cmd"] == "create_file") {
                         $this->object->sendFeedbackFileNotification($pcommand["name"], $noti_rec_ids, (int) $_GET["ass_id"]);
                     }
                     $ret = $this->ctrl->forwardCommand($fs_gui);
                 } else {
                     $this->setAssignmentHeader();
                     $ilTabs->activateTab("ass_files");
                     include_once "./Modules/Exercise/classes/class.ilFSStorageExercise.php";
                     $fstorage = new ilFSStorageExercise($this->object->getId(), (int) $_GET["ass_id"]);
                     $fstorage->create();
                     include_once "./Services/FileSystem/classes/class.ilFileSystemGUI.php";
                     $fs_gui = new ilFileSystemGUI($fstorage->getPath());
                     $fs_gui->setTitle($lng->txt("exc_instruction_files"));
                     $fs_gui->setTableId("excassfil" . $_GET["ass_id"]);
                     $fs_gui->setAllowDirectories(false);
                     $ret = $this->ctrl->forwardCommand($fs_gui);
                 }
             }
             break;
         case "ilinfoscreengui":
             $ilTabs->activateTab("info");
             $this->infoScreen();
             // forwards command
             break;
         case 'ilpermissiongui':
             $ilTabs->activateTab("permissions");
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui =& new ilPermissionGUI($this);
             $ret =& $this->ctrl->forwardCommand($perm_gui);
             break;
         case "illearningprogressgui":
             $ilTabs->activateTab("learning_progress");
             include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
             $new_gui =& new ilLearningProgressGUI(ilLearningProgressGUI::LP_CONTEXT_REPOSITORY, $this->object->getRefId(), $_GET['user_id'] ? $_GET['user_id'] : $ilUser->getId());
             $this->ctrl->forwardCommand($new_gui);
             $this->tabs_gui->setTabActive('learning_progress');
             break;
         case 'ilrepositorysearchgui':
             $ilTabs->activateTab("grades");
             include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
             $rep_search = new ilRepositorySearchGUI();
             if (!$_REQUEST["ctx"]) {
                 $rep_search->setTitle($this->lng->txt("exc_add_participant"));
                 $rep_search->setCallback($this, 'addMembersObject');
                 // Set tabs
                 $this->tabs_gui->setTabActive('members');
                 $this->ctrl->setReturn($this, 'members');
                 #$this->__setSubTabs('members');
                 #$this->tabs_gui->setSubTabActive('members');
             } else {
                 $this->ctrl->saveParameterByClass('ilRepositorySearchGUI', 'ctx', 1);
                 $rep_search->setTitle($this->lng->txt("exc_team_member_add"));
                 $rep_search->setCallback($this, 'addTeamMemberActionObject');
                 // Set tabs
                 $this->initTeamSubmission("submissionScreenTeam");
                 $this->ctrl->setReturn($this, 'submissionScreenTeam');
             }
             $ret =& $this->ctrl->forwardCommand($rep_search);
             break;
         case 'ilobjectcopygui':
             $ilCtrl->saveParameter($this, 'new_type');
             $ilCtrl->setReturnByClass(get_class($this), 'create');
             include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
             $cp = new ilObjectCopyGUI($this);
             $cp->setType('exc');
             $this->ctrl->forwardCommand($cp);
             break;
         case "ilexportgui":
             $ilTabs->activateTab("export");
             include_once "./Services/Export/classes/class.ilExportGUI.php";
             $exp_gui = new ilExportGUI($this);
             $exp_gui->addFormat("xml");
             $ret = $this->ctrl->forwardCommand($exp_gui);
             //				$this->tpl->show();
             break;
         case 'ilshoppurchasegui':
             include_once './Services/Payment/classes/class.ilShopPurchaseGUI.php';
             $sp = new ilShopPurchaseGUI($_GET['ref_id']);
             $this->ctrl->forwardCommand($sp);
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case "ilcertificategui":
             $this->setSettingsSubTabs();
             $this->tabs_gui->activateTab("settings");
             $this->tabs_gui->activateSubTab("certificate");
             include_once "./Services/Certificate/classes/class.ilCertificateGUI.php";
             include_once "./Modules/Exercise/classes/class.ilExerciseCertificateAdapter.php";
             $output_gui = new ilCertificateGUI(new ilExerciseCertificateAdapter($this->object));
             $this->ctrl->forwardCommand($output_gui);
             break;
         case "ilratinggui":
             $this->ass->updatePeerReviewTimestamp((int) $_REQUEST["peer_id"]);
             include_once "./Services/Rating/classes/class.ilRatingGUI.php";
             $rating_gui = new ilRatingGUI();
             $rating_gui->setObject($this->ass->getId(), "ass", (int) $_REQUEST["peer_id"], "peer");
             $this->ctrl->forwardCommand($rating_gui);
             $ilCtrl->redirect($this, "editPeerReview");
             break;
         default:
             $this->ctrl->setParameter($this, "fsmode", "");
             // #15115
             if (!$cmd) {
                 $cmd = "infoScreen";
             }
             $cmd .= "Object";
             $this->{$cmd}();
             break;
     }
     $this->addHeaderAction();
     return true;
 }
 function &executeCommand()
 {
     global $ilUser, $ilCtrl;
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     // show repository tree
     $this->showRepTree(true);
     switch ($next_class) {
         case 'ilpermissiongui':
             $this->prepareOutput();
             $this->tabs_gui->setTabActive('perm_settings');
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui =& new ilPermissionGUI($this);
             $ret =& $this->ctrl->forwardCommand($perm_gui);
             break;
         case 'ilcoursecontentgui':
             $this->prepareOutput();
             include_once './Modules/Course/classes/class.ilCourseContentGUI.php';
             $course_content_obj = new ilCourseContentGUI($this);
             $this->ctrl->forwardCommand($course_content_obj);
             break;
         case "illearningprogressgui":
             $this->prepareOutput();
             include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
             $new_gui =& new ilLearningProgressGUI(ilLearningProgressGUI::LP_CONTEXT_REPOSITORY, $this->object->getRefId(), $_GET['user_id'] ? $_GET['user_id'] : $ilUser->getId());
             $this->ctrl->forwardCommand($new_gui);
             $this->tabs_gui->setTabActive('learning_progress');
             break;
             // container page editing
         // container page editing
         case "ilcontainerpagegui":
             $this->prepareOutput(false);
             $this->checkPermission("write");
             $ret = $this->forwardToPageObject();
             if ($ret != "") {
                 $this->tpl->setContent($ret);
             }
             break;
         case 'ilinfoscreengui':
             $this->prepareOutput();
             $this->infoScreen();
             break;
         case 'ilobjectcopygui':
             $this->prepareOutput();
             include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
             $cp = new ilObjectCopyGUI($this);
             $cp->setType('fold');
             $this->ctrl->forwardCommand($cp);
             break;
         case "ilobjstylesheetgui":
             $this->forwardToStyleSheet();
             break;
         case 'ilexportgui':
             $this->prepareOutput();
             $this->tabs_gui->setTabActive('export');
             include_once './Services/Export/classes/class.ilExportGUI.php';
             $exp = new ilExportGUI($this);
             $exp->addFormat('xml');
             $this->ctrl->forwardCommand($exp);
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case 'ildidactictemplategui':
             $this->ctrl->setReturn($this, 'edit');
             include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateGUI.php';
             $did = new ilDidacticTemplateGUI($this);
             $this->ctrl->forwardCommand($did);
             break;
         case 'ilcolumngui':
             $this->tabs_gui->setTabActive('none');
             $this->checkPermission("read");
             $this->viewObject();
             break;
         default:
             $this->prepareOutput();
             // Dirty hack for course timings view
             if ($this->forwardToTimingsView()) {
                 break;
             }
             if (empty($cmd)) {
                 $cmd = "view";
             }
             $cmd .= "Object";
             $this->{$cmd}();
             break;
     }
     $this->addHeaderAction();
 }
 public function executeCommand()
 {
     global $ilCtrl, $ilTabs, $ilNavigationHistory, $ilUser, $tpl;
     // Navigation History
     $link = $ilCtrl->getLinkTarget($this, "render");
     if ($this->object != NULL) {
         $ilNavigationHistory->addItem($this->object->getRefId(), $link, "dcl");
     }
     //Direct-Link Resource
     if ($_GET["dcl_gtr"]) {
         $ilCtrl->setCmdClass("ildatacollectionrecordviewgui");
         $_GET['record_id'] = $_GET["dcl_gtr"];
         $ilCtrl->setCmd("renderRecord");
     }
     $next_class = $ilCtrl->getNextClass($this);
     $cmd = $ilCtrl->getCmd();
     if (!$this->getCreationMode() && $next_class != "ilinfoscreengui" && !$this->checkPermissionBool("read")) {
         $tpl->getStandardTemplate();
         $tpl->setContent("Permission Denied.");
         return;
     }
     switch ($next_class) {
         case "ilinfoscreengui":
             $this->prepareOutput();
             $ilTabs->activateTab("id_info");
             $this->infoScreenForward();
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case "ilpermissiongui":
             $this->prepareOutput();
             $ilTabs->activateTab("id_permissions");
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui = new ilPermissionGUI($this);
             $this->ctrl->forwardCommand($perm_gui);
             break;
         case "ilobjectcopygui":
             include_once "./Services/Object/classes/class.ilObjectCopyGUI.php";
             $cp = new ilObjectCopyGUI($this);
             $cp->setType("dcl");
             $tpl->getStandardTemplate();
             $this->ctrl->forwardCommand($cp);
             break;
         case "ildatacollectionfieldlistgui":
             $this->prepareOutput();
             $this->addListFieldsTabs("list_fields");
             $ilTabs->setTabActive("id_fields");
             include_once "./Modules/DataCollection/classes/class.ilDataCollectionFieldListGUI.php";
             $fieldlist_gui = new ilDataCollectionFieldListGUI($this, $this->table_id);
             $this->ctrl->forwardCommand($fieldlist_gui);
             break;
         case "ildatacollectiontableeditgui":
             $this->prepareOutput();
             $ilTabs->setTabActive("id_fields");
             include_once "./Modules/DataCollection/classes/class.ilDataCollectionTableEditGUI.php";
             $tableedit_gui = new ilDataCollectionTableEditGUI($this);
             $this->ctrl->forwardCommand($tableedit_gui);
             break;
         case "ildatacollectionfieldeditgui":
             $this->prepareOutput();
             $ilTabs->activateTab("id_fields");
             include_once "./Modules/DataCollection/classes/class.ilDataCollectionFieldEditGUI.php";
             $fieldedit_gui = new ilDataCollectionFieldEditGUI($this, $this->table_id, $_REQUEST["field_id"]);
             $this->ctrl->forwardCommand($fieldedit_gui);
             break;
         case "ildatacollectionrecordlistgui":
             $this->addHeaderAction(false);
             $this->prepareOutput();
             $ilTabs->activateTab("id_records");
             include_once "./Modules/DataCollection/classes/class.ilDataCollectionRecordListGUI.php";
             $recordlist_gui = new ilDataCollectionRecordListGUI($this, $this->table_id);
             $this->ctrl->forwardCommand($recordlist_gui);
             break;
         case "ildatacollectionrecordeditgui":
             $this->prepareOutput();
             $ilTabs->activateTab("id_records");
             include_once "./Modules/DataCollection/classes/class.ilDataCollectionRecordEditGUI.php";
             $recordedit_gui = new ilDataCollectionRecordEditGUI($this);
             $this->ctrl->forwardCommand($recordedit_gui);
             break;
         case "ildatacollectionrecordviewviewdefinitiongui":
             $this->prepareOutput();
             // page editor will set its own tabs
             $ilTabs->clearTargets();
             $ilTabs->setBackTarget($this->lng->txt("back"), $ilCtrl->getLinkTargetByClass("ildatacollectionfieldlistgui", "listFields"));
             include_once "./Modules/DataCollection/classes/class.ilDataCollectionRecordViewViewdefinitionGUI.php";
             $recordedit_gui = new ilDataCollectionRecordViewViewdefinitionGUI($this->table_id);
             // needed for editor
             $recordedit_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(0, "dcl"));
             if (!$this->checkPermissionBool("write")) {
                 $recordedit_gui->setEnableEditing(false);
             }
             $ret = $this->ctrl->forwardCommand($recordedit_gui);
             if ($ret != "") {
                 $this->tpl->setContent($ret);
             }
             $ilTabs->removeTab('history');
             $ilTabs->removeTab('clipboard');
             // Fixme
             $ilTabs->removeTab('pg');
             break;
         case "ildatacollectionrecordlistviewdefinitiongui":
             $this->prepareOutput();
             $this->addListFieldsTabs("list_viewdefinition");
             $ilTabs->setTabActive("id_fields");
             include_once "./Modules/DataCollection/classes/class.ilDataCollectionRecordListViewdefinitionGUI.php";
             $recordlist_gui = new ilDataCollectionRecordListViewdefinitionGUI($this, $this->table_id);
             $this->ctrl->forwardCommand($recordlist_gui);
             break;
         case "ilobjfilegui":
             $this->prepareOutput();
             $ilTabs->setTabActive("id_records");
             include_once "./Modules/File/classes/class.ilObjFile.php";
             $file_gui = new ilObjFile($this);
             $this->ctrl->forwardCommand($file_gui);
             break;
         case "ildatacollectionrecordviewgui":
             $this->prepareOutput();
             include_once "./Modules/DataCollection/classes/class.ilDataCollectionRecordViewGUI.php";
             $recordview_gui = new ilDataCollectionRecordViewGUI($this);
             $this->ctrl->forwardCommand($recordview_gui);
             $ilTabs->clearTargets();
             $ilTabs->setBackTarget($this->lng->txt("back"), $ilCtrl->getLinkTargetByClass("ilObjDataCollectionGUI", ""));
             break;
         case "ilratinggui":
             $rgui = new ilRatingGUI();
             $rgui->setObject($_GET['record_id'], "dcl_record", $_GET["field_id"], "dcl_field");
             $rgui->executeCommand();
             $ilCtrl->redirectByClass("ilDataCollectionRecordListGUI", "listRecords");
             break;
         default:
             return parent::executeCommand();
     }
     return true;
 }
 public function executeCommand()
 {
     global $ilAccess, $ilNavigationHistory, $ilErr, $ilTabs;
     $this->external_rater_360 = false;
     if (!$this->creation_mode && $this->object->get360Mode() && $_SESSION["anonymous_id"][$this->object->getId()] && ilObjSurvey::validateExternalRaterCode($this->object->getRefId(), $_SESSION["anonymous_id"][$this->object->getId()])) {
         $this->external_rater_360 = true;
     }
     if (!$this->external_rater_360) {
         if (!$ilAccess->checkAccess("read", "", $this->ref_id) && !$ilAccess->checkAccess("visible", "", $this->ref_id)) {
             $ilErr->raiseError($this->lng->txt("permission_denied"), $ilErr->MESSAGE);
         }
         // add entry to navigation history
         if (!$this->getCreationMode() && $ilAccess->checkAccess("read", "", $this->ref_id)) {
             $this->ctrl->setParameterByClass("ilobjsurveygui", "ref_id", $this->ref_id);
             $link = $this->ctrl->getLinkTargetByClass("ilobjsurveygui", "");
             $ilNavigationHistory->addItem($this->ref_id, $link, "svy");
         }
     }
     $cmd = $this->ctrl->getCmd("properties");
     // workaround for bug #6288, needs better solution
     if ($cmd == "saveTags") {
         $this->ctrl->setCmdClass("ilinfoscreengui");
     }
     // deep link from repository - "redirect" to page view
     if (!$this->ctrl->getCmdClass() && $cmd == "questionsrepo") {
         $_REQUEST["pgov"] = 1;
         $this->ctrl->setCmd("questions");
         $this->ctrl->setCmdClass("ilsurveyeditorgui");
     }
     $next_class = $this->ctrl->getNextClass($this);
     $this->ctrl->setReturn($this, "properties");
     $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "survey.css", "Modules/Survey"), "screen");
     $this->prepareOutput();
     switch ($next_class) {
         case "ilinfoscreengui":
             if (!in_array($this->ctrl->getCmdClass(), array('ilpublicuserprofilegui', 'ilobjportfoliogui'))) {
                 $this->addHeaderAction();
                 $this->infoScreen();
                 // forwards command
             } else {
                 // #16891
                 $ilTabs->clearTargets();
                 include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php";
                 $info = new ilInfoScreenGUI($this);
                 $this->ctrl->forwardCommand($info);
             }
             break;
         case 'ilmdeditorgui':
             $this->handleWriteAccess();
             $ilTabs->activateTab("meta_data");
             $this->addHeaderAction();
             include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';
             $md_gui =& new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType());
             $md_gui->addObserver($this->object, 'MDUpdateListener', 'General');
             $this->ctrl->forwardCommand($md_gui);
             break;
         case "ilsurveyevaluationgui":
             $ilTabs->activateTab("svy_results");
             $this->addHeaderAction();
             include_once "./Modules/Survey/classes/class.ilSurveyEvaluationGUI.php";
             $eval_gui = new ilSurveyEvaluationGUI($this->object);
             $this->ctrl->forwardCommand($eval_gui);
             break;
         case "ilsurveyexecutiongui":
             $ilTabs->clearTargets();
             include_once "./Modules/Survey/classes/class.ilSurveyExecutionGUI.php";
             $exec_gui = new ilSurveyExecutionGUI($this->object);
             $this->ctrl->forwardCommand($exec_gui);
             break;
         case 'ilpermissiongui':
             $ilTabs->activateTab("perm_settings");
             $this->addHeaderAction();
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui =& new ilPermissionGUI($this);
             $this->ctrl->forwardCommand($perm_gui);
             break;
         case 'ilobjectcopygui':
             include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
             $cp = new ilObjectCopyGUI($this);
             $cp->setType('svy');
             $this->ctrl->forwardCommand($cp);
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
             // 360, skill service
         // 360, skill service
         case 'ilsurveyskillgui':
             $ilTabs->activateTab("survey_competences");
             include_once "./Modules/Survey/classes/class.ilSurveySkillGUI.php";
             $gui = new ilSurveySkillGUI($this->object);
             $this->ctrl->forwardCommand($gui);
             break;
         case 'ilsurveyskilldeterminationgui':
             $ilTabs->activateTab("maintenance");
             include_once "./Modules/Survey/classes/class.ilSurveySkillDeterminationGUI.php";
             $gui = new ilSurveySkillDeterminationGUI($this->object);
             $this->ctrl->forwardCommand($gui);
             break;
         case 'ilsurveyeditorgui':
             $this->handleWriteAccess();
             $ilTabs->activateTab("survey_questions");
             include_once "./Modules/Survey/classes/class.ilSurveyEditorGUI.php";
             $gui = new ilSurveyEditorGUI($this);
             $this->ctrl->forwardCommand($gui);
             break;
         case 'ilsurveyconstraintsgui':
             $this->handleWriteAccess();
             $ilTabs->activateTab("constraints");
             include_once "./Modules/Survey/classes/class.ilSurveyConstraintsGUI.php";
             $gui = new ilSurveyConstraintsGUI($this);
             $this->ctrl->forwardCommand($gui);
             break;
         case 'ilsurveyparticipantsgui':
             if (!$this->object->get360Mode()) {
                 $ilTabs->activateTab("maintenance");
             } else {
                 $ilTabs->activateTab("survey_360_appraisees");
             }
             include_once "./Modules/Survey/classes/class.ilSurveyParticipantsGUI.php";
             $gui = new ilSurveyParticipantsGUI($this);
             $this->ctrl->forwardCommand($gui);
             break;
         default:
             $this->addHeaderAction();
             $cmd .= "Object";
             $this->{$cmd}();
             break;
     }
     if (strtolower($_GET["baseClass"]) != "iladministrationgui" && $this->getCreationMode() != true) {
         $this->tpl->show();
     }
 }
 function executeCommand()
 {
     global $ilCtrl, $tpl, $ilTabs, $ilNavigationHistory;
     $next_class = $ilCtrl->getNextClass($this);
     $cmd = $ilCtrl->getCmd();
     $tpl->getStandardTemplate();
     // add entry to navigation history
     if (!$this->getCreationMode() && $this->getAccessHandler()->checkAccess("read", "", $this->node_id)) {
         $link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "frameset");
         $ilNavigationHistory->addItem($this->node_id, $link, "poll");
     }
     switch ($next_class) {
         case "ilinfoscreengui":
             $this->prepareOutput();
             $this->infoScreenForward();
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case "ilpermissiongui":
             $this->prepareOutput();
             $ilTabs->activateTab("id_permissions");
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui = new ilPermissionGUI($this);
             $this->ctrl->forwardCommand($perm_gui);
             break;
         case "ilobjectcopygui":
             include_once "./Services/Object/classes/class.ilObjectCopyGUI.php";
             $cp = new ilObjectCopyGUI($this);
             $cp->setType("poll");
             $this->ctrl->forwardCommand($cp);
             break;
         case 'ilexportgui':
             $this->prepareOutput();
             $ilTabs->activateTab("export");
             include_once "./Services/Export/classes/class.ilExportGUI.php";
             $exp_gui = new ilExportGUI($this);
             $exp_gui->addFormat("xml");
             $ilCtrl->forwardCommand($exp_gui);
             break;
         default:
             return parent::executeCommand();
     }
     return true;
 }
Beispiel #9
0
 /**
  * execute command
  */
 function executeCommand()
 {
     global $ilAccess, $ilNavigationHistory, $ilCtrl, $ilErr, $tpl, $lng, $ilTabs, $ilPluginAdmin, $ilDB, $tree, $ilias, $ilUser;
     if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
         $ilias->raiseError($this->lng->txt("permission_denied"), $ilias->error_obj->MESSAGE);
     }
     $cmd = $this->ctrl->getCmd("infoScreen");
     $cmdsDisabledDueToOfflineStatus = array('resumePlayer', 'resumePlayer', 'outUserResultsOverview', 'outUserListOfAnswerPasses');
     if (!$this->getCreationMode() && !$this->object->isOnline() && in_array($cmd, $cmdsDisabledDueToOfflineStatus)) {
         $cmd = 'infoScreen';
     }
     $next_class = $this->ctrl->getNextClass($this);
     $this->ctrl->setReturn($this, "infoScreen");
     if (method_exists($this->object, "getTestStyleLocation")) {
         $this->tpl->addCss($this->object->getTestStyleLocation("output"), "screen");
     }
     // add entry to navigation history
     if (!$this->getCreationMode() && $ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
         $ilNavigationHistory->addItem($_GET["ref_id"], "ilias.php?baseClass=ilObjTestGUI&cmd=infoScreen&ref_id=" . $_GET["ref_id"], "tst");
     }
     if (!$this->getCreationMode()) {
         if (IS_PAYMENT_ENABLED) {
             require_once 'Services/Payment/classes/class.ilPaymentObject.php';
             if (ilPaymentObject::_requiresPurchaseToAccess($this->object->getRefId(), $type = isset($_GET['purchasetype']) ? $_GET['purchasetype'] : NULL)) {
                 $this->setLocator();
                 $this->tpl->getStandardTemplate();
                 include_once 'Services/Payment/classes/class.ilShopPurchaseGUI.php';
                 $pp = new ilShopPurchaseGUI((int) $_GET['ref_id']);
                 $ret = $this->ctrl->forwardCommand($pp);
                 $this->tpl->show();
                 exit;
             }
         }
     }
     // elba hack for storing question id for inserting new question after
     if ($_REQUEST['prev_qid']) {
         global $___prev_question_id;
         $___prev_question_id = $_REQUEST['prev_qid'];
         $this->ctrl->setParameter($this, 'prev_qid', $_REQUEST['prev_qid']);
     }
     if (!$this->getCreationMode() && $this->testQuestionSetConfigFactory->getQuestionSetConfig()->areDepenciesBroken()) {
         if (!$this->isValidRequestOnBrokenQuestionSetDepencies($next_class, $cmd)) {
             $this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen');
         }
     }
     $this->determineObjectiveOrientedContainer();
     switch ($next_class) {
         case 'iltestexportgui':
             if (!$ilAccess->checkAccess('write', '', $this->ref_id)) {
                 $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
             }
             $this->prepareOutput();
             $this->addHeaderAction();
             require_once 'Modules/Test/classes/class.ilTestExportGUI.php';
             $ilCtrl->forwardCommand(new ilTestExportGUI($this));
             break;
         case "ilinfoscreengui":
             $this->prepareOutput();
             $this->addHeaderAction();
             $this->infoScreen();
             // forwards command
             break;
         case 'ilmdeditorgui':
             if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
                 $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
             }
             $this->prepareOutput();
             $this->addHeaderAction();
             require_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';
             $md_gui =& new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType());
             $md_gui->addObserver($this->object, 'MDUpdateListener', 'General');
             $this->ctrl->forwardCommand($md_gui);
             break;
         case "iltestplayerfixedquestionsetgui":
             require_once "./Modules/Test/classes/class.ilTestPlayerFixedQuestionSetGUI.php";
             if (!$this->object->getKioskMode()) {
                 $this->prepareOutput();
             }
             $gui = new ilTestPlayerFixedQuestionSetGUI($this->object);
             $gui->setObjectiveOrientedContainer($this->getObjectiveOrientedContainer());
             $this->ctrl->forwardCommand($gui);
             break;
         case "iltestplayerrandomquestionsetgui":
             require_once "./Modules/Test/classes/class.ilTestPlayerRandomQuestionSetGUI.php";
             if (!$this->object->getKioskMode()) {
                 $this->prepareOutput();
             }
             $gui = new ilTestPlayerRandomQuestionSetGUI($this->object);
             $gui->setObjectiveOrientedContainer($this->getObjectiveOrientedContainer());
             $this->ctrl->forwardCommand($gui);
             break;
         case "iltestplayerdynamicquestionsetgui":
             require_once "./Modules/Test/classes/class.ilTestPlayerDynamicQuestionSetGUI.php";
             if (!$this->object->getKioskMode()) {
                 $this->prepareOutput();
             }
             $gui = new ilTestPlayerDynamicQuestionSetGUI($this->object);
             $gui->setObjectiveOrientedContainer($this->getObjectiveOrientedContainer());
             $this->ctrl->forwardCommand($gui);
             break;
         case "iltestevaluationgui":
             $this->forwardToEvaluationGUI();
             break;
         case "iltestevalobjectiveorientedgui":
             $this->forwardToEvalObjectiveOrientedGUI();
             break;
         case "iltestservicegui":
             $this->prepareOutput();
             $this->addHeaderAction();
             require_once "./Modules/Test/classes/class.ilTestServiceGUI.php";
             $serviceGUI =& new ilTestServiceGUI($this->object);
             $this->ctrl->forwardCommand($serviceGUI);
             break;
         case 'ilpermissiongui':
             $this->prepareOutput();
             $this->addHeaderAction();
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui =& new ilPermissionGUI($this);
             $ret =& $this->ctrl->forwardCommand($perm_gui);
             break;
         case "illearningprogressgui":
             $this->prepareOutput();
             $this->addHeaderAction();
             require_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
             $new_gui =& new ilLearningProgressGUI(ilLearningProgressGUI::LP_CONTEXT_REPOSITORY, $this->object->getRefId());
             $this->ctrl->forwardCommand($new_gui);
             break;
         case "ilcertificategui":
             $this->prepareOutput();
             $this->addHeaderAction();
             require_once "./Services/Certificate/classes/class.ilCertificateGUI.php";
             require_once "./Modules/Test/classes/class.ilTestCertificateAdapter.php";
             $output_gui = new ilCertificateGUI(new ilTestCertificateAdapter($this->object));
             $this->ctrl->forwardCommand($output_gui);
             break;
         case "iltestscoringgui":
             $this->prepareOutput();
             $this->addHeaderAction();
             require_once "./Modules/Test/classes/class.ilTestScoringGUI.php";
             $output_gui = new ilTestScoringGUI($this->object);
             $this->ctrl->forwardCommand($output_gui);
             break;
         case 'ilmarkschemagui':
             if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
                 ilUtil::sendInfo($this->lng->txt('cannot_edit_test'), true);
                 $this->ctrl->redirect($this, 'infoScreen');
             }
             $this->prepareOutput();
             $this->addHeaderAction();
             require_once 'Modules/Test/classes/class.ilMarkSchemaGUI.php';
             $mark_schema_gui = new ilMarkSchemaGUI($this->object);
             $this->ctrl->forwardCommand($mark_schema_gui);
             break;
         case 'iltestscoringbyquestionsgui':
             $this->prepareOutput();
             $this->addHeaderAction();
             include_once 'Modules/Test/classes/class.ilTestScoringByQuestionsGUI.php';
             $output_gui = new ilTestScoringByQuestionsGUI($this->object);
             $this->ctrl->forwardCommand($output_gui);
             break;
         case 'ilobjtestsettingsgeneralgui':
             $this->prepareOutput();
             $this->addHeaderAction();
             require_once 'Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php';
             $gui = new ilObjTestSettingsGeneralGUI($this->ctrl, $ilAccess, $this->lng, $this->tpl, $this->tree, $ilDB, $ilPluginAdmin, $ilUser, $this);
             $this->ctrl->forwardCommand($gui);
             break;
         case 'ilobjtestsettingsscoringresultsgui':
             $this->prepareOutput();
             $this->addHeaderAction();
             require_once 'Modules/Test/classes/class.ilObjTestSettingsScoringResultsGUI.php';
             $gui = new ilObjTestSettingsScoringResultsGUI($this->ctrl, $ilAccess, $this->lng, $this->tpl, $this->tree, $ilDB, $ilPluginAdmin, $this);
             $this->ctrl->forwardCommand($gui);
             break;
         case 'ilobjtestdynamicquestionsetconfiggui':
             $this->prepareOutput();
             $this->addHeaderAction();
             require_once 'Modules/Test/classes/class.ilObjTestDynamicQuestionSetConfigGUI.php';
             $gui = new ilObjTestDynamicQuestionSetConfigGUI($this->ctrl, $ilAccess, $ilTabs, $this->lng, $this->tpl, $ilDB, $tree, $ilPluginAdmin, $this->object);
             $this->ctrl->forwardCommand($gui);
             break;
         case 'iltestrandomquestionsetconfiggui':
             $this->prepareOutput();
             $this->addHeaderAction();
             require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetConfigGUI.php';
             $gui = new ilTestRandomQuestionSetConfigGUI($this->ctrl, $ilAccess, $ilTabs, $this->lng, $this->tpl, $ilDB, $tree, $ilPluginAdmin, $this->object);
             $this->ctrl->forwardCommand($gui);
             break;
         case 'iltestquestionbrowsertablegui':
             $this->prepareOutput();
             $this->addHeaderAction();
             require_once 'Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php';
             $gui = new ilTestQuestionBrowserTableGUI($this->ctrl, $this->tpl, $ilTabs, $this->lng, $tree, $ilDB, $ilPluginAdmin, $this->object);
             $gui->setWriteAccess($ilAccess->checkAccess("write", "", $this->ref_id));
             $gui->init();
             $this->ctrl->forwardCommand($gui);
             break;
         case 'iltestskilladministrationgui':
             $this->prepareOutput();
             $this->addHeaderAction();
             require_once 'Modules/Test/classes/class.ilTestSkillAdministrationGUI.php';
             $gui = new ilTestSkillAdministrationGUI($ilias, $this->ctrl, $ilAccess, $ilTabs, $this->tpl, $this->lng, $ilDB, $tree, $ilPluginAdmin, $this->object, $this->ref_id);
             $this->ctrl->forwardCommand($gui);
             break;
         case 'iltestskillevaluationgui':
             $this->prepareOutput();
             $this->addHeaderAction();
             require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php';
             if ($this->object->isDynamicTest()) {
                 require_once 'Modules/Test/classes/class.ilObjTestDynamicQuestionSetConfig.php';
                 $dynamicQuestionSetConfig = new ilObjTestDynamicQuestionSetConfig($tree, $ilDB, $ilPluginAdmin, $this->object);
                 $dynamicQuestionSetConfig->loadFromDb();
                 $questionList = new ilAssQuestionList($ilDB, $this->lng, $ilPluginAdmin);
                 $questionList->setParentObjId($dynamicQuestionSetConfig->getSourceQuestionPoolId());
                 $questionList->setQuestionInstanceTypeFilter(ilAssQuestionList::QUESTION_INSTANCE_TYPE_ORIGINALS);
             } else {
                 $questionList = new ilAssQuestionList($ilDB, $this->lng, $ilPluginAdmin);
                 $questionList->setParentObjId($this->object->getId());
                 $questionList->setQuestionInstanceTypeFilter(ilAssQuestionList::QUESTION_INSTANCE_TYPE_DUPLICATES);
             }
             $questionList->load();
             require_once 'Modules/Test/classes/class.ilTestSessionFactory.php';
             $testSessionFactory = new ilTestSessionFactory($this->object);
             $testSession = $testSessionFactory->getSession();
             $testResults = $this->object->getTestResult($testSession->getActiveId(), $testSession->getPass(), true);
             require_once 'Modules/Test/classes/class.ilTestSkillEvaluationGUI.php';
             $gui = new ilTestSkillEvaluationGUI($this->ctrl, $ilTabs, $this->tpl, $this->lng, $ilDB, $this->object->getTestId(), $this->object->getRefId(), $this->object->getId());
             $gui->setObjectiveOrientedContainer($this->getObjectiveOrientedContainer());
             $gui->setQuestionList($questionList);
             $gui->setTestSession($testSession);
             $gui->setTestResults($testResults);
             $this->ctrl->forwardCommand($gui);
             break;
         case 'ilobjectcopygui':
             $this->prepareOutput();
             $this->addHeaderAction();
             require_once './Services/Object/classes/class.ilObjectCopyGUI.php';
             $cp = new ilObjectCopyGUI($this);
             $cp->setType('tst');
             $this->ctrl->forwardCommand($cp);
             break;
         case 'ilrepositorysearchgui':
             $this->prepareOutput();
             $this->addHeaderAction();
             require_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
             $rep_search =& new ilRepositorySearchGUI();
             $rep_search->setCallback($this, 'addParticipantsObject', array());
             // Set tabs
             $this->ctrl->setReturn($this, 'participants');
             $ret =& $this->ctrl->forwardCommand($rep_search);
             $this->tabs_gui->setTabActive('participants');
             break;
         case 'ilpageeditorgui':
         case 'iltestexpresspageobjectgui':
             require_once 'Modules/TestQuestionPool/classes/class.ilAssIncompleteQuestionPurger.php';
             $incompleteQuestionPurger = new ilAssIncompleteQuestionPurger($ilDB);
             $incompleteQuestionPurger->setOwnerId($ilUser->getId());
             $incompleteQuestionPurger->purge();
             $qid = $_REQUEST['q_id'];
             // :FIXME: does not work
             // $this->ctrl->saveParameterByClass(array('iltestexpresspageobjectgui', 'assorderingquestiongui', 'ilpageeditorgui', 'ilpcquestion', 'ilpcquestiongui'), 'test_express_mode');
             if (!$qid || $qid == 'Array') {
                 $questions = $this->object->getQuestionTitlesAndIndexes();
                 if (!is_array($questions)) {
                     $questions = array();
                 }
                 $keys = array_keys($questions);
                 $qid = $keys[0];
                 $_REQUEST['q_id'] = $qid;
                 $_GET['q_id'] = $qid;
                 $_POST['q_id'] = $qid;
             }
             $this->prepareOutput();
             if (!in_array($cmd, array('addQuestion', 'browseForQuestions'))) {
                 $this->buildPageViewToolbar($qid);
             }
             if (!$qid || in_array($cmd, array('insertQuestions', 'browseForQuestions'))) {
                 require_once "./Modules/Test/classes/class.ilTestExpressPageObjectGUI.php";
                 $pageObject = new ilTestExpressPageObjectGUI(0);
                 $pageObject->test_object = $this->object;
                 $ret =& $this->ctrl->forwardCommand($pageObject);
                 break;
             }
             require_once "./Services/Style/classes/class.ilObjStyleSheet.php";
             $this->tpl->setCurrentBlock("ContentStyle");
             $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
             $this->tpl->parseCurrentBlock();
             // syntax style
             $this->tpl->setCurrentBlock("SyntaxStyle");
             $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
             $this->tpl->parseCurrentBlock();
             require_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
             $q_gui = assQuestionGUI::_getQuestionGUI("", $qid);
             if (!$q_gui instanceof assQuestionGUI) {
                 $this->ctrl->setParameterByClass('iltestexpresspageobjectgui', 'q_id', '');
                 $this->ctrl->redirectByClass('iltestexpresspageobjectgui', $this->ctrl->getCmd());
             }
             $q_gui->outAdditionalOutput();
             $q_gui->object->setObjId($this->object->getId());
             $question = $q_gui->object;
             $this->ctrl->saveParameter($this, "q_id");
             #$this->lng->loadLanguageModule("content");
             $this->ctrl->setReturnByClass("ilTestExpressPageObjectGUI", "view");
             $this->ctrl->setReturn($this, "questions");
             require_once "./Modules/TestQuestionPool/classes/class.ilAssQuestionPage.php";
             require_once "./Modules/Test/classes/class.ilTestExpressPageObjectGUI.php";
             $page_gui = new ilTestExpressPageObjectGUI($qid);
             $page_gui->test_object = $this->object;
             $page_gui->setEditPreview(true);
             $page_gui->setEnabledTabs(false);
             if (strlen($this->ctrl->getCmd()) == 0) {
                 $this->ctrl->setCmdClass(get_class($page_gui));
                 $this->ctrl->setCmd("preview");
             }
             $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(TRUE)));
             $page_gui->setTemplateTargetVar("ADM_CONTENT");
             $page_gui->setOutputMode($this->object->evalTotalPersons() == 0 ? "edit" : 'preview');
             $page_gui->setHeader($question->getTitle());
             $page_gui->setFileDownloadLink($this->ctrl->getLinkTarget($this, "downloadFile"));
             $page_gui->setFullscreenLink($this->ctrl->getLinkTarget($this, "fullscreen"));
             $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTarget($this));
             $page_gui->setPresentationTitle($question->getTitle() . ' [' . $this->lng->txt('question_id_short') . ': ' . $question->getId() . ']');
             $ret =& $this->ctrl->forwardCommand($page_gui);
             global $ilTabs;
             $ilTabs->activateTab('assQuestions');
             $this->tpl->setContent($ret);
             break;
         case 'ilassquestionpreviewgui':
             $this->prepareOutput();
             $this->ctrl->saveParameter($this, "q_id");
             require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewGUI.php';
             $gui = new ilAssQuestionPreviewGUI($this->ctrl, $this->tabs_gui, $this->tpl, $this->lng, $ilDB);
             $gui->initQuestion((int) $_GET['q_id'], $this->object->getId());
             $gui->initPreviewSettings($this->object->getRefId());
             $gui->initPreviewSession($ilUser->getId(), (int) $_GET['q_id']);
             $gui->initHintTracking();
             $gui->initStyleSheets();
             $this->ctrl->forwardCommand($gui);
             break;
         case 'ilassquestionpagegui':
             require_once "./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php";
             //echo $_REQUEST['prev_qid'];
             if ($_REQUEST['prev_qid']) {
                 $this->ctrl->setParameter($this, 'prev_qid', $_REQUEST['prev_qid']);
             }
             $this->prepareOutput();
             //global $___test_express_mode;
             //$___test_express_mode = true;
             $_GET['calling_test'] = $this->object->getRefId();
             include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
             $this->tpl->setCurrentBlock("ContentStyle");
             $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
             $this->tpl->parseCurrentBlock();
             // syntax style
             $this->tpl->setCurrentBlock("SyntaxStyle");
             $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
             $this->tpl->parseCurrentBlock();
             require_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
             $q_gui = assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
             $q_gui->setQuestionTabs();
             $q_gui->outAdditionalOutput();
             $q_gui->object->setObjId($this->object->getId());
             $question =& $q_gui->object;
             $this->ctrl->saveParameter($this, "q_id");
             $this->lng->loadLanguageModule("content");
             $this->ctrl->setReturnByClass("ilAssQuestionPageGUI", "view");
             $this->ctrl->setReturn($this, "questions");
             $page_gui = new ilAssQuestionPageGUI($_GET["q_id"]);
             $page_gui->setEditPreview(true);
             if (strlen($this->ctrl->getCmd()) == 0) {
                 $this->ctrl->setCmdClass(get_class($page_gui));
                 $this->ctrl->setCmd("preview");
             }
             $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(TRUE)));
             $page_gui->setTemplateTargetVar("ADM_CONTENT");
             $page_gui->setOutputMode($this->object->evalTotalPersons() == 0 ? "edit" : 'preview');
             $page_gui->setHeader($question->getTitle());
             $page_gui->setPresentationTitle($question->getTitle() . ' [' . $this->lng->txt('question_id_short') . ': ' . $question->getId() . ']');
             $ret =& $this->ctrl->forwardCommand($page_gui);
             $this->tpl->setContent($ret);
             break;
         case 'ilassspecfeedbackpagegui':
             require_once "./Modules/TestQuestionPool/classes/feedback/class.ilAssSpecFeedbackPageGUI.php";
             $pg_gui = new ilAssSpecFeedbackPageGUI((int) $_GET["feedback_id"]);
             $this->ctrl->forwardCommand($pg_gui);
             break;
         case 'ilassgenfeedbackpagegui':
             require_once "./Modules/TestQuestionPool/classes/feedback/class.ilAssGenFeedbackPageGUI.php";
             $pg_gui = new ilAssGenFeedbackPageGUI((int) $_GET["feedback_id"]);
             $this->ctrl->forwardCommand($pg_gui);
             break;
         case 'illocalunitconfigurationgui':
             $this->prepareSubGuiOutput();
             // set return target
             $this->ctrl->setReturn($this, "questions");
             // set context tabs
             require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
             $questionGUI = assQuestionGUI::_getQuestionGUI('', $_GET['q_id']);
             $questionGUI->object->setObjId($this->object->getId());
             $questionGUI->setQuestionTabs();
             require_once 'Modules/TestQuestionPool/classes/class.ilLocalUnitConfigurationGUI.php';
             require_once 'Modules/TestQuestionPool/classes/class.ilUnitConfigurationRepository.php';
             $gui = new ilLocalUnitConfigurationGUI(new ilUnitConfigurationRepository((int) $_GET['q_id']));
             $this->ctrl->forwardCommand($gui);
             break;
         case "ilcommonactiondispatchergui":
             require_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case 'ilassquestionhintsgui':
             $this->prepareSubGuiOutput();
             // set return target
             $this->ctrl->setReturn($this, "questions");
             // set context tabs
             require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
             $questionGUI =& assQuestionGUI::_getQuestionGUI($q_type, $_GET['q_id']);
             $questionGUI->object->setObjId($this->object->getId());
             $questionGUI->setQuestionTabs();
             // forward to ilAssQuestionHintsGUI
             require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsGUI.php';
             $gui = new ilAssQuestionHintsGUI($questionGUI);
             $ilCtrl->forwardCommand($gui);
             break;
         case 'ilassquestionfeedbackeditinggui':
             $this->prepareSubGuiOutput();
             // set return target
             $this->ctrl->setReturn($this, "questions");
             // set context tabs
             require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
             $questionGUI = assQuestionGUI::_getQuestionGUI('', $_GET['q_id']);
             $questionGUI->object->setObjId($this->object->getId());
             $questionGUI->setQuestionTabs();
             // forward to ilAssQuestionFeedbackGUI
             require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php';
             $gui = new ilAssQuestionFeedbackEditingGUI($questionGUI, $ilCtrl, $ilAccess, $tpl, $ilTabs, $lng);
             $ilCtrl->forwardCommand($gui);
             break;
         case 'iltesttoplistgui':
             $this->prepareOutput();
             require_once './Modules/Test/classes/class.ilTestToplistGUI.php';
             $gui = new ilTestToplistGUI($this);
             $this->ctrl->forwardCommand($gui);
             break;
         case 'ilscoringadjustmentgui':
             $this->prepareOutput();
             require_once './Modules/Test/classes/class.ilScoringAdjustmentGUI.php';
             $gui = new ilScoringAdjustmentGUI($this->object);
             $this->ctrl->forwardCommand($gui);
             break;
         case '':
         case 'ilobjtestgui':
             $this->prepareOutput();
             $this->addHeaderAction();
             if (strcmp($cmd, "properties") == 0 && $_GET["browse"]) {
                 $this->questionBrowser();
                 return;
             }
             if (strcmp($cmd, "properties") == 0 && ($_GET["up"] || $_GET["down"])) {
                 $this->questionsObject();
                 return;
             }
             $cmd .= "Object";
             $ret =& $this->{$cmd}();
             break;
         default:
             // elba hack for storing question id for inserting new question after
             if ($_REQUEST['prev_qid']) {
                 global $___prev_question_id;
                 $___prev_question_id = $_REQUEST['prev_qid'];
                 $this->ctrl->setParameterByClass('ilassquestionpagegui', 'prev_qid', $_REQUEST['prev_qid']);
                 $this->ctrl->setParameterByClass($_GET['sel_question_types'] . 'gui', 'prev_qid', $_REQUEST['prev_qid']);
             }
             $this->create_question_mode = true;
             $this->prepareOutput();
             $this->ctrl->setReturn($this, "questions");
             require_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
             $q_gui =& assQuestionGUI::_getQuestionGUI($_GET['sel_question_types'], $_GET["q_id"]);
             $q_gui->object->setObjId($this->object->getId());
             if (!$_GET['sel_question_types']) {
                 $qType = assQuestion::getQuestionTypeFromDb($_GET['q_id']);
             } else {
                 $qType = $_GET['sel_question_types'];
             }
             $this->ctrl->setParameterByClass($qType . "GUI", 'prev_qid', $_REQUEST['prev_qid']);
             $this->ctrl->setParameterByClass($qType . "GUI", 'test_ref_id', $_REQUEST['ref_id']);
             $this->ctrl->setParameterByClass($qType . "GUI", 'q_id', $_REQUEST['q_id']);
             if ($_REQUEST['test_express_mode']) {
                 $this->ctrl->setParameterByClass($qType . "GUI", 'test_express_mode', 1);
             }
             #global $___test_express_mode;
             #$___test_express_mode = true;
             if (!$q_gui->isSaveCommand()) {
                 $_GET['calling_test'] = $this->object->getRefId();
             }
             $q_gui->setQuestionTabs();
             #unset($___test_express_mode);
             $ret =& $this->ctrl->forwardCommand($q_gui);
             break;
     }
     if (!in_array(strtolower($_GET["baseClass"]), array('iladministrationgui', 'ilrepositorygui')) && $this->getCreationMode() != true) {
         $this->tpl->show();
     }
 }
Beispiel #10
0
 function executeCommand()
 {
     global $rbacsystem, $ilUser, $ilAccess, $ilErr, $ilTabs, $ilNavigationHistory, $ilCtrl;
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     $this->prepareOutput();
     // show repository tree
     $this->showRepTree(true);
     // add entry to navigation history
     if (!$this->getCreationMode() && $ilAccess->checkAccess('read', '', $_GET['ref_id'])) {
         $link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "frameset");
         $ilNavigationHistory->addItem($_GET['ref_id'], $link, 'crs');
     }
     if (!$this->getCreationMode()) {
         if (IS_PAYMENT_ENABLED) {
             include_once 'Services/Payment/classes/class.ilPaymentObject.php';
             if (ilPaymentObject::_requiresPurchaseToAccess($this->object->getRefId(), $type = isset($_GET['purchasetype']) ? $_GET['purchasetype'] : NULL)) {
                 $ilTabs->setTabActive('info_short');
                 include_once 'Services/Payment/classes/class.ilShopPurchaseGUI.php';
                 $this->ctrl->setReturn($this, '');
                 $pp_gui = new ilShopPurchaseGUI($this->object->getRefId());
                 $this->ctrl->forwardCommand($pp_gui);
                 return true;
             }
         }
     }
     switch ($next_class) {
         case "ilinfoscreengui":
             $this->infoScreen();
             // forwards command
             break;
         case 'ilmdeditorgui':
             if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
                 $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
             }
             include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';
             $md_gui =& new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType());
             $md_gui->addObserver($this->object, 'MDUpdateListener', 'General');
             $this->ctrl->forwardCommand($md_gui);
             $this->tabs_gui->setTabActive('meta_data');
             break;
         case 'ilcourseregistrationgui':
             $this->ctrl->setReturn($this, 'infoScreen');
             $this->tabs_gui->setTabActive('join');
             include_once './Modules/Course/classes/class.ilCourseRegistrationGUI.php';
             $registration = new ilCourseRegistrationGUI($this->object);
             $this->ctrl->forwardCommand($registration);
             break;
         case 'ilobjectcustomuserfieldsgui':
             include_once './Services/Membership/classes/class.ilObjectCustomUserFieldsGUI.php';
             if (isset($_REQUEST['member_id'])) {
                 $this->ctrl->setReturn($this, 'members');
             }
             $cdf_gui = new ilObjectCustomUserFieldsGUI($this->object->getId());
             $this->setSubTabs('properties');
             $this->tabs_gui->setTabActive('settings');
             $this->ctrl->forwardCommand($cdf_gui);
             break;
         case "ilcourseobjectivesgui":
             include_once './Modules/Course/classes/class.ilCourseObjectivesGUI.php';
             $this->ctrl->setReturn($this, "");
             $reg_gui =& new ilCourseObjectivesGUI($this->object->getRefId());
             $ret =& $this->ctrl->forwardCommand($reg_gui);
             break;
         case 'ilobjcoursegroupinggui':
             include_once './Modules/Course/classes/class.ilObjCourseGroupingGUI.php';
             $this->ctrl->setReturn($this, 'edit');
             $this->setSubTabs('properties');
             $crs_grp_gui =& new ilObjCourseGroupingGUI($this->object, (int) $_GET['obj_id']);
             $this->ctrl->forwardCommand($crs_grp_gui);
             $this->tabs_gui->setTabActive('settings');
             $this->tabs_gui->setSubTabActive('groupings');
             break;
         case "ilcolumngui":
             $this->tabs_gui->setTabActive('none');
             $this->checkPermission("read");
             //$this->prepareOutput();
             //include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
             //$this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
             //	ilObjStyleSheet::getContentStylePath(0));
             //$this->renderObject();
             $this->viewObject();
             break;
         case "ilconditionhandlergui":
             include_once './Services/AccessControl/classes/class.ilConditionHandlerGUI.php';
             // preconditions for whole course
             $this->setSubTabs("properties");
             $this->tabs_gui->setTabActive('settings');
             $new_gui =& new ilConditionHandlerGUI($this);
             $this->ctrl->forwardCommand($new_gui);
             break;
         case "illearningprogressgui":
             include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
             $new_gui =& new ilLearningProgressGUI(ilLearningProgressGUI::LP_CONTEXT_REPOSITORY, $this->object->getRefId(), $_GET['user_id'] ? $_GET['user_id'] : $ilUser->getId());
             $this->ctrl->forwardCommand($new_gui);
             $this->tabs_gui->setTabActive('learning_progress');
             break;
         case 'illicenseoverviewgui':
             include_once "./Services/License/classes/class.ilLicenseOverviewGUI.php";
             $license_gui =& new ilLicenseOverviewGUI($this, ilLicenseOverviewGUI::LIC_MODE_REPOSITORY);
             $ret =& $this->ctrl->forwardCommand($license_gui);
             $this->tabs_gui->setTabActive('licenses');
             break;
         case 'ilpermissiongui':
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $this->tabs_gui->setTabActive('perm_settings');
             $perm_gui =& new ilPermissionGUI($this);
             $ret =& $this->ctrl->forwardCommand($perm_gui);
             break;
         case 'ilrepositorysearchgui':
             include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
             $rep_search =& new ilRepositorySearchGUI();
             if (ilCourseParticipant::_getInstanceByObjId($this->object->getId(), $GLOBALS['ilUser']->getId())->isAdmin() or $this->checkPermissionBool('edit_permission')) {
                 $rep_search->setCallback($this, 'assignMembersObject', $this->getLocalRoles());
             } else {
                 $rep_search->setCallback($this, 'assignMembersObject', array(ilCourseConstants::CRS_MEMBER => $this->lng->txt('crs_member'), ilCourseConstants::CRS_TUTOR => $this->lng->txt('crs_tutor')));
             }
             $this->checkLicenses();
             // Set tabs
             $this->ctrl->setReturn($this, 'members');
             $ret =& $this->ctrl->forwardCommand($rep_search);
             $this->setSubTabs('members');
             $this->tabs_gui->setTabActive('members');
             $this->tabs_gui->setSubTabActive('crs_member_administration');
             break;
         case 'ilcoursecontentinterface':
             $this->initCourseContentInterface();
             $this->cci_obj->cci_setContainer($this);
             $this->ctrl->forwardCommand($this->cci_obj);
             $this->setSubTabs('content');
             $this->tabs_gui->setTabActive('content');
             break;
         case 'ilcoursecontentgui':
             $this->ctrl->setReturn($this, 'members');
             include_once './Modules/Course/classes/class.ilCourseContentGUI.php';
             $course_content_obj = new ilCourseContentGUI($this);
             $this->ctrl->forwardCommand($course_content_obj);
             break;
         case 'ilpublicuserprofilegui':
             $this->tpl->enableDragDropFileUpload(null);
             require_once './Services/User/classes/class.ilPublicUserProfileGUI.php';
             $profile_gui = new ilPublicUserProfileGUI($_GET["user"]);
             $this->setSubTabs('members');
             $this->tabs_gui->setTabActive('members');
             $profile_gui->setBackUrl($ilCtrl->getLinkTarget($this, "membersGallery"));
             $this->tabs_gui->setSubTabActive('crs_members_gallery');
             $html = $this->ctrl->forwardCommand($profile_gui);
             $this->tpl->setVariable("ADM_CONTENT", $html);
             break;
         case 'ilmemberexportgui':
             include_once './Services/Membership/classes/Export/class.ilMemberExportGUI.php';
             $this->setSubTabs('members');
             $this->tabs_gui->setTabActive('members');
             $this->tabs_gui->setSubTabActive('export_members');
             $export = new ilMemberExportGUI($this->object->getRefId());
             $this->ctrl->forwardCommand($export);
             break;
         case 'ilmemberagreementgui':
             include_once 'Services/Membership/classes/class.ilMemberAgreementGUI.php';
             $this->tabs_gui->clearTargets();
             $this->ctrl->setReturn($this, '');
             $agreement = new ilMemberAgreementGUI($this->object->getRefId());
             $this->ctrl->forwardCommand($agreement);
             break;
         case 'ilsessionoverviewgui':
             $this->setSubTabs('members');
             $this->tabs_gui->setTabActive('members');
             $this->tabs_gui->setSubTabActive('events');
             include_once './Modules/Course/classes/class.ilCourseParticipants.php';
             $prt = ilCourseParticipants::_getInstanceByObjId($this->object->getId());
             include_once './Modules/Session/classes/class.ilSessionOverviewGUI.php';
             $overview = new ilSessionOverviewGUI($this->object->getRefId(), $prt);
             $this->ctrl->forwardCommand($overview);
             break;
             // container page editing
         // container page editing
         case "ilcontainerpagegui":
             $ret = $this->forwardToPageObject();
             if ($ret != "") {
                 $this->tpl->setContent($ret);
             }
             break;
         case "ilcontainerstartobjectspagegui":
             // file downloads, etc. (currently not active)
             include_once "Services/Container/classes/class.ilContainerStartObjectsPageGUI.php";
             $pgui = new ilContainerStartObjectsPageGUI($this->object->getId());
             $ret = $this->ctrl->forwardCommand($pgui);
             if ($ret) {
                 $this->tpl->setContent($ret);
             }
             break;
         case 'ilobjectcopygui':
             include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
             $cp = new ilObjectCopyGUI($this);
             $cp->setType('crs');
             $this->ctrl->forwardCommand($cp);
             break;
         case "ilobjstylesheetgui":
             $this->forwardToStyleSheet();
             break;
         case 'ilcourseparticipantsgroupsgui':
             include_once './Modules/Course/classes/class.ilCourseParticipantsGroupsGUI.php';
             $cmg_gui = new ilCourseParticipantsGroupsGUI($this->object->getRefId());
             $this->setSubTabs('members');
             $this->tabs_gui->setTabActive('members');
             $this->ctrl->forwardCommand($cmg_gui);
             break;
         case 'ilexportgui':
             $this->tabs_gui->setTabActive('export');
             include_once './Services/Export/classes/class.ilExportGUI.php';
             $exp = new ilExportGUI($this);
             $exp->addFormat('xml');
             $this->ctrl->forwardCommand($exp);
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case 'ildidactictemplategui':
             $this->ctrl->setReturn($this, 'edit');
             include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateGUI.php';
             $did = new ilDidacticTemplateGUI($this);
             $this->ctrl->forwardCommand($did);
             break;
         case "ilcertificategui":
             $this->tabs_gui->activateTab("settings");
             $this->setSubTabs("properties");
             include_once "./Services/Certificate/classes/class.ilCertificateGUI.php";
             include_once "./Modules/Course/classes/class.ilCourseCertificateAdapter.php";
             $output_gui = new ilCertificateGUI(new ilCourseCertificateAdapter($this->object));
             $this->ctrl->forwardCommand($output_gui);
             break;
         case 'ilobjectservicesettingsgui':
             $this->ctrl->setReturn($this, 'edit');
             $this->setSubTabs("properties");
             $this->tabs_gui->activateTab('settings');
             $this->tabs_gui->acltivateSubTab('tool_settings');
             include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
             $service = new ilObjectServiceSettingsGUI($this, $this->object->getId(), array(ilObjectServiceSettingsGUI::CALENDAR_VISIBILITY));
             $this->ctrl->forwardCommand($service);
             break;
         case 'illoeditorgui':
             #$this->tabs_gui->clearTargets();
             #$this->tabs_gui->setBackTarget($this->lng->txt('back'),$this->ctrl->getLinkTarget($this,''));
             $this->tabs_gui->activateTab('crs_objectives');
             include_once './Modules/Course/classes/Objectives/class.ilLOEditorGUI.php';
             $editor = new ilLOEditorGUI($this->object);
             $this->ctrl->forwardCommand($editor);
             break;
         case 'ilcontainerstartobjectsgui':
             $this->ctrl->setReturn($this, 'edit');
             $this->tabs_gui->clearTargets();
             $this->tabs_gui->setBackTarget($this->lng->txt("back_to_crs_content"), $this->ctrl->getLinkTarget($this, "edit"));
             $this->tabs_gui->addTab("start", $this->lng->txt("crs_start_objects"), $this->ctrl->getLinkTargetByClass("ilcontainerstartobjectsgui", "listStructure"));
             include_once './Services/Container/classes/class.ilContainerStartObjectsGUI.php';
             $stgui = new ilContainerStartObjectsGUI($this->object);
             $this->ctrl->forwardCommand($stgui);
             break;
         case 'illomembertestresultgui':
             include_once './Modules/Course/classes/Objectives/class.ilLOMemberTestResultGUI.php';
             $GLOBALS['ilCtrl']->setReturn($this, 'members');
             $GLOBALS['ilTabs']->clearTargets();
             $GLOBALS['ilTabs']->setBackTarget($GLOBALS['lng']->txt('back'), $GLOBALS['ilCtrl']->getLinkTarget($this, 'members'));
             $result_view = new ilLOMemberTestResultGUI($this, $this->object, (int) $_REQUEST['uid']);
             $this->ctrl->forwardCommand($result_view);
             break;
         default:
             /*                if(!$this->creation_mode)
                             {
                                 $this->checkPermission('visible');
                             }*/
             /*
             if(!$this->creation_mode and !$ilAccess->checkAccess('visible','',$this->object->getRefId(),'crs'))
             {
                 $ilErr->raiseError($this->lng->txt("msg_no_perm_read"),$ilErr->MESSAGE);
             }
             */
             // #9401 - see also ilStartupGUI::_checkGoto()
             if ($cmd == 'infoScreenGoto') {
                 if (ilObjCourse::_isActivated($this->object->getId()) && ilObjCourse::_registrationEnabled($this->object->getId())) {
                     $cmd = 'join';
                 } else {
                     $cmd = 'infoScreen';
                 }
             }
             if (!$this->creation_mode) {
                 if ($cmd == "infoScreen") {
                     $this->checkPermission("visible");
                 } else {
                     //						$this->checkPermission("read");
                 }
             }
             if (!$this->creation_mode && $cmd != 'infoScreen' && $cmd != 'sendfile' && $cmd != 'unsubscribe' && $cmd != 'performUnsubscribe' && !$ilAccess->checkAccess("read", '', $this->object->getRefId()) || $cmd == 'join' || $cmd == 'subscribe') {
                 include_once './Modules/Course/classes/class.ilCourseParticipants.php';
                 if ($rbacsystem->checkAccess('join', $this->object->getRefId()) && !ilCourseParticipants::_isParticipant($this->object->getRefId(), $ilUser->getId())) {
                     include_once './Modules/Course/classes/class.ilCourseRegistrationGUI.php';
                     $this->ctrl->redirectByClass("ilCourseRegistrationGUI");
                 } else {
                     $this->infoScreenObject();
                     break;
                 }
             }
             if ($cmd == 'listObjectives') {
                 include_once './Modules/Course/classes/class.ilCourseObjectivesGUI.php';
                 $this->ctrl->setReturn($this, "");
                 $obj_gui =& new ilCourseObjectivesGUI($this->object->getRefId());
                 $ret =& $this->ctrl->forwardCommand($obj_gui);
                 break;
             }
             // Dirty hack for course timings view
             if ($this->forwardToTimingsView()) {
                 break;
             }
             if (!$cmd) {
                 $cmd = 'view';
             }
             $cmd .= 'Object';
             $this->{$cmd}();
             break;
     }
     $this->addHeaderAction();
     return true;
 }
 function &executeCommand()
 {
     global $rbacsystem;
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     // show repository tree
     $this->showRepTree(true);
     switch ($next_class) {
         case 'ilcontainerlinklistgui':
             include_once "Services/Container/classes/class.ilContainerLinkListGUI.php";
             $link_list_gui =& new ilContainerLinkListGUI();
             $ret =& $this->ctrl->forwardCommand($link_list_gui);
             break;
             // container page editing
         // container page editing
         case "ilcontainerpagegui":
             $this->prepareOutput(false);
             $ret = $this->forwardToPageObject();
             if ($ret != "") {
                 $this->tpl->setContent($ret);
             }
             break;
         case 'ilpermissiongui':
             $this->prepareOutput();
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui =& new ilPermissionGUI($this);
             $ret =& $this->ctrl->forwardCommand($perm_gui);
             break;
         case "ilcolumngui":
             $this->checkPermission("read");
             $this->prepareOutput();
             include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
             $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId()));
             $this->renderObject();
             break;
         case 'ilobjectcopygui':
             $this->prepareOutput();
             include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
             $cp = new ilObjectCopyGUI($this);
             $cp->setType('root');
             $this->ctrl->forwardCommand($cp);
             break;
         case "ilobjstylesheetgui":
             $this->forwardToStyleSheet();
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case 'ilobjecttranslationgui':
             $this->checkPermissionBool("write");
             $this->prepareOutput();
             //$this->tabs_gui->setTabActive('export');
             $this->setEditTabs("settings_trans");
             include_once "./Services/Object/classes/class.ilObjectTranslationGUI.php";
             $transgui = new ilObjectTranslationGUI($this);
             $this->ctrl->forwardCommand($transgui);
             break;
         default:
             // fix bug http://www.ilias.de/mantis/view.php?id=10305
             if ($cmd == "infoScreen") {
                 $this->checkPermission("visible");
             } else {
                 $this->checkPermission("read");
             }
             $this->prepareOutput();
             include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
             $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId()));
             if (!$cmd) {
                 $cmd = "render";
             }
             $cmd .= "Object";
             $this->{$cmd}();
             break;
     }
     return true;
 }
 function &executeCommand()
 {
     global $ilUser, $rbacsystem, $ilAccess, $ilNavigationHistory, $ilErr, $ilCtrl;
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     $this->prepareOutput();
     // add entry to navigation history
     if (!$this->getCreationMode() && $ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
         $ilNavigationHistory->addItem($_GET["ref_id"], $ilCtrl->getLinkTargetByClass("ilrepositorygui", "frameset"), "grp");
     }
     switch ($next_class) {
         case 'ilgroupregistrationgui':
             $this->ctrl->setReturn($this, '');
             $this->tabs_gui->setTabActive('join');
             include_once './Modules/Group/classes/class.ilGroupRegistrationGUI.php';
             $registration = new ilGroupRegistrationGUI($this->object);
             $this->ctrl->forwardCommand($registration);
             break;
         case 'ilpermissiongui':
             $this->tabs_gui->setTabActive('perm_settings');
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui =& new ilPermissionGUI($this);
             $ret =& $this->ctrl->forwardCommand($perm_gui);
             break;
         case 'ilrepositorysearchgui':
             include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
             $rep_search =& new ilRepositorySearchGUI();
             $rep_search->setCallback($this, 'addUserObject', array(ilObjGroup::GRP_MEMBER => $this->lng->txt('il_grp_member'), ilObjGroup::GRP_ADMIN => $this->lng->txt('il_grp_admin')));
             // Set tabs
             $this->tabs_gui->setTabActive('members');
             $this->ctrl->setReturn($this, 'members');
             $ret =& $this->ctrl->forwardCommand($rep_search);
             $this->setSubTabs('members');
             $this->tabs_gui->setSubTabActive('members');
             break;
         case "ilinfoscreengui":
             $ret =& $this->infoScreen();
             break;
         case "illearningprogressgui":
             include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
             $new_gui =& new ilLearningProgressGUI(LP_MODE_REPOSITORY, $this->object->getRefId(), $_GET['user_id'] ? $_GET['user_id'] : $ilUser->getId());
             $this->ctrl->forwardCommand($new_gui);
             $this->tabs_gui->setTabActive('learning_progress');
             break;
         case 'ilobjcoursegroupinggui':
             $this->setSubTabs('settings');
             include_once './Modules/Course/classes/class.ilObjCourseGroupingGUI.php';
             $this->ctrl->setReturn($this, 'edit');
             $crs_grp_gui =& new ilObjCourseGroupingGUI($this->object, (int) $_GET['obj_id']);
             $this->ctrl->forwardCommand($crs_grp_gui);
             $this->tabs_gui->setTabActive('settings');
             $this->tabs_gui->setSubTabActive('groupings');
             break;
         case 'ilcoursecontentgui':
             include_once './Modules/Course/classes/class.ilCourseContentGUI.php';
             $course_content_obj = new ilCourseContentGUI($this);
             $this->ctrl->forwardCommand($course_content_obj);
             break;
         case 'ilpublicuserprofilegui':
             require_once './Services/User/classes/class.ilPublicUserProfileGUI.php';
             $this->setSubTabs('members');
             $this->tabs_gui->setTabActive('group_members');
             $this->tabs_gui->setSubTabActive('grp_members_gallery');
             $profile_gui = new ilPublicUserProfileGUI($_GET["user"]);
             $profile_gui->setBackUrl($ilCtrl->getLinkTarget($this, "membersGallery"));
             $html = $this->ctrl->forwardCommand($profile_gui);
             $this->tpl->setVariable("ADM_CONTENT", $html);
             break;
         case "ilcolumngui":
             $this->tabs_gui->setTabActive('none');
             $this->checkPermission("read");
             include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
             $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId()));
             $this->renderObject();
             break;
             // container page editing
         // container page editing
         case "ilpageobjectgui":
             $ret = $this->forwardToPageObject();
             if ($ret != "") {
                 $this->tpl->setContent($ret);
             }
             break;
         case 'ilobjectcopygui':
             include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
             $cp = new ilObjectCopyGUI($this);
             $cp->setType('grp');
             $this->ctrl->forwardCommand($cp);
             break;
         case "ilobjstylesheetgui":
             $this->forwardToStyleSheet();
             break;
         case 'ilobjectcustomuserfieldsgui':
             include_once './Services/Membership/classes/class.ilObjectCustomUserFieldsGUI.php';
             $cdf_gui = new ilObjectCustomUserFieldsGUI($this->object->getId());
             $this->setSubTabs('settings');
             $this->tabs_gui->setTabActive('settings');
             $this->ctrl->forwardCommand($cdf_gui);
             break;
         case 'ilmemberagreementgui':
             include_once 'Services/Membership/classes/class.ilMemberAgreementGUI.php';
             $this->ctrl->setReturn($this, '');
             $this->tabs_gui->setTabActive('view_content');
             $agreement = new ilMemberAgreementGUI($this->object->getRefId());
             $this->ctrl->forwardCommand($agreement);
             break;
         case 'ilexportgui':
             $this->tabs_gui->setTabActive('export');
             include_once './Services/Export/classes/class.ilExportGUI.php';
             $exp = new ilExportGUI($this);
             $exp->addFormat('xml');
             $this->ctrl->forwardCommand($exp);
             break;
         case 'ilmemberexportgui':
             include_once './Services/Membership/classes/Export/class.ilMemberExportGUI.php';
             $this->setSubTabs('members');
             $this->tabs_gui->setTabActive('members');
             $this->tabs_gui->setSubTabActive('export_members');
             $export = new ilMemberExportGUI($this->object->getRefId());
             $this->ctrl->forwardCommand($export);
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case 'ilobjectservicesettingsgui':
             $this->ctrl->setReturn($this, 'edit');
             $this->setSubTabs("settings");
             $this->tabs_gui->activateTab('settings');
             $this->tabs_gui->activateSubTab('tool_settings');
             include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
             $service = new ilObjectServiceSettingsGUI($this, $this->object->getId(), array(ilObjectServiceSettingsGUI::CALENDAR_VISIBILITY));
             $this->ctrl->forwardCommand($service);
             break;
         case 'ilsessionoverviewgui':
             $this->setSubTabs('members');
             $this->tabs_gui->setTabActive('members');
             $this->tabs_gui->setSubTabActive('events');
             include_once './Modules/Group/classes/class.ilGroupParticipants.php';
             $prt = ilGroupParticipants::_getInstanceByObjId($this->object->getId());
             include_once './Modules/Session/classes/class.ilSessionOverviewGUI.php';
             $overview = new ilSessionOverviewGUI($this->object->getRefId(), $prt);
             $this->ctrl->forwardCommand($overview);
             break;
         default:
             // check visible permission
             if (!$this->getCreationMode() and !$ilAccess->checkAccess('visible', '', $this->object->getRefId(), 'grp')) {
                 $ilErr->raiseError($this->lng->txt("msg_no_perm_read"), $ilErr->MESSAGE);
             }
             // #9401 - see also ilStartupGUI::_checkGoto()
             if ($cmd == 'infoScreenGoto') {
                 if ($this->object->isRegistrationEnabled()) {
                     $cmd = 'join';
                 } else {
                     $cmd = 'infoScreen';
                 }
             }
             // check read permission
             if (!$this->getCreationMode() && !$rbacsystem->checkAccess('read', $this->object->getRefId()) && $cmd != 'infoScreen' || $cmd == 'join') {
                 // no join permission -> redirect to info screen
                 if (!$rbacsystem->checkAccess('join', $this->object->getRefId())) {
                     $this->ctrl->redirect($this, "infoScreen");
                 } else {
                     include_once './Modules/Group/classes/class.ilGroupRegistrationGUI.php';
                     $this->ctrl->redirectByClass("ilGroupRegistrationGUI", "show");
                 }
             }
             if (!$cmd) {
                 $cmd = 'view';
             }
             $cmd .= 'Object';
             $this->{$cmd}();
             break;
     }
     $this->addHeaderAction();
 }
 /**
  * Dispatches the command to the related executor class.
  */
 public function executeCommand()
 {
     /**
      * @var $ilAccess            ilAccessHandler
      * @var $ilNavigationHistory ilNavigationHistory
      * @var $ilCtrl              ilCtrl
      * @var $ilHelp              ilHelpGUI
      */
     global $ilNavigationHistory, $ilCtrl, $ilHelp, $ilAccess;
     if ('cancel' == $ilCtrl->getCmd() && $this->getCreationMode()) {
         parent::cancelCreation();
         return;
     }
     // add entry to navigation history
     if (!$this->getCreationMode() && $ilAccess->checkAccess('read', '', (int) $_GET['ref_id'])) {
         $ilNavigationHistory->addItem($_GET['ref_id'], './goto.php?target=' . $this->type . '_' . $_GET['ref_id'], $this->type);
     }
     $next_class = $ilCtrl->getNextClass();
     require_once 'Modules/Chatroom/classes/class.ilChatroomTabFactory.php';
     if (!$this->getCreationMode()) {
         $tabFactory = new ilChatroomTabFactory($this);
         if (strtolower($_GET['baseClass']) == 'iladministrationgui') {
             $tabFactory->getAdminTabsForCommand($ilCtrl->getCmd());
         } else {
             $ilHelp->setScreenIdComponent("chtr");
             $tabFactory->getTabsForCommand($ilCtrl->getCmd());
         }
     }
     // #8701 - infoscreen actions
     if ($next_class == 'ilinfoscreengui' && $ilCtrl->getCmd() != 'info') {
         $ilCtrl->setCmd('info-' . $ilCtrl->getCmd());
     }
     // repository info call
     if ($ilCtrl->getCmd() == 'infoScreen') {
         $ilCtrl->setCmdClass('ilinfoscreengui');
         $ilCtrl->setCmd('info');
     }
     switch ($next_class) {
         case 'ilpermissiongui':
             include_once 'Services/AccessControl/classes/class.ilPermissionGUI.php';
             $this->prepareOutput();
             $perm_gui = new ilPermissionGUI($this);
             $ilCtrl->forwardCommand($perm_gui);
             break;
         case 'ilobjectcopygui':
             $this->prepareOutput();
             include_once 'Services/Object/classes/class.ilObjectCopyGUI.php';
             $cp = new ilObjectCopyGUI($this);
             $cp->setType('chtr');
             $ilCtrl->forwardCommand($cp);
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         default:
             try {
                 $res = explode('-', $ilCtrl->getCmd(), 2);
                 $this->dispatchCall($res[0], $res[1] ? $res[1] : '');
             } catch (Exception $e) {
                 $error = array('success' => false, 'reason' => $e->getMessage());
                 echo json_encode($error);
                 exit;
             }
     }
 }
 /**
  * execute command
  */
 function executeCommand()
 {
     global $ilAccess, $ilNavigationHistory, $ilCtrl, $ilErr;
     if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"]) && !$ilAccess->checkAccess("visible", "", $_GET["ref_id"])) {
         global $ilias;
         $ilias->raiseError($this->lng->txt("permission_denied"), $ilias->error_obj->MESSAGE);
     }
     $cmd = $this->ctrl->getCmd("properties");
     $cmdsDisabledDueToOfflineStatus = array('resume', 'start', 'outUserResultsOverview', 'outUserListOfAnswerPasses');
     if (!$this->getCreationMode() && !$this->object->isOnline() && in_array($cmd, $cmdsDisabledDueToOfflineStatus)) {
         $cmd = 'infoScreen';
     }
     $next_class = $this->ctrl->getNextClass($this);
     $this->ctrl->setReturn($this, "properties");
     if (method_exists($this->object, "getTestStyleLocation")) {
         $this->tpl->addCss($this->object->getTestStyleLocation("output"), "screen");
     }
     // add entry to navigation history
     if (!$this->getCreationMode() && $ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
         $ilNavigationHistory->addItem($_GET["ref_id"], "ilias.php?baseClass=ilObjTestGUI&cmd=infoScreen&ref_id=" . $_GET["ref_id"], "tst");
     }
     if (!$this->getCreationMode()) {
         if (IS_PAYMENT_ENABLED) {
             include_once 'Services/Payment/classes/class.ilPaymentObject.php';
             if (ilPaymentObject::_requiresPurchaseToAccess($this->object->getRefId(), $type = isset($_GET['purchasetype']) ? $_GET['purchasetype'] : NULL)) {
                 $this->setLocator();
                 $this->tpl->getStandardTemplate();
                 include_once 'Services/Payment/classes/class.ilShopPurchaseGUI.php';
                 $pp = new ilShopPurchaseGUI((int) $_GET['ref_id']);
                 $ret = $this->ctrl->forwardCommand($pp);
                 $this->tpl->show();
                 exit;
             }
         }
     }
     // elba hack for storing question id for inserting new question after
     if ($_REQUEST['prev_qid']) {
         global $___prev_question_id;
         $___prev_question_id = $_REQUEST['prev_qid'];
         $this->ctrl->setParameter($this, 'prev_qid', $_REQUEST['prev_qid']);
     }
     switch ($next_class) {
         case "ilinfoscreengui":
             $this->prepareOutput();
             $this->addHeaderAction();
             $this->infoScreen();
             // forwards command
             break;
         case 'ilmdeditorgui':
             if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
                 $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
             }
             $this->prepareOutput();
             $this->addHeaderAction();
             include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';
             $md_gui =& new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType());
             $md_gui->addObserver($this->object, 'MDUpdateListener', 'General');
             $this->ctrl->forwardCommand($md_gui);
             break;
         case "iltestoutputgui":
             include_once "./Modules/Test/classes/class.ilTestOutputGUI.php";
             if (!$this->object->getKioskMode()) {
                 $this->prepareOutput();
             }
             $output_gui =& new ilTestOutputGUI($this->object);
             $this->ctrl->forwardCommand($output_gui);
             break;
         case "iltestevaluationgui":
             $this->prepareOutput();
             $this->addHeaderAction();
             include_once "./Modules/Test/classes/class.ilTestEvaluationGUI.php";
             $evaluation_gui =& new ilTestEvaluationGUI($this->object);
             $this->ctrl->forwardCommand($evaluation_gui);
             break;
         case "iltestservicegui":
             $this->prepareOutput();
             $this->addHeaderAction();
             include_once "./Modules/Test/classes/class.ilTestServiceGUI.php";
             $serviceGUI =& new ilTestServiceGUI($this->object);
             $this->ctrl->forwardCommand($serviceGUI);
             break;
         case 'ilpermissiongui':
             $this->prepareOutput();
             $this->addHeaderAction();
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui =& new ilPermissionGUI($this);
             $ret =& $this->ctrl->forwardCommand($perm_gui);
             break;
         case "illearningprogressgui":
             $this->prepareOutput();
             $this->addHeaderAction();
             include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
             $new_gui =& new ilLearningProgressGUI(LP_MODE_REPOSITORY, $this->object->getRefId());
             $this->ctrl->forwardCommand($new_gui);
             break;
         case "ilcertificategui":
             $this->prepareOutput();
             $this->addHeaderAction();
             include_once "./Services/Certificate/classes/class.ilCertificateGUI.php";
             include_once "./Modules/Test/classes/class.ilTestCertificateAdapter.php";
             $output_gui = new ilCertificateGUI(new ilTestCertificateAdapter($this->object));
             $this->ctrl->forwardCommand($output_gui);
             break;
         case "iltestscoringgui":
             $this->prepareOutput();
             $this->addHeaderAction();
             include_once "./Modules/Test/classes/class.ilTestScoringGUI.php";
             $output_gui = new ilTestScoringGUI($this->object);
             $this->ctrl->forwardCommand($output_gui);
             break;
         case 'ilobjectcopygui':
             $this->prepareOutput();
             $this->addHeaderAction();
             include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
             $cp = new ilObjectCopyGUI($this);
             $cp->setType('tst');
             $this->ctrl->forwardCommand($cp);
             break;
         case 'ilrepositorysearchgui':
             $this->prepareOutput();
             $this->addHeaderAction();
             include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
             $rep_search =& new ilRepositorySearchGUI();
             $rep_search->setCallback($this, 'addParticipantsObject', array());
             // Set tabs
             $this->ctrl->setReturn($this, 'participants');
             $ret =& $this->ctrl->forwardCommand($rep_search);
             $this->tabs_gui->setTabActive('participants');
             break;
         case 'ilpageeditorgui':
         case 'iltestexpresspageobjectgui':
             $qid = $_REQUEST['q_id'];
             // :FIXME: does not work
             // $this->ctrl->saveParameterByClass(array('iltestexpresspageobjectgui', 'assorderingquestiongui', 'ilpageeditorgui', 'ilpcquestion', 'ilpcquestiongui'), 'test_express_mode');
             if (!$qid || $qid == 'Array') {
                 $questions = $this->object->getQuestionTitlesAndIndexes();
                 if (!is_array($questions)) {
                     $questions = array();
                 }
                 $keys = array_keys($questions);
                 $qid = $keys[0];
                 $_REQUEST['q_id'] = $qid;
                 $_GET['q_id'] = $qid;
                 $_POST['q_id'] = $qid;
             }
             $this->prepareOutput();
             if (!in_array($cmd, array('addQuestion', 'browseForQuestions'))) {
                 $this->buildPageViewToolbar($qid);
             }
             if (!$qid || in_array($cmd, array('insertQuestions', 'browseForQuestions'))) {
                 include_once "./Modules/Test/classes/class.ilTestExpressPageObjectGUI.php";
                 $pageObject = new ilTestExpressPageObjectGUI("qpl", 0);
                 $pageObject->test_object = $this->object;
                 $ret =& $this->ctrl->forwardCommand($pageObject);
                 break;
             }
             include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
             $this->tpl->setCurrentBlock("ContentStyle");
             $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
             $this->tpl->parseCurrentBlock();
             // syntax style
             $this->tpl->setCurrentBlock("SyntaxStyle");
             $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
             $this->tpl->parseCurrentBlock();
             include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
             $q_gui =& assQuestionGUI::_getQuestionGUI("", $qid);
             $q_gui->outAdditionalOutput();
             $q_gui->object->setObjId($this->object->getId());
             $question =& $q_gui->object;
             $this->ctrl->saveParameter($this, "q_id");
             #$this->lng->loadLanguageModule("content");
             $this->ctrl->setReturnByClass("ilTestExpressPageObjectGUI", "view");
             $this->ctrl->setReturn($this, "questions");
             //$page =& new ilPageObject("qpl", $_GET["q_id"]);
             include_once "./Services/COPage/classes/class.ilPageObject.php";
             include_once "./Modules/Test/classes/class.ilTestExpressPageObjectGUI.php";
             $page_gui =& new ilTestExpressPageObjectGUI("qpl", $qid);
             $page_gui->test_object = $this->object;
             $page_gui->setEditPreview(true);
             $page_gui->setEnabledTabs(false);
             $page_gui->setEnabledInternalLinks(false);
             if (strlen($this->ctrl->getCmd()) == 0) {
                 $this->ctrl->setCmdClass(get_class($page_gui));
                 $this->ctrl->setCmd("preview");
             }
             $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(TRUE)));
             $page_gui->setTemplateTargetVar("ADM_CONTENT");
             $page_gui->setOutputMode($this->object->evalTotalPersons() == 0 ? "edit" : 'preview');
             $page_gui->setHeader($question->getTitle());
             $page_gui->setFileDownloadLink($this->ctrl->getLinkTarget($this, "downloadFile"));
             $page_gui->setFullscreenLink($this->ctrl->getLinkTarget($this, "fullscreen"));
             $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTarget($this));
             $page_gui->setPresentationTitle($question->getTitle());
             $ret =& $this->ctrl->forwardCommand($page_gui);
             global $ilTabs;
             $ilTabs->activateTab('assQuestions');
             $this->tpl->setContent($ret);
             break;
         case 'ilpageobjectgui':
             include_once "./Services/COPage/classes/class.ilPageObjectGUI.php";
             //echo $_REQUEST['prev_qid'];
             if ($_REQUEST['prev_qid']) {
                 $this->ctrl->setParameter($this, 'prev_qid', $_REQUEST['prev_qid']);
             }
             $this->prepareOutput();
             //global $___test_express_mode;
             //$___test_express_mode = true;
             $_GET['calling_test'] = $this->object->getRefId();
             include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
             $this->tpl->setCurrentBlock("ContentStyle");
             $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
             $this->tpl->parseCurrentBlock();
             // syntax style
             $this->tpl->setCurrentBlock("SyntaxStyle");
             $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
             $this->tpl->parseCurrentBlock();
             include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
             $q_gui =& assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
             $q_gui->setQuestionTabs();
             $q_gui->outAdditionalOutput();
             $q_gui->object->setObjId($this->object->getId());
             $question =& $q_gui->object;
             $this->ctrl->saveParameter($this, "q_id");
             include_once "./Services/COPage/classes/class.ilPageObject.php";
             include_once "./Services/COPage/classes/class.ilPageObjectGUI.php";
             $this->lng->loadLanguageModule("content");
             $this->ctrl->setReturnByClass("ilPageObjectGUI", "view");
             $this->ctrl->setReturn($this, "questions");
             //$page =& new ilPageObject("qpl", $_GET["q_id"]);
             $page_gui =& new ilPageObjectGUI("qpl", $_GET["q_id"]);
             $page_gui->setEditPreview(true);
             $page_gui->setEnabledTabs(false);
             $page_gui->setEnabledInternalLinks(false);
             if (strlen($this->ctrl->getCmd()) == 0) {
                 $this->ctrl->setCmdClass(get_class($page_gui));
                 $this->ctrl->setCmd("preview");
             }
             //$page_gui->setQuestionXML($question->toXML(false, false, true));
             $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(TRUE)));
             $page_gui->setTemplateTargetVar("ADM_CONTENT");
             $page_gui->setOutputMode($this->object->evalTotalPersons() == 0 ? "edit" : 'preview');
             $page_gui->setHeader($question->getTitle());
             $page_gui->setFileDownloadLink($this->ctrl->getLinkTarget($this, "downloadFile"));
             $page_gui->setFullscreenLink($this->ctrl->getLinkTarget($this, "fullscreen"));
             $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTarget($this));
             $page_gui->setPresentationTitle($question->getTitle());
             $ret =& $this->ctrl->forwardCommand($page_gui);
             $this->tpl->setContent($ret);
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case 'ilassquestionhintsgui':
             $this->prepareSubGuiOutput();
             // set return target
             $this->ctrl->setReturn($this, "questions");
             // set context tabs
             require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
             $questionGUI =& assQuestionGUI::_getQuestionGUI($q_type, $_GET['q_id']);
             $questionGUI->object->setObjId($this->object->getId());
             $questionGUI->setQuestionTabs();
             // forward to ilAssQuestionHintsGUI
             require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsGUI.php';
             $gui = new ilAssQuestionHintsGUI($questionGUI);
             $ilCtrl->forwardCommand($gui);
             break;
         case 'iltesttoplistgui':
             $this->prepareOutput();
             require_once 'Modules/Test/classes/class.ilTestToplistGUI.php';
             $gui = new ilTestToplistGUI($this);
             $this->ctrl->forwardCommand($gui);
             break;
         case '':
         case 'ilobjtestgui':
             $this->prepareOutput();
             $this->addHeaderAction();
             if (preg_match("/deleteqpl_\\d+/", $cmd)) {
                 $cmd = "randomQuestions";
             }
             if (strcmp($cmd, "properties") == 0 && $_GET["browse"]) {
                 $this->questionBrowser();
                 return;
             }
             if (strcmp($cmd, "properties") == 0 && ($_GET["up"] || $_GET["down"])) {
                 $this->questionsObject();
                 return;
             }
             $cmd .= "Object";
             $ret =& $this->{$cmd}();
             break;
         default:
             // elba hack for storing question id for inserting new question after
             if ($_REQUEST['prev_qid']) {
                 global $___prev_question_id;
                 $___prev_question_id = $_REQUEST['prev_qid'];
                 $this->ctrl->setParameterByClass('ilpageobjectgui', 'prev_qid', $_REQUEST['prev_qid']);
                 $this->ctrl->setParameterByClass($_GET['sel_question_types'] . 'gui', 'prev_qid', $_REQUEST['prev_qid']);
             }
             $this->create_question_mode = true;
             $this->prepareOutput();
             $this->ctrl->setReturn($this, "questions");
             include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
             $q_gui =& assQuestionGUI::_getQuestionGUI($_GET['sel_question_types'], $_GET["q_id"]);
             $q_gui->object->setObjId($this->object->getId());
             if (!$_GET['sel_question_types']) {
                 $qType = assQuestion::getQuestionTypeFromDb($_GET['q_id']);
             } else {
                 $qType = $_GET['sel_question_types'];
             }
             $this->ctrl->setParameterByClass($qType . "GUI", 'prev_qid', $_REQUEST['prev_qid']);
             $this->ctrl->setParameterByClass($qType . "GUI", 'test_ref_id', $_REQUEST['ref_id']);
             $this->ctrl->setParameterByClass($qType . "GUI", 'q_id', $_REQUEST['q_id']);
             if ($_REQUEST['test_express_mode']) {
                 $this->ctrl->setParameterByClass($qType . "GUI", 'test_express_mode', 1);
             }
             #global $___test_express_mode;
             #$___test_express_mode = true;
             if (!$q_gui->isSaveCommand()) {
                 $_GET['calling_test'] = $this->object->getRefId();
             }
             $q_gui->setQuestionTabs();
             #unset($___test_express_mode);
             $ret =& $this->ctrl->forwardCommand($q_gui);
             break;
     }
     if (strtolower($_GET["baseClass"]) != "iladministrationgui" && $this->getCreationMode() != true) {
         $this->tpl->show();
     }
 }
 /**
  * execute command
  */
 function &executeCommand()
 {
     global $ilAccess, $lng, $ilTabs, $ilCtrl, $ilErr;
     if ($this->ctrl->getRedirectSource() == "ilinternallinkgui") {
         $this->explorer();
         return;
     }
     if ($this->ctrl->getCmdClass() == "ilinternallinkgui") {
         $this->ctrl->setReturn($this, "explorer");
     }
     // get next class that processes or forwards current command
     $next_class = $this->ctrl->getNextClass($this);
     // get current command
     //		$cmd = $this->ctrl->getCmd("", array("downloadExportFile"));
     if ($_GET["to_props"] == 1) {
         $cmd = $this->ctrl->getCmd("properties");
     } else {
         $cmd = $this->ctrl->getCmd("chapters");
     }
     //echo "-$cmd-".$next_class."-";
     switch ($next_class) {
         case "illearningprogressgui":
             $this->addHeaderAction();
             $this->addLocations();
             include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
             $this->setTabs("learning_progress");
             $new_gui =& new ilLearningProgressGUI(ilLearningProgressGUI::LP_CONTEXT_REPOSITORY, $this->object->getRefId());
             $this->ctrl->forwardCommand($new_gui);
             break;
         case 'ilmdeditorgui':
             if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
                 $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
             }
             $this->addHeaderAction();
             $this->addLocations();
             include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';
             $this->setTabs("meta");
             $md_gui =& new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType());
             $md_gui->addObserver($this->object, 'MDUpdateListener', 'General');
             $this->ctrl->forwardCommand($md_gui);
             break;
         case "ilobjstylesheetgui":
             $this->addLocations();
             include_once "./Services/Style/classes/class.ilObjStyleSheetGUI.php";
             $this->ctrl->setReturn($this, "editStyleProperties");
             $style_gui =& new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
             $style_gui->omitLocator();
             if ($cmd == "create" || $_GET["new_type"] == "sty") {
                 $style_gui->setCreationMode(true);
             }
             $ret =& $this->ctrl->forwardCommand($style_gui);
             //$ret =& $style_gui->executeCommand();
             if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle") {
                 $style_id = $ret;
                 $this->object->setStyleSheetId($style_id);
                 $this->object->update();
                 $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
             }
             break;
         case "illmpageobjectgui":
             $ilTabs->setBackTarget($lng->txt("learning module"), $ilCtrl->getLinkTarget($this, "chapters"));
             $this->ctrl->saveParameter($this, array("obj_id"));
             $this->addLocations();
             $this->ctrl->setReturn($this, "chapters");
             //echo "!";
             //$this->lm_obj =& $this->ilias->obj_factory->getInstanceByRefId($this->ref_id);
             $pg_gui =& new ilLMPageObjectGUI($this->object);
             if ($_GET["obj_id"] != "") {
                 $obj =& ilLMObjectFactory::getInstance($this->object, $_GET["obj_id"]);
                 $pg_gui->setLMPageObject($obj);
             }
             //$ret =& $pg_gui->executeCommand();
             $ret =& $this->ctrl->forwardCommand($pg_gui);
             if ($cmd == "save" || $cmd == "cancel") {
                 //					$this->ctrl->redirect($this, "pages");
             }
             break;
         case "ilstructureobjectgui":
             $ilTabs->setBackTarget($lng->txt("learning module"), $ilCtrl->getLinkTarget($this, "chapters"));
             $this->ctrl->saveParameter($this, array("obj_id"));
             $this->addLocations();
             $this->ctrl->setReturn($this, "chapters");
             $st_gui =& new ilStructureObjectGUI($this->object, $this->object->lm_tree);
             if ($_GET["obj_id"] != "") {
                 $obj =& ilLMObjectFactory::getInstance($this->object, $_GET["obj_id"]);
                 $st_gui->setStructureObject($obj);
             }
             //$ret =& $st_gui->executeCommand();
             $ret =& $this->ctrl->forwardCommand($st_gui);
             if ($cmd == "save" || $cmd == "cancel") {
                 if ($_GET["obj_id"] == "") {
                     $this->ctrl->redirect($this, "chapters");
                 } else {
                     $this->ctrl->setCmd("subchap");
                     $this->executeCommand();
                 }
             }
             break;
         case 'ilpermissiongui':
             if (strtolower($_GET["baseClass"]) == "iladministrationgui") {
                 $this->prepareOutput();
             } else {
                 $this->addHeaderAction();
                 $this->addLocations(true);
                 $this->setTabs("perm");
             }
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui =& new ilPermissionGUI($this);
             $ret =& $this->ctrl->forwardCommand($perm_gui);
             break;
             // infoscreen
         // infoscreen
         case 'ilinfoscreengui':
             $this->addHeaderAction();
             $this->addLocations(true);
             $this->setTabs("info");
             include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php";
             $info = new ilInfoScreenGUI($this);
             $info->enablePrivateNotes();
             $info->enableLearningProgress();
             $info->enableNews();
             if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
                 $info->enableNewsEditing();
                 $info->setBlockProperty("news", "settings", true);
             }
             // show standard meta data section
             $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
             $ret =& $this->ctrl->forwardCommand($info);
             break;
         case "ilexportgui":
             $this->addHeaderAction();
             $this->addLocations(true);
             $this->setTabs("export");
             include_once "./Services/Export/classes/class.ilExportGUI.php";
             $exp_gui = new ilExportGUI($this);
             $exp_gui->addFormat("xml", "", $this, "export");
             include_once "./Services/Object/classes/class.ilObjectTranslation.php";
             $ot = ilObjectTranslation::getInstance($this->object->getId());
             if ($ot->getContentActivated()) {
                 $lng->loadLanguageModule("meta");
                 $langs = $ot->getLanguages();
                 foreach ($langs as $l => $ldata) {
                     $exp_gui->addFormat("html_" . $l, "HTML (" . $lng->txt("meta_l_" . $l) . ")", $this, "exportHTML");
                 }
             } else {
                 $exp_gui->addFormat("html", "", $this, "exportHTML");
             }
             $exp_gui->addFormat("scorm", "", $this, "exportSCORM");
             $exp_gui->addCustomColumn($lng->txt("cont_public_access"), $this, "getPublicAccessColValue");
             $exp_gui->addCustomMultiCommand($lng->txt("cont_public_access"), $this, "publishExportFile");
             $ret = $this->ctrl->forwardCommand($exp_gui);
             break;
         case 'ilobjecttranslationgui':
             $this->addHeaderAction();
             $this->addLocations(true);
             //$this->checkPermissionBool("write");
             //$this->prepareOutput();
             //$this->tabs_gui->setTabActive('export');
             $this->setTabs("settings");
             $this->setSubTabs("obj_multilinguality");
             include_once "./Services/Object/classes/class.ilObjectTranslationGUI.php";
             $transgui = new ilObjectTranslationGUI($this);
             $transgui->setTitleDescrOnlyMode(false);
             $this->ctrl->forwardCommand($transgui);
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case 'ilobjectcopygui':
             $this->prepareOutput();
             include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
             $cp = new ilObjectCopyGUI($this);
             $cp->setType('lm');
             $this->ctrl->forwardCommand($cp);
             break;
         default:
             $new_type = $_POST["new_type"] ? $_POST["new_type"] : $_GET["new_type"];
             if ($cmd == "create" && !in_array($new_type, array("dbk", "lm"))) {
                 //$this->addLocations();
                 switch ($new_type) {
                     case "pg":
                         $this->setTabs();
                         $this->ctrl->setCmdClass("ilLMPageObjectGUI");
                         $ret =& $this->executeCommand();
                         break;
                     case "st":
                         $this->setTabs();
                         $this->ctrl->setCmdClass("ilStructureObjectGUI");
                         $ret =& $this->executeCommand();
                         break;
                 }
             } else {
                 // creation of new dbk/lm in repository
                 if ($this->getCreationMode() == true && in_array($new_type, array("dbk", "lm"))) {
                     $this->prepareOutput();
                     if ($cmd == "") {
                         $cmd = "create";
                     }
                     $cmd .= "Object";
                     $ret =& $this->{$cmd}();
                 } else {
                     $this->addHeaderAction();
                     $this->addLocations();
                     $ret =& $this->{$cmd}();
                 }
             }
             break;
     }
     return $ret;
 }
 /**
  * execute command
  */
 function &executeCommand()
 {
     global $ilCtrl, $tpl, $ilAccess, $lng, $ilNavigationHistory, $ilTabs;
     // get standard template (includes main menu and general layout)
     $tpl->getStandardTemplate();
     // set title
     if (!$this->getCreationMode()) {
         $tpl->setTitle($this->object->getTitle());
         $tpl->setTitleIcon($this->plugin->getImagePath("icon_" . $this->object->getType() . "_b.png"), $lng->txt("icon") . " " . $this->txt("obj_" . $this->object->getType()));
         // set tabs
         if (strtolower($_GET["baseClass"]) != "iladministrationgui") {
             $this->setTabs();
             $this->setLocator();
         } else {
             $this->addAdminLocatorItems();
             $tpl->setLocator();
             $this->setAdminTabs();
         }
         // add entry to navigation history
         if ($ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
             $ilNavigationHistory->addItem($_GET["ref_id"], $ilCtrl->getLinkTarget($this, $this->getStandardCmd()), $this->getType());
         }
     } else {
         // show info of parent
         $tpl->setTitle(ilObject::_lookupTitle(ilObject::_lookupObjId($_GET["ref_id"])));
         $tpl->setTitleIcon(ilObject::_getIcon(ilObject::_lookupObjId($_GET["ref_id"]), "big"), $lng->txt("obj_" . ilObject::_lookupType($_GET["ref_id"], true)));
         $this->setLocator();
     }
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     switch ($next_class) {
         case "ilinfoscreengui":
             $this->checkPermission("visible");
             $this->infoScreen();
             // forwards command
             break;
         case 'ilpermissiongui':
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui = new ilPermissionGUI($this);
             $ilTabs->setTabActive("perm_settings");
             $ret = $ilCtrl->forwardCommand($perm_gui);
             break;
         case 'ilobjectcopygui':
             include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
             $cp = new ilObjectCopyGUI($this);
             $cp->setType($this->getType());
             $this->ctrl->forwardCommand($cp);
             break;
         default:
             if (strtolower($_GET["baseClass"]) == "iladministrationgui") {
                 $this->viewObject();
                 return;
             }
             if (!$cmd) {
                 $cmd = $this->getStandardCmd();
             }
             if ($cmd == "infoScreen") {
                 $ilCtrl->setCmd("showSummary");
                 $ilCtrl->setCmdClass("ilinfoscreengui");
                 $this->infoScreen();
             } else {
                 if ($this->getCreationMode()) {
                     $this->{$cmd}();
                 } else {
                     $this->performCommand($cmd);
                 }
             }
             break;
     }
     if (!$this->getCreationMode()) {
         $tpl->show();
     }
 }
 /**
  * execute command
  */
 public function executeCommand()
 {
     global $ilAccess, $ilNavigationHistory, $ilErr;
     if ($this->ctrl->getCmd("questions") != "questions") {
         // #11186
         $rbac_ref_id = $_REQUEST["calling_survey"];
         if (!$rbac_ref_id) {
             $rbac_ref_id = $_REQUEST["new_for_survey"];
         }
         if (!$rbac_ref_id) {
             $rbac_ref_id = $_REQUEST["ref_id"];
         }
     } else {
         $rbac_ref_id = $_REQUEST["ref_id"];
     }
     if (!$ilAccess->checkAccess("read", "", $rbac_ref_id) && !$ilAccess->checkAccess("visible", "", $rbac_ref_id)) {
         global $ilias;
         $ilias->raiseError($this->lng->txt("permission_denied"), $ilias->error_obj->MESSAGE);
     }
     // add entry to navigation history
     if (!$this->getCreationMode() && $ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
         $ilNavigationHistory->addItem($_GET["ref_id"], "ilias.php?baseClass=ilObjSurveyQuestionPoolGUI&cmd=questions&ref_id=" . $_GET["ref_id"], "spl");
     }
     $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "survey.css", "Modules/Survey"), "screen");
     $this->prepareOutput();
     $cmd = $this->ctrl->getCmd("questions");
     $next_class = $this->ctrl->getNextClass($this);
     $this->ctrl->setReturn($this, "questions");
     if ($_GET["q_id"] < 1) {
         $q_type = $_POST["sel_question_types"] != "" ? $_POST["sel_question_types"] : $_GET["sel_question_types"];
     }
     switch ($next_class) {
         case 'ilmdeditorgui':
             if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
                 $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
             }
             include_once "./Services/MetaData/classes/class.ilMDEditorGUI.php";
             $md_gui =& new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType());
             $md_gui->addObserver($this->object, 'MDUpdateListener', 'General');
             $this->ctrl->forwardCommand($md_gui);
             break;
         case 'ilpermissiongui':
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui =& new ilPermissionGUI($this);
             $ret =& $this->ctrl->forwardCommand($perm_gui);
             break;
         case "ilsurveyphrasesgui":
             include_once "./Modules/SurveyQuestionPool/classes/class.ilSurveyPhrasesGUI.php";
             $phrases_gui =& new ilSurveyPhrasesGUI($this);
             $ret =& $this->ctrl->forwardCommand($phrases_gui);
             break;
         case 'ilobjectcopygui':
             include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
             $cp = new ilObjectCopyGUI($this);
             $cp->setType('spl');
             $this->ctrl->forwardCommand($cp);
             break;
         case 'ilinfoscreengui':
             $this->infoScreenForward();
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case "":
             $cmd .= "Object";
             $ret =& $this->{$cmd}();
             break;
         default:
             include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestionGUI.php";
             $q_gui = SurveyQuestionGUI::_getQuestionGUI($q_type, $_GET["q_id"]);
             $q_gui->object->setObjId($this->object->getId());
             $q_gui->setQuestionTabs();
             $ret =& $this->ctrl->forwardCommand($q_gui);
             break;
     }
     if (strtolower($_GET["baseClass"]) != "iladministrationgui" && $this->getCreationMode() != true) {
         $this->tpl->show();
     }
 }
 /**
  * execute command
  */
 function &executeCommand()
 {
     global $lng, $ilAccess, $ilTabs, $ilErr;
     $cmd = $this->ctrl->getCmd();
     $next_class = $this->ctrl->getNextClass($this);
     switch ($next_class) {
         case 'ilmdeditorgui':
             $this->checkPermission("write");
             $this->getTemplate();
             $this->setTabs();
             $this->setLocator();
             $this->addHeaderAction();
             include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';
             $md_gui =& new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType());
             $md_gui->addObserver($this->object, 'MDUpdateListener', 'General');
             $this->ctrl->forwardCommand($md_gui);
             break;
         case "ilglossarytermgui":
             $this->getTemplate();
             //				$this->quickList();
             $this->ctrl->setReturn($this, "listTerms");
             $term_gui =& new ilGlossaryTermGUI($this->term_id);
             $term_gui->setGlossary($this->object);
             //$ret =& $term_gui->executeCommand();
             $ret =& $this->ctrl->forwardCommand($term_gui);
             break;
         case "ilinfoscreengui":
             $this->addHeaderAction();
             $this->showInfoScreen();
             break;
         case "ilobjstylesheetgui":
             include_once "./Services/Style/classes/class.ilObjStyleSheetGUI.php";
             $this->ctrl->setReturn($this, "editStyleProperties");
             $style_gui = new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
             $style_gui->omitLocator();
             if ($cmd == "create" || $_GET["new_type"] == "sty") {
                 $style_gui->setCreationMode(true);
             }
             if ($cmd == "confirmedDelete") {
                 $this->object->setStyleSheetId(0);
                 $this->object->update();
             }
             $ret = $this->ctrl->forwardCommand($style_gui);
             if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle") {
                 $style_id = $ret;
                 $this->object->setStyleSheetId($style_id);
                 $this->object->update();
                 $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
             }
             break;
         case 'ilpermissiongui':
             if (strtolower($_GET["baseClass"]) == "iladministrationgui") {
                 $this->prepareOutput();
             } else {
                 $this->getTemplate();
                 $this->setTabs();
                 $this->setLocator();
                 $this->addHeaderAction();
             }
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui =& new ilPermissionGUI($this);
             $ret =& $this->ctrl->forwardCommand($perm_gui);
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case "ilobjtaxonomygui":
             $this->getTemplate();
             $this->setTabs();
             $this->setLocator();
             $this->addHeaderAction();
             $ilTabs->activateTab("settings");
             $this->setSettingsSubTabs("taxonomy");
             include_once "./Services/Taxonomy/classes/class.ilObjTaxonomyGUI.php";
             $this->ctrl->setReturn($this, "properties");
             $tax_gui = new ilObjTaxonomyGUI();
             $tax_gui->setMultiple(false);
             /*include_once("./Modules/Glossary/classes/class.ilTermTaxInfo.php");
             		$term_info = new ilTermTaxInfo();*/
             //$tax_gui->activateAssignedItemSorting($term_info, "glo", "term");
             $tax_gui->setAssignedObject($this->object->getId());
             $ret = $this->ctrl->forwardCommand($tax_gui);
             break;
         case "ilexportgui":
             $this->getTemplate();
             $this->setTabs();
             $ilTabs->activateTab("export");
             $this->setLocator();
             include_once "./Services/Export/classes/class.ilExportGUI.php";
             $exp_gui = new ilExportGUI($this);
             //$exp_gui->addFormat("xml", "", $this, "export");
             $exp_gui->addFormat("xml");
             $exp_gui->addFormat("html", "", $this, "exportHTML");
             $exp_gui->addCustomColumn($lng->txt("cont_public_access"), $this, "getPublicAccessColValue");
             $exp_gui->addCustomMultiCommand($lng->txt("cont_public_access"), $this, "publishExportFile");
             $ret = $this->ctrl->forwardCommand($exp_gui);
             break;
         case 'ilobjectcopygui':
             $this->prepareOutput();
             include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
             $cp = new ilObjectCopyGUI($this);
             $cp->setType('glo');
             $this->ctrl->forwardCommand($cp);
             break;
         default:
             $cmd = $this->ctrl->getCmd("listTerms");
             if ($cmd == "create" && $_POST["new_type"] == "term") {
                 $this->ctrl->setCmd("create");
                 $this->ctrl->setCmdClass("ilGlossaryTermGUI");
                 $ret =& $this->executeCommand();
                 return;
             } else {
                 if (!in_array($cmd, array("frameset", "quickList"))) {
                     if (strtolower($_GET["baseClass"]) == "iladministrationgui" || $this->getCreationMode() == true) {
                         $this->prepareOutput();
                         $cmd .= "Object";
                     } else {
                         $this->getTemplate();
                         $this->setTabs();
                         $this->setLocator();
                         $this->addHeaderAction();
                         if ($cmd == "redrawHeaderAction") {
                             $cmd = "redrawHeaderActionObject";
                         }
                     }
                 }
                 $ret =& $this->{$cmd}();
             }
             break;
     }
     if (!in_array($cmd, array("frameset", "quickList"))) {
         if (strtolower($_GET["baseClass"]) != "iladministrationgui") {
             if (!$this->getCreationMode()) {
                 $this->tpl->show();
             }
         }
     } else {
         $this->tpl->show(false);
     }
 }
 public function executeCommand()
 {
     global $ilNavigationHistory;
     $this->tpl->getStandardTemplate();
     // add entry to navigation history
     if (!$this->getCreationMode() && $this->getAccessHandler()->checkAccess("read", "", $this->node_id)) {
         $link = $this->ctrl->getLinkTarget($this, "view");
         $ilNavigationHistory->addItem($this->node_id, $link, "prtt");
     }
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd("view");
     switch ($next_class) {
         case 'ilportfoliotemplatepagegui':
             $this->determinePageCall();
             // has to be done before locator!
             $this->prepareOutput();
             $this->handlePageCall($cmd);
             break;
         case "ilnotegui":
             $this->preview();
             break;
         case "ilinfoscreengui":
             $this->prepareOutput();
             $this->infoScreenForward();
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case "ilpermissiongui":
             $this->prepareOutput();
             $this->tabs_gui->activateTab("id_permissions");
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui = new ilPermissionGUI($this);
             $this->ctrl->forwardCommand($perm_gui);
             break;
         case "ilobjectcopygui":
             include_once "./Services/Object/classes/class.ilObjectCopyGUI.php";
             $cp = new ilObjectCopyGUI($this);
             $cp->setType("prtt");
             $this->ctrl->forwardCommand($cmd);
             break;
         case 'ilexportgui':
             $this->prepareOutput();
             $this->tabs_gui->activateTab("export");
             include_once "./Services/Export/classes/class.ilExportGUI.php";
             $exp_gui = new ilExportGUI($this);
             $exp_gui->addFormat("xml");
             $this->ctrl->forwardCommand($exp_gui);
             break;
         case "ilobjstylesheetgui":
             include_once "./Services/Style/classes/class.ilObjStyleSheetGUI.php";
             $this->ctrl->setReturn($this, "editStyleProperties");
             $style_gui = new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
             $style_gui->omitLocator();
             if ($cmd == "create" || $_GET["new_type"] == "sty") {
                 $style_gui->setCreationMode(true);
             }
             if ($cmd == "confirmedDelete") {
                 $this->object->setStyleSheetId(0);
                 $this->object->update();
             }
             $ret = $this->ctrl->forwardCommand($style_gui);
             if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle") {
                 $style_id = $ret;
                 $this->object->setStyleSheetId($style_id);
                 $this->object->update();
                 $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
             }
             break;
         default:
             $this->addHeaderAction($cmd);
             return ilObject2GUI::executeCommand();
     }
 }
 /**
  * execute command
  */
 function &executeCommand()
 {
     global $ilCtrl, $tpl, $ilAccess, $lng, $ilNavigationHistory, $ilTabs;
     // get standard template (includes main menu and general layout)
     $tpl->getStandardTemplate();
     // set title
     if (!$this->getCreationMode()) {
         $tpl->setTitle($this->object->getTitle());
         $tpl->setTitleIcon(ilObject::_getIcon($this->object->getId()));
         // set tabs
         if (strtolower($_GET["baseClass"]) != "iladministrationgui") {
             $this->setTabs();
             $this->setLocator();
         } else {
             $this->addAdminLocatorItems();
             $tpl->setLocator();
             $this->setAdminTabs();
         }
         // add entry to navigation history
         if ($ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
             $ilNavigationHistory->addItem($_GET["ref_id"], $ilCtrl->getLinkTarget($this, $this->getStandardCmd()), $this->getType());
         }
     } else {
         // show info of parent
         $tpl->setTitle(ilObject::_lookupTitle(ilObject::_lookupObjId($_GET["ref_id"])));
         $tpl->setTitleIcon(ilObject::_getIcon(ilObject::_lookupObjId($_GET["ref_id"]), "big"), $lng->txt("obj_" . ilObject::_lookupType($_GET["ref_id"], true)));
         $this->setLocator();
     }
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     switch ($next_class) {
         case "ilinfoscreengui":
             $this->checkPermission("visible");
             $this->infoScreen();
             // forwards command
             break;
         case 'ilpermissiongui':
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui = new ilPermissionGUI($this);
             $ilTabs->setTabActive("perm_settings");
             $ret = $ilCtrl->forwardCommand($perm_gui);
             break;
         case 'ilobjectcopygui':
             include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
             $cp = new ilObjectCopyGUI($this);
             $cp->setType($this->getType());
             $this->ctrl->forwardCommand($cp);
             break;
         case 'illearningprogressgui':
             $ilTabs->setTabActive("learning_progress");
             include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
             $new_gui = new ilLearningProgressGUI(ilLearningProgressGUI::LP_CONTEXT_REPOSITORY, $this->object->getRefId(), $_GET['user_id'] ? $_GET['user_id'] : $GLOBALS['ilUser']->getId());
             $this->ctrl->forwardCommand($new_gui);
             break;
         case 'ilcommonactiondispatchergui':
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         default:
             if (strtolower($_GET["baseClass"]) == "iladministrationgui") {
                 $this->viewObject();
                 return;
             }
             if (!$cmd) {
                 $cmd = $this->getStandardCmd();
             }
             if ($cmd == "infoScreen") {
                 $ilCtrl->setCmd("showSummary");
                 $ilCtrl->setCmdClass("ilinfoscreengui");
                 $this->infoScreen();
             } else {
                 if ($this->getCreationMode()) {
                     $this->{$cmd}();
                 } else {
                     $this->performCommand($cmd);
                 }
             }
             break;
     }
     if (!$this->getCreationMode()) {
         $tpl->show();
     }
 }
 /**
  * execute command
  *
  * @global ilLocatorGUI $ilLocator
  * @global ilAccessHandler $ilAccess
  * @global ilNavigationHistory $ilNavigationHistory
  * @global ilTemplate $tpl
  * @global ilCtrl $ilCtrl
  * @global ilTabsGUI $ilTabs
  * @global ilLanguage $lng
  * @global ILIAS $ilias 
  */
 function executeCommand()
 {
     global $ilUser, $ilLocator, $ilAccess, $ilNavigationHistory, $tpl, $ilCtrl, $ilErr, $ilTabs, $lng, $ilDB, $ilPluginAdmin;
     if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"]) && !$ilAccess->checkAccess("visible", "", $_GET["ref_id"])) {
         global $ilias;
         $ilias->raiseError($this->lng->txt("permission_denied"), $ilias->error_obj->MESSAGE);
     }
     // add entry to navigation history
     if (!$this->getCreationMode() && $ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
         if ('qpl' == $this->object->getType()) {
             $ilNavigationHistory->addItem($_GET["ref_id"], "ilias.php?baseClass=ilObjQuestionPoolGUI&cmd=questions&ref_id=" . $_GET["ref_id"], "qpl");
         }
     }
     $cmd = $this->ctrl->getCmd("questions");
     $next_class = $this->ctrl->getNextClass($this);
     if (in_array($next_class, array('', 'ilobjquestionpoolgui')) && $cmd == 'questions') {
         $_GET['q_id'] = '';
     }
     $this->prepareOutput();
     $this->ctrl->setReturn($this, "questions");
     $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
     $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "ta.css", "Modules/Test"), "screen");
     if ($_GET["q_id"] < 1) {
         $q_type = $_POST["sel_question_types"] != "" ? $_POST["sel_question_types"] : $_GET["sel_question_types"];
     }
     if ($cmd != "createQuestion" && $cmd != "createQuestionForTest" && $next_class != "ilassquestionpagegui") {
         if ($_GET["test_ref_id"] != "" or $_GET["calling_test"]) {
             $ref_id = $_GET["test_ref_id"];
             if (!$ref_id) {
                 $ref_id = $_GET["calling_test"];
             }
         }
     }
     switch ($next_class) {
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case 'ilmdeditorgui':
             if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
                 $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
             }
             include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';
             $md_gui = new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType());
             $md_gui->addObserver($this->object, 'MDUpdateListener', 'General');
             $this->ctrl->forwardCommand($md_gui);
             break;
         case 'ilassquestionpreviewgui':
             $this->ctrl->saveParameter($this, "q_id");
             require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewGUI.php';
             $gui = new ilAssQuestionPreviewGUI($this->ctrl, $this->tabs_gui, $this->tpl, $this->lng, $ilDB);
             $gui->initQuestion((int) $_GET['q_id'], $this->object->getId());
             $gui->initPreviewSettings($this->object->getRefId());
             $gui->initPreviewSession($ilUser->getId(), (int) $_GET['q_id']);
             $gui->initHintTracking();
             $gui->initStyleSheets();
             global $ilHelp;
             $ilHelp->setScreenIdComponent("qpl");
             $this->ctrl->forwardCommand($gui);
             break;
         case "ilassquestionpagegui":
             include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
             $this->tpl->setCurrentBlock("ContentStyle");
             $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
             $this->tpl->parseCurrentBlock();
             // syntax style
             $this->tpl->setCurrentBlock("SyntaxStyle");
             $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
             $this->tpl->parseCurrentBlock();
             include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
             $q_gui = assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
             $q_gui->setQuestionTabs();
             $q_gui->outAdditionalOutput();
             $q_gui->object->setObjId($this->object->getId());
             $q_gui->setTargetGuiClass(null);
             $q_gui->setQuestionActionCmd(null);
             $question = $q_gui->object;
             $this->ctrl->saveParameter($this, "q_id");
             include_once "./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php";
             $this->lng->loadLanguageModule("content");
             $this->ctrl->setReturnByClass("ilAssQuestionPageGUI", "view");
             $this->ctrl->setReturn($this, "questions");
             $page_gui = new ilAssQuestionPageGUI($_GET["q_id"]);
             $page_gui->setEditPreview(true);
             $page_gui->setEnabledTabs(false);
             if (strlen($this->ctrl->getCmd()) == 0 && !isset($_POST["editImagemapForward_x"])) {
                 $this->ctrl->setCmdClass(get_class($page_gui));
                 $this->ctrl->setCmd("preview");
             }
             $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(TRUE)));
             $page_gui->setTemplateTargetVar("ADM_CONTENT");
             $page_gui->setOutputMode("edit");
             $page_gui->setHeader($question->getTitle());
             $page_gui->setPresentationTitle($question->getTitle());
             $ret = $this->ctrl->forwardCommand($page_gui);
             $tpl->setContent($ret);
             break;
         case 'ilpermissiongui':
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui = new ilPermissionGUI($this);
             $ret = $this->ctrl->forwardCommand($perm_gui);
             break;
         case 'ilobjectcopygui':
             include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
             $cp = new ilObjectCopyGUI($this);
             $cp->setType('qpl');
             $this->ctrl->forwardCommand($cp);
             break;
         case "ilquestionpoolexportgui":
             require_once 'Modules/TestQuestionPool/classes/class.ilQuestionPoolExportGUI.php';
             $exp_gui = new ilQuestionPoolExportGUI($this);
             $exp_gui->addFormat('zip', $this->lng->txt('qpl_export_xml'), $this, 'createExportQTI');
             $exp_gui->addFormat('xls', $this->lng->txt('qpl_export_excel'), $this, 'createExportExcel');
             $ret = $this->ctrl->forwardCommand($exp_gui);
             break;
         case "ilinfoscreengui":
             $this->infoScreenForward();
             break;
         case 'ilassquestionhintsgui':
             // set return target
             $this->ctrl->setReturn($this, "questions");
             // set context tabs
             require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
             $questionGUI = assQuestionGUI::_getQuestionGUI($q_type, $_GET['q_id']);
             $questionGUI->object->setObjId($this->object->getId());
             $questionGUI->setQuestionTabs();
             global $ilHelp;
             $ilHelp->setScreenIdComponent("qpl");
             // forward to ilAssQuestionHintsGUI
             require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsGUI.php';
             $gui = new ilAssQuestionHintsGUI($questionGUI);
             $ilCtrl->forwardCommand($gui);
             break;
         case 'illocalunitconfigurationgui':
             if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
                 $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
             }
             require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
             $questionGUI = assQuestionGUI::_getQuestionGUI($q_type, $_GET['q_id']);
             $questionGUI->object->setObjId($this->object->getId());
             $questionGUI->setQuestionTabs();
             $this->ctrl->setReturn($this, 'questions');
             require_once 'Modules/TestQuestionPool/classes/class.ilLocalUnitConfigurationGUI.php';
             require_once 'Modules/TestQuestionPool/classes/class.ilUnitConfigurationRepository.php';
             $gui = new ilLocalUnitConfigurationGUI(new ilUnitConfigurationRepository((int) $_GET['q_id']));
             $ilCtrl->forwardCommand($gui);
             break;
         case 'ilassquestionfeedbackeditinggui':
             // set return target
             $this->ctrl->setReturn($this, "questions");
             // set context tabs
             require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
             $questionGUI = assQuestionGUI::_getQuestionGUI($q_type, $_GET['q_id']);
             $questionGUI->object->setObjId($this->object->getId());
             $questionGUI->setQuestionTabs();
             global $ilHelp;
             $ilHelp->setScreenIdComponent("qpl");
             // forward to ilAssQuestionFeedbackGUI
             require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php';
             $gui = new ilAssQuestionFeedbackEditingGUI($questionGUI, $ilCtrl, $ilAccess, $tpl, $ilTabs, $lng);
             $ilCtrl->forwardCommand($gui);
             break;
         case 'ilobjquestionpoolsettingsgeneralgui':
             require_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPoolSettingsGeneralGUI.php';
             $gui = new ilObjQuestionPoolSettingsGeneralGUI($ilCtrl, $ilAccess, $lng, $tpl, $ilTabs, $this);
             $this->ctrl->forwardCommand($gui);
             break;
         case "ilobjtaxonomygui":
             require_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPoolTaxonomyEditingCommandForwarder.php';
             $forwarder = new ilObjQuestionPoolTaxonomyEditingCommandForwarder($this->object, $ilDB, $ilPluginAdmin, $ilCtrl, $ilTabs, $lng);
             $forwarder->forward();
             break;
         case 'ilquestionbrowsertablegui':
             $this->ctrl->forwardCommand($this->buildQuestionBrowserTableGUI($taxIds = array()));
             // no tax ids required
             break;
         case "ilobjquestionpoolgui":
         case "":
             if ($cmd == 'questions') {
                 $this->ctrl->setParameter($this, 'q_id', '');
             }
             $cmd .= "Object";
             $ret = $this->{$cmd}();
             break;
         default:
             $this->ctrl->setReturn($this, "questions");
             include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
             $q_gui = assQuestionGUI::_getQuestionGUI($q_type, $_GET["q_id"]);
             $q_gui->object->setObjId($this->object->getId());
             if ($this->object->getType() == 'qpl') {
                 $q_gui->setTaxonomyIds($this->object->getTaxonomyIds());
                 $this->object->addQuestionChangeListeners($q_gui->object);
             }
             $q_gui->setQuestionTabs();
             global $ilHelp;
             $ilHelp->setScreenIdComponent("qpl");
             $ret = $this->ctrl->forwardCommand($q_gui);
             break;
     }
     if (!(strtolower($_GET["baseClass"]) == "iladministrationgui" || strtolower($_GET['baseClass']) == 'ilrepositorygui') && $this->getCreationMode() != true) {
         $this->tpl->show();
     }
 }
 function &executeCommand()
 {
     global $rbacsystem, $ilNavigationHistory, $ilAccess, $ilCtrl, $ilTabs;
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     switch ($next_class) {
         case "ilobjusergui":
             include_once './Services/User/classes/class.ilObjUserGUI.php';
             $this->tabs_gui->setTabActive('administrate_users');
             if (!$_GET['obj_id']) {
                 $this->gui_obj = new ilObjUserGUI("", $_GET['ref_id'], true, false);
                 $this->gui_obj->setCreationMode($this->creation_mode);
                 $ret =& $this->ctrl->forwardCommand($this->gui_obj);
             } else {
                 $this->gui_obj = new ilObjUserGUI("", $_GET['obj_id'], false, false);
                 $this->gui_obj->setCreationMode($this->creation_mode);
                 $ret =& $this->ctrl->forwardCommand($this->gui_obj);
             }
             $ilTabs->clearTargets();
             $ilTabs->setBackTarget($this->lng->txt('backto_lua'), $this->ctrl->getLinkTarget($this, 'listUsers'));
             break;
         case "ilobjuserfoldergui":
             include_once './Services/User/classes/class.ilObjUserFolderGUI.php';
             $this->tabs_gui->setTabActive('administrate_users');
             $this->gui_obj = new ilObjUserFolderGUI("", (int) $_GET['ref_id'], true, false);
             $this->gui_obj->setUserOwnerId((int) $_GET['ref_id']);
             $this->gui_obj->setCreationMode($this->creation_mode);
             $ret =& $this->ctrl->forwardCommand($this->gui_obj);
             break;
         case "ilcolumngui":
             $this->checkPermission("read");
             $this->prepareOutput();
             include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
             $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId()));
             $this->renderObject();
             break;
         case 'ilpermissiongui':
             $this->prepareOutput();
             $this->tabs_gui->setTabActive('perm_settings');
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui =& new ilPermissionGUI($this);
             $ret =& $this->ctrl->forwardCommand($perm_gui);
             break;
         case 'ilinfoscreengui':
             $this->prepareOutput();
             $this->infoScreen();
             break;
         case 'ilcontainerlinklistgui':
             include_once "Services/Container/classes/class.ilContainerLinkListGUI.php";
             $link_list_gui =& new ilContainerLinkListGUI();
             $ret =& $this->ctrl->forwardCommand($link_list_gui);
             break;
             // container page editing
         // container page editing
         case "ilpageobjectgui":
             $this->prepareOutput(false);
             $ret = $this->forwardToPageObject();
             if ($ret != "") {
                 $this->tpl->setContent($ret);
             }
             break;
         case 'ilobjectcopygui':
             $this->prepareOutput();
             include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
             $cp = new ilObjectCopyGUI($this);
             $cp->setType('cat');
             $this->ctrl->forwardCommand($cp);
             break;
         case "ilobjstylesheetgui":
             $this->forwardToStyleSheet();
             break;
         case 'ilusertablegui':
             include_once './Services/User/classes/class.ilUserTableGUI.php';
             $u_table = new ilUserTableGUI($this, "listUsers");
             $u_table->initFilter();
             $this->ctrl->setReturn($this, 'listUsers');
             $this->ctrl->forwardCommand($u_table);
             break;
         case "ilcommonactiondispatchergui":
             $this->prepareOutput();
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case 'ildidactictemplategui':
             $this->ctrl->setReturn($this, 'edit');
             include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateGUI.php';
             $did = new ilDidacticTemplateGUI($this);
             $this->ctrl->forwardCommand($did);
             break;
         case 'ilexportgui':
             $this->prepareOutput();
             $this->tabs_gui->setTabActive('export');
             include_once './Services/Export/classes/class.ilExportGUI.php';
             $exp = new ilExportGUI($this);
             $exp->addFormat('xml');
             $this->ctrl->forwardCommand($exp);
             break;
         default:
             if ($cmd == "infoScreen") {
                 $this->checkPermission("visible");
             } else {
                 $this->checkPermission("read");
             }
             // add entry to navigation history
             if (!$this->getCreationMode() && $ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
                 $ilNavigationHistory->addItem($_GET["ref_id"], $ilCtrl->getLinkTargetByClass("ilrepositorygui", "frameset"), "cat");
             }
             $this->prepareOutput();
             include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
             if (is_object($this->object)) {
                 $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId()));
             }
             if (!$cmd) {
                 $cmd = "render";
             }
             $cmd .= "Object";
             $this->{$cmd}();
             break;
     }
     $this->addHeaderAction();
     return true;
 }
Beispiel #23
0
 public function executeCommand()
 {
     /**
      * @var $ilNavigationHistory ilNavigationHistory
      * @var $ilAccess ilAccessHandler
      * @var $ilCtrl ilCtrl
      * @var $ilTabs ilTabsGUI
      * @var $ilErr  ilErrorHandling
      * @var $ilUser ilObjUser
      */
     global $ilNavigationHistory, $ilAccess, $ilCtrl, $ilTabs, $ilErr, $ilUser;
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     $exclude_cmds = array('viewThread', 'markPostUnread', 'markPostRead', 'showThreadNotification', 'cancelPostActivation', 'cancelPostDeactivation', 'performPostActivation', 'performPostDeactivation', 'performPostAndChildPostsActivation', 'askForPostActivation', 'askForPostDeactivation', 'toggleThreadNotification', 'toggleThreadNotificationTab', 'toggleStickiness', 'cancelPost', 'savePost', 'quotePost', 'getQuotationHTMLAsynch', 'setTreeStateAsynch', 'fetchTreeChildrenAsync');
     if (!in_array($cmd, $exclude_cmds)) {
         $this->prepareOutput();
     }
     // add entry to navigation history
     if (!$this->getCreationMode() && !$ilCtrl->isAsynch() && $ilAccess->checkAccess('read', '', $_GET['ref_id'])) {
         $ilNavigationHistory->addItem($_GET['ref_id'], 'ilias.php?baseClass=ilRepositoryGUI&amp;cmd=showThreads&amp;ref_id=' . $_GET['ref_id'], 'frm');
     }
     switch ($next_class) {
         case 'ilpermissiongui':
             require_once 'Services/AccessControl/classes/class.ilPermissionGUI.php';
             $perm_gui = new ilPermissionGUI($this);
             $this->ctrl->forwardCommand($perm_gui);
             break;
         case 'ilforumexportgui':
             require_once 'Modules/Forum/classes/class.ilForumExportGUI.php';
             $fex_gui = new ilForumExportGUI($this);
             $this->ctrl->forwardCommand($fex_gui);
             exit;
             break;
         case 'ilforummoderatorsgui':
             require_once 'Modules/Forum/classes/class.ilForumModeratorsGUI.php';
             $fm_gui = new ilForumModeratorsGUI($this);
             $this->ctrl->forwardCommand($fm_gui);
             break;
         case 'ilinfoscreengui':
             $this->infoScreen();
             break;
         case 'ilcolumngui':
             $this->showThreadsObject();
             break;
         case 'ilpublicuserprofilegui':
             include_once 'Services/User/classes/class.ilPublicUserProfileGUI.php';
             $profile_gui = new ilPublicUserProfileGUI((int) $_GET['user']);
             $add = $this->getUserProfileAdditional((int) $_GET['ref_id'], (int) $_GET['user']);
             $profile_gui->setAdditional($add);
             $ret = $this->ctrl->forwardCommand($profile_gui);
             $this->tpl->setContent($ret);
             break;
         case 'ilobjectcopygui':
             include_once 'Services/Object/classes/class.ilObjectCopyGUI.php';
             $cp = new ilObjectCopyGUI($this);
             $cp->setType('frm');
             $this->ctrl->forwardCommand($cp);
             break;
         case 'ilexportgui':
             $ilTabs->setTabActive('export');
             include_once 'Services/Export/classes/class.ilExportGUI.php';
             $exp = new ilExportGUI($this);
             $exp->addFormat('xml');
             $this->ctrl->forwardCommand($exp);
             break;
         case "ilratinggui":
             if (!$this->objProperties->isIsThreadRatingEnabled() || $ilUser->isAnonymous()) {
                 $ilErr->raiseError($this->lng->txt('msg_no_perm_read'), $ilErr->MESSAGE);
             }
             require_once 'Services/Rating/classes/class.ilRatingGUI.php';
             $rating_gui = new ilRatingGUI();
             $rating_gui->setObject($this->object->getId(), $this->object->getType(), $this->objCurrentTopic->getId(), 'thread');
             $ilCtrl->setParameter($this, 'thr_pk', (int) $_GET['thr_pk']);
             $this->ctrl->forwardCommand($rating_gui);
             $avg = ilRating::getOverallRatingForObject($this->object->getId(), $this->object->getType(), (int) $_GET['thr_pk'], 'thread');
             $this->objCurrentTopic->setAverageRating($avg['avg']);
             $this->objCurrentTopic->update();
             $ilCtrl->redirect($this, "showThreads");
             break;
         case 'ilcommonactiondispatchergui':
             include_once 'Services/Object/classes/class.ilCommonActionDispatcherGUI.php';
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         default:
             // alex, 11 Jan 2011:
             // I inserted this workaround due to bug report 6971.
             // In general the command handling is quite obscure here.
             // The form action of the table should be filled
             // with $ilCtrl->getFormAction(..) not with $ilCtrl->getLinkTarget(..)
             // Commands should be determined with $ilCtrl->getCmd() not
             // with accessing $_POST['selected_cmd'], since this is internal
             // of ilTable2GUI/ilCtrl and may change.
             if (isset($_POST['select_cmd2'])) {
                 $_POST['selected_cmd'] = $_POST["selected_cmd2"];
             }
             if (isset($_POST['selected_cmd']) && $_POST['selected_cmd'] != null) {
                 $member_cmd = array('enableAdminForceNoti', 'disableAdminForceNoti', 'enableHideUserToggleNoti', 'disableHideUserToggleNoti');
                 in_array($_POST['selected_cmd'], $member_cmd) ? $cmd = $_POST['selected_cmd'] : ($cmd = 'performThreadsAction');
             } else {
                 if (!$cmd && !$_POST['selected_cmd']) {
                     $cmd = 'showThreads';
                 }
             }
             $cmd .= 'Object';
             $this->{$cmd}();
             break;
     }
     // suppress for topic level
     if ($cmd != 'viewThreadObject' && $cmd != 'showUserObject') {
         $this->addHeaderAction();
     }
 }
 /**
  * executeCommand
  */
 public function executeCommand()
 {
     global $ilCtrl, $ilTabs, $ilNavigationHistory, $tpl, $lng;
     // Navigation History
     $link = $ilCtrl->getLinkTarget($this, $this->getStandardCmd());
     if ($this->object != NULL) {
         $ilNavigationHistory->addItem($this->object->getRefId(), $link, "bibl");
     }
     $next_class = $ilCtrl->getNextClass($this);
     $this->cmd = $ilCtrl->getCmd();
     switch ($next_class) {
         case "ilinfoscreengui":
             $this->prepareOutput();
             $ilTabs->activateTab("id_info");
             $this->infoScreenForward();
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case "ilpermissiongui":
             $this->prepareOutput();
             $ilTabs->activateTab("id_permissions");
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui = new ilPermissionGUI($this);
             $this->ctrl->forwardCommand($perm_gui);
             break;
         case "ilobjectcopygui":
             include_once "./Services/Object/classes/class.ilObjectCopyGUI.php";
             $cp = new ilObjectCopyGUI($this);
             $cp->setType('bibl');
             $tpl->getStandardTemplate();
             $this->ctrl->forwardCommand($cp);
             break;
         case "ilobjfilegui":
             $this->prepareOutput();
             $ilTabs->setTabActive("id_records");
             include_once "./Modules/File/classes/class.ilObjFile.php";
             $file_gui = new ilObjFile($this);
             $this->ctrl->forwardCommand($file_gui);
             break;
         case "ilexportgui":
             $this->prepareOutput();
             $ilTabs->setTabActive("export");
             $exp_gui = new ilExportGUI($this);
             $exp_gui->addFormat("xml");
             $this->ctrl->forwardCommand($exp_gui);
             break;
         default:
             return parent::executeCommand();
     }
     return true;
 }
 function executeCommand()
 {
     global $ilCtrl, $tpl, $ilTabs, $lng, $ilNavigationHistory;
     // goto link to blog posting
     if ($_GET["gtp"]) {
         $ilCtrl->setCmdClass("ilblogpostinggui");
         $_GET["blpg"] = $_GET["gtp"];
         $ilCtrl->setCmd("previewFullscreen");
     }
     $next_class = $ilCtrl->getNextClass($this);
     $cmd = $ilCtrl->getCmd();
     if ($this->id_type == self::REPOSITORY_NODE_ID) {
         $tpl->getStandardTemplate();
         // add entry to navigation history
         if (!$this->getCreationMode() && $this->getAccessHandler()->checkAccess("read", "", $this->node_id)) {
             $link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "frameset");
             $ilNavigationHistory->addItem($this->node_id, $link, "blog");
         }
     }
     switch ($next_class) {
         case 'ilblogpostinggui':
             // #9680
             if ($this->id_type == self::REPOSITORY_NODE_ID) {
                 $this->setLocator();
             } else {
                 include_once "Services/Form/classes/class.ilFileInputGUI.php";
                 ilFileInputGUI::setPersonalWorkspaceQuotaCheck(true);
             }
             $ilTabs->setBackTarget($lng->txt("back"), $ilCtrl->getLinkTarget($this, ""));
             include_once "./Modules/Blog/classes/class.ilBlogPostingGUI.php";
             $bpost_gui = new ilBlogPostingGUI($this->node_id, $this->getAccessHandler(), $_GET["blpg"], $_GET["old_nr"], $this->object->getNotesStatus() && !$this->disable_notes, $this->mayContribute($_GET["blpg"]));
             // needed for editor
             $bpost_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId($this->object->getStyleSheetId(), "blog"));
             // keep preview mode through notes gui (has its own commands)
             switch ($cmd) {
                 // blog preview
                 case "previewFullscreen":
                     $ilCtrl->setParameter($this, "prvm", "fsc");
                     break;
                     // blog in portfolio
                 // blog in portfolio
                 case "previewEmbedded":
                     $ilCtrl->setParameter($this, "prvm", "emb");
                     break;
                     // edit
                 // edit
                 default:
                     $this->setContentStyleSheet();
                     $this->ctrl->setParameterByClass("ilblogpostinggui", "blpg", $_GET["blpg"]);
                     $this->tabs_gui->addNonTabbedLink("preview", $lng->txt("blog_preview"), $this->ctrl->getLinkTargetByClass("ilblogpostinggui", "previewFullscreen"));
                     $this->ctrl->setParameterByClass("ilblogpostinggui", "blpg", "");
                     break;
             }
             $ret = $ilCtrl->forwardCommand($bpost_gui);
             if ($ret != "") {
                 // keep preview mode through notes gui
                 if ($_REQUEST["prvm"]) {
                     $cmd = "preview" . ($_REQUEST["prvm"] == "fsc" ? "Fullscreen" : "Embedded");
                 }
                 // $is_owner = $this->object->getOwner() == $ilUser->getId();
                 $is_owner = $this->mayContribute();
                 $is_active = $bpost_gui->getBlogPosting()->getActive();
                 // do not show inactive postings
                 if (($cmd == "previewFullscreen" || $cmd == "previewEmbedded") && !$is_owner && !$is_active) {
                     $this->ctrl->redirect($this, "preview");
                 }
                 switch ($cmd) {
                     // blog preview
                     case "previewFullscreen":
                         $this->addHeaderAction($cmd);
                         $this->filterInactivePostings();
                         $nav = $this->renderNavigation($this->items, "preview", $cmd);
                         $this->renderFullScreen($ret, $nav);
                         break;
                         // blog in portfolio
                     // blog in portfolio
                     case "previewEmbedded":
                         $this->filterInactivePostings();
                         $nav = $this->renderNavigation($this->items, "gethtml", $cmd);
                         return $this->buildEmbedded($ret, $nav);
                         // ilias/editor
                     // ilias/editor
                     default:
                         // infos about draft status / snippet
                         $info = array();
                         if (!$is_active) {
                             // single author blog (owner) in personal workspace
                             if ($this->id_type == self::WORKSPACE_NODE_ID) {
                                 $info[] = $lng->txt("blog_draft_info");
                             } else {
                                 $info[] = $lng->txt("blog_draft_info_contributors");
                             }
                         }
                         if ($cmd != "history" && !$bpost_gui->getBlogPosting()->getFirstParagraphText()) {
                             $info[] = $lng->txt("blog_new_posting_info");
                         }
                         if ($this->object->hasApproval() && !$bpost_gui->getBlogPosting()->isApproved()) {
                             // #9737
                             $info[] = $lng->txt("blog_posting_edit_approval_info");
                         }
                         if (sizeof($info)) {
                             ilUtil::sendInfo(implode("<br />", $info));
                         }
                         // revert to edit cmd to avoid confusion
                         $this->addHeaderAction("render");
                         $tpl->setContent($ret);
                         $nav = $this->renderNavigation($this->items, "render", $cmd, null, $is_owner);
                         $tpl->setRightContent($nav);
                         break;
                 }
             }
             break;
         case "ilinfoscreengui":
             $this->prepareOutput();
             $this->infoScreenForward();
             break;
         case "ilnotegui":
             $this->preview();
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case "ilpermissiongui":
             $this->prepareOutput();
             $ilTabs->activateTab("id_permissions");
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui = new ilPermissionGUI($this);
             $this->ctrl->forwardCommand($perm_gui);
             break;
         case "ilobjectcopygui":
             include_once "./Services/Object/classes/class.ilObjectCopyGUI.php";
             $cp = new ilObjectCopyGUI($this);
             $cp->setType("blog");
             $this->ctrl->forwardCommand($cp);
             break;
         case 'ilrepositorysearchgui':
             $this->prepareOutput();
             $ilTabs->activateTab("contributors");
             include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
             $rep_search = new ilRepositorySearchGUI();
             $rep_search->setTitle($this->lng->txt("blog_add_contributor"));
             $rep_search->setCallback($this, 'addContributor');
             $this->ctrl->setReturn($this, 'contributors');
             $ret =& $this->ctrl->forwardCommand($rep_search);
             break;
         case 'ilexportgui':
             $this->prepareOutput();
             $ilTabs->activateTab("export");
             include_once "./Services/Export/classes/class.ilExportGUI.php";
             $exp_gui = new ilExportGUI($this);
             $exp_gui->addFormat("xml");
             $ret = $ilCtrl->forwardCommand($exp_gui);
             break;
         case "ilobjstylesheetgui":
             include_once "./Services/Style/classes/class.ilObjStyleSheetGUI.php";
             $this->ctrl->setReturn($this, "editStyleProperties");
             $style_gui = new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
             $style_gui->omitLocator();
             if ($cmd == "create" || $_GET["new_type"] == "sty") {
                 $style_gui->setCreationMode(true);
             }
             if ($cmd == "confirmedDelete") {
                 $this->object->setStyleSheetId(0);
                 $this->object->update();
             }
             $ret = $this->ctrl->forwardCommand($style_gui);
             if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle") {
                 $style_id = $ret;
                 $this->object->setStyleSheetId($style_id);
                 $this->object->update();
                 $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
             }
             break;
         default:
             if ($cmd != "gethtml") {
                 // desktop item handling, must be toggled before header action
                 if ($cmd == "addToDesk" || $cmd == "removeFromDesk") {
                     $this->{$cmd . "Object"}();
                     if ($_GET["prvm"]) {
                         $cmd = "preview";
                     } else {
                         $cmd = "render";
                     }
                     $ilCtrl->setCmd($cmd);
                 }
                 $this->addHeaderAction($cmd);
             }
             return parent::executeCommand();
     }
     return true;
 }
 public function executeCommand()
 {
     global $ilCtrl, $ilTabs, $ilErr, $ilAccess;
     //if($this->ctrl->getTargetScript() == 'link_resources.php')
     if ($_GET["baseClass"] == 'ilLinkResourceHandlerGUI') {
         $_GET['view_mode'] = isset($_GET['switch_mode']) ? $_GET['switch_mode'] : $_GET['view_mode'];
         $ilCtrl->saveParameter($this, 'view_mode');
         $this->__prepareOutput();
     }
     $this->lng->loadLanguageModule("webr");
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     switch ($next_class) {
         case "ilinfoscreengui":
             $this->infoScreenForward();
             // forwards command
             break;
         case 'ilmdeditorgui':
             if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
                 $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
             }
             $this->prepareOutput();
             $ilTabs->activateTab('id_meta_data');
             include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';
             $md_gui =& new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType());
             $md_gui->addObserver($this->object, 'MDUpdateListener', 'General');
             $this->ctrl->forwardCommand($md_gui);
             break;
         case 'ilpermissiongui':
             $this->prepareOutput();
             $ilTabs->activateTab('id_permissions');
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui =& new ilPermissionGUI($this);
             $ret =& $this->ctrl->forwardCommand($perm_gui);
             break;
         case 'ilobjectcopygui':
             $this->prepareOutput();
             include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
             $cp = new ilObjectCopyGUI($this);
             $cp->setType('webr');
             $this->ctrl->forwardCommand($cp);
             break;
         case 'ilexportgui':
             $this->prepareOutput();
             $this->tabs_gui->setTabActive('export');
             include_once './Services/Export/classes/class.ilExportGUI.php';
             $exp = new ilExportGUI($this);
             $exp->addFormat('xml');
             $this->ctrl->forwardCommand($exp);
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case "ilpropertyformgui":
             include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
             $this->initFormLink(self::LINK_MOD_EDIT);
             $this->ctrl->forwardCommand($this->form);
             break;
         case "ilinternallinkgui":
             $this->lng->loadLanguageModule("content");
             require_once "./Modules/LearningModule/classes/class.ilInternalLinkGUI.php";
             $link_gui = new ilInternalLinkGUI("RepositoryItem", 0);
             $link_gui->filterLinkType("PageObject");
             $link_gui->filterLinkType("GlossaryItem");
             $link_gui->filterLinkType("RepositoryItem");
             $link_gui->setFilterWhiteList(true);
             $link_gui->setMode("asynch");
             $ilCtrl->forwardCommand($link_gui);
             break;
         default:
             if (!$cmd) {
                 $this->ctrl->setCmd("view");
             }
             parent::executeCommand();
     }
     if (!$this->getCreationMode()) {
         // Fill meta header tags
         include_once 'Services/MetaData/classes/class.ilMDUtils.php';
         ilMDUtils::_fillHTMLMetaTags($this->object->getId(), $this->object->getId(), 'webr');
         $this->addHeaderAction();
     }
     return true;
 }
Beispiel #27
0
 /**
  * Fill object clone template
  * This method can be called from any object GUI class that wants to offer object cloning. 
  *
  * @access public
  * @param string template variable name that will be filled
  * @param string type of new object
  * 
  */
 protected function fillCloneTemplate($a_tpl_varname, $a_type)
 {
     include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
     $cp = new ilObjectCopyGUI($this);
     $cp->setType($a_type);
     $cp->setTarget($_GET['ref_id']);
     if ($a_tpl_varname) {
         $cp->showSourceSearch($a_tpl_varname);
     } else {
         return $cp->showSourceSearch(null);
     }
 }
Beispiel #28
0
 function executeCommand()
 {
     global $ilNavigationHistory, $ilCtrl, $ilUser, $ilTabs, $ilAccess, $ilErr;
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     if ($this->id_type == self::WORKSPACE_NODE_ID) {
         include_once "Services/Form/classes/class.ilFileInputGUI.php";
         ilFileInputGUI::setPersonalWorkspaceQuotaCheck(true);
     }
     if (!$this->getCreationMode()) {
         // do not move this payment block!!
         if (IS_PAYMENT_ENABLED) {
             include_once './Services/Payment/classes/class.ilPaymentObject.php';
             if (ANONYMOUS_USER_ID == $ilUser->getId() && isset($_GET['transaction'])) {
                 $transaction = $_GET['transaction'];
                 include_once './Services/Payment/classes/class.ilPaymentBookings.php';
                 $valid_transaction = ilPaymentBookings::_readBookingByTransaction($transaction);
             }
             if (ilPaymentObject::_requiresPurchaseToAccess($this->node_id, $type = isset($_GET['purchasetype']) ? $_GET['purchasetype'] : NULL)) {
                 $this->setLocator();
                 $this->tpl->getStandardTemplate();
                 include_once './Services/Payment/classes/class.ilShopPurchaseGUI.php';
                 $pp = new ilShopPurchaseGUI((int) $this->node_id);
                 $ret = $this->ctrl->forwardCommand($pp);
                 return true;
             }
         } else {
             if ($this->id_type == self::REPOSITORY_NODE_ID && $this->checkPermissionBool("read")) {
                 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $this->node_id);
                 $link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "infoScreen");
                 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
                 // add entry to navigation history
                 $ilNavigationHistory->addItem($this->node_id, $link, "file");
             }
         }
     }
     $this->prepareOutput();
     switch ($next_class) {
         case "ilinfoscreengui":
             $this->infoScreenForward();
             // forwards command
             break;
         case 'ilmdeditorgui':
             if (!$this->checkPermissionBool("write")) {
                 $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
             }
             $ilTabs->activateTab("id_meta");
             include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';
             $md_gui =& new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType());
             $md_gui->addObserver($this->object, 'MDUpdateListener', 'General');
             // todo: make this work
             $md_gui->addObserver($this->object, 'MDUpdateListener', 'Technical');
             $this->ctrl->forwardCommand($md_gui);
             break;
             // repository permissions
         // repository permissions
         case 'ilpermissiongui':
             $ilTabs->activateTab("id_permissions");
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui =& new ilPermissionGUI($this);
             $ret =& $this->ctrl->forwardCommand($perm_gui);
             break;
         case "ilexportgui":
             $ilTabs->activateTab("export");
             include_once "./Services/Export/classes/class.ilExportGUI.php";
             $exp_gui = new ilExportGUI($this);
             $exp_gui->addFormat("xml");
             $ret = $this->ctrl->forwardCommand($exp_gui);
             break;
         case 'ilobjectcopygui':
             include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
             $cp = new ilObjectCopyGUI($this);
             $cp->setType('file');
             $this->ctrl->forwardCommand($cp);
             break;
             // personal workspace permissions
         // personal workspace permissions
         case "ilworkspaceaccessgui":
             $ilTabs->activateTab("id_permissions");
             include_once './Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php';
             $wspacc = new ilWorkspaceAccessGUI($this->node_id, $this->getAccessHandler());
             $this->ctrl->forwardCommand($wspacc);
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         default:
             // in personal workspace use object2gui
             if ($this->id_type == self::WORKSPACE_NODE_ID) {
                 $this->addHeaderAction();
                 // coming from goto we need default command
                 if (empty($cmd)) {
                     $ilCtrl->setCmd("infoScreen");
                 }
                 $ilTabs->clearTargets();
                 return parent::executeCommand();
             }
             if (empty($cmd)) {
                 $cmd = "infoScreen";
             }
             $this->{$cmd}();
             break;
     }
     $this->addHeaderAction();
 }
 /**
  * Handles all commmands of this class, centralizes permission checks
  *
  * @param string $cmd Given Command to Execute
  *
  * @return boolean true
  */
 function performCommand($cmd)
 {
     global $ilTabs, $ilCtrl, $tpl, $ilNavigationHistory, $cmd, $rssPermission;
     $tpl->setDescription($this->object->getLongDescription());
     $tpl->setAlertProperties($this->getAlertProperties());
     $next_class = $ilCtrl->getNextClass($this);
     $this->pl_obj = new ilRoomSharingPlugin();
     $this->pl_obj->includeClass("class.ilObjRoomSharing.php");
     // Set pool id
     $this->pool_id = $this->object->getPoolID();
     $cmd = $ilCtrl->getCmd();
     $has_calendar = false;
     if ($cmd === 'edit' || $cmd === 'editSettings' || $cmd === 'updateSettings') {
         $ilTabs->setTabActive('settings');
         // In case the edit button was clicked in the repository
         if ($cmd === 'edit') {
             $cmd = 'editSettings';
         }
         $this->{$cmd}();
         return true;
     } else {
         if ($cmd == 'showBooking' || $cmd == 'editBooking' || $cmd == 'saveEditBooking' || $cmd == 'cancelEdit') {
             $next_class = 'ilroomsharingshowandeditbookgui';
         } else {
             if ($cmd === 'showSearch' || $cmd === 'showBookSearchResults' || $cmd === "showSearchResults") {
                 $next_class = empty($next_class) ? 'ilroomsharingsearchgui' : $next_class;
             } else {
                 if ($cmd === 'addRoom' || $cmd === 'editRoom') {
                     $next_class = 'ilroomsharingroomgui';
                 } else {
                     if ($cmd == 'showBookings') {
                         $next_class = 'ilroomsharingappointmentsgui';
                     }
                 }
             }
         }
     }
     // Extend list of last visited objects by this pool.
     $ilNavigationHistory->addItem($this->ref_id, "./goto.php?target=xrs_" . $this->ref_id, "xrs");
     // Main switch for cmdClass.
     switch ($next_class) {
         // Attributes for rooms and bookings
         case ATTRC::ATTRS_GUI:
             $this->tabs_gui->setTabActive(ATTRC::ATTRS);
             $this->pl_obj->includeClass(ATTRC::ATTRS_GUI_PATH);
             $attributes_gui =& new ilRoomSharingAttributesGUI($this);
             $ret =& $this->ctrl->forwardCommand($attributes_gui);
             break;
             // Appointments
         // Appointments
         case 'ilroomsharingappointmentsgui':
             $this->tabs_gui->setTabActive('appointments');
             $this->pl_obj->includeClass("appointments/class.ilRoomSharingAppointmentsGUI.php");
             $object_gui =& new ilRoomSharingAppointmentsGUI($this);
             $ret =& $this->ctrl->forwardCommand($object_gui);
             $has_calendar = true;
             break;
             // Info
         // Info
         case 'ilinfoscreengui':
             $this->infoScreen();
             break;
             // Search
         // Search
         case 'ilroomsharingsearchgui':
             $this->tabs_gui->setTabActive('search');
             $this->pl_obj->includeClass("search/class.ilRoomSharingSearchGUI.php");
             $object_gui =& new ilRoomSharingSearchGUI($this);
             $ret =& $this->ctrl->forwardCommand($object_gui);
             break;
             // Rooms, Called for a list of rooms
         // Rooms, Called for a list of rooms
         case 'ilroomsharingroomsgui':
             $this->tabs_gui->setTabActive('rooms');
             $this->pl_obj->includeClass("rooms/class.ilRoomSharingRoomsGUI.php");
             $object_gui =& new ilRoomSharingRoomsGUI($this);
             $ret =& $this->ctrl->forwardCommand($object_gui);
             $has_calendar = true;
             break;
             // Room, Called for display a single room
         // Room, Called for display a single room
         case 'ilroomsharingroomgui':
             $this->tabs_gui->setTabActive('rooms');
             $room_id = (int) $_GET['room_id'];
             $this->pl_obj->includeClass("rooms/detail/class.ilRoomSharingRoomGUI.php");
             $object_gui =& new ilRoomSharingRoomGUI($this, $room_id);
             $ret =& $this->ctrl->forwardCommand($object_gui);
             break;
             // CalendarWeek, Called for display a weekly view for a single room
         // CalendarWeek, Called for display a weekly view for a single room
         case 'ilroomsharingcalendarweekgui':
             $this->tabs_gui->setTabActive('rooms');
             $room_id = (int) $_GET['room_id'];
             $this->pl_obj->includeClass("rooms/detail/calendar/class.ilRoomSharingCalendarWeekGUI.php");
             $object_gui =& new ilRoomSharingCalendarWeekGUI($this->seed, $this->pool_id, $room_id);
             $ret =& $this->ctrl->forwardCommand($object_gui);
             break;
             // Book
         // Book
         case 'ilroomsharingbookgui':
             $this->tabs_gui->clearTargets();
             $this->tabs_gui->setBackTarget($this->lng->txt($_SESSION['last_cmd'] != "showRoom" ? "rep_robj_xrs_search_back" : "rep_robj_xrs_room_back"), $this->ctrl->getLinkTarget($this, $_SESSION['last_cmd']));
             $this->pl_obj->includeClass("booking/class.ilRoomSharingBookGUI.php");
             $book_gui =& new ilRoomSharingBookGUI($this);
             $ret =& $this->ctrl->forwardCommand($book_gui);
             break;
             // Show and edit booking
         // Show and edit booking
         case 'ilroomsharingshowandeditbookgui':
             $this->tabs_gui->clearTargets();
             $this->tabs_gui->setBackTarget($this->lng->txt("rep_robj_xrs_booking_back"), $ilCtrl->getLinkTarget($this, "showBookings"));
             $this->pl_obj->includeClass("booking/class.ilRoomSharingShowAndEditBookGUI.php");
             $booking_id = (int) $_GET['booking_id'];
             $room_id = (int) $_GET['room_id'];
             if ($cmd == 'editBooking' || $cmd == 'saveEditBooking') {
                 $mode = 'edit';
             } else {
                 $mode = 'show';
             }
             $showAndEditBook_gui =& new ilRoomSharingShowAndEditBookGUI($this, $booking_id, $room_id, $mode);
             $ret =& $this->ctrl->forwardCommand($showAndEditBook_gui);
             $has_calendar = true;
             break;
             // Floorplans
         // Floorplans
         case 'ilroomsharingfloorplansgui':
             $this->tabs_gui->setTabActive('floor_plans');
             $this->pl_obj->includeClass("floorplans/class.ilRoomSharingFloorPlansGUI.php");
             $schedule_gui =& new ilRoomSharingFloorPlansGUI($this);
             $ret =& $this->ctrl->forwardCommand($schedule_gui);
             break;
             // daVinci import
         // daVinci import
         case 'ilroomsharingdavinciimportgui':
             if ($this->permission->checkPrivilege(PRIVC::ACCESS_IMPORT)) {
                 $this->tabs_gui->setTabActive('daVinci_import');
                 $this->pl_obj->includeClass("import/class.ilRoomSharingDaVinciImportGUI.php");
                 $import_gui =& new ilRoomSharingDaVinciImportGUI($this);
                 $ret =& $this->ctrl->forwardCommand($import_gui);
                 break;
             }
             // Permissions
         // Permissions
         case 'ilpermissiongui':
             $this->tabs_gui->setTabActive('perm_settings');
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui =& new ilPermissionGUI($this);
             $ret =& $this->ctrl->forwardCommand($perm_gui);
             break;
             // Privileges
         // Privileges
         case 'ilroomsharingprivilegesgui':
             if ($this->permission->checkPrivilege(PRIVC::ACCESS_PRIVILEGES)) {
                 $this->tabs_gui->setTabActive('privileges');
                 $this->pl_obj->includeClass("privileges/class.ilRoomSharingPrivilegesGUI.php");
                 $privileges_gui =& new ilRoomSharingPrivilegesGUI($this);
                 $ret =& $this->ctrl->forwardCommand($privileges_gui);
             } else {
                 ilUtil::sendFailure($this->txt("no_permission"));
             }
             break;
             // Userprofile GUI
         // Userprofile GUI
         case 'ilpublicuserprofilegui':
             $ilTabs->clearTargets();
             $profile = new ilPublicUserProfileGUI((int) $_GET["user_id"]);
             $profile->setBackUrl($this->ctrl->getLinkTarget($this, 'log'));
             $ret = $this->ctrl->forwardCommand($profile);
             $tpl->setContent($ret);
             break;
             // Standard dispatcher GUI
         // Standard dispatcher GUI
         case "ilcommonactiondispatchergui":
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
             // Copy GUI. Not supported yet.
         // Copy GUI. Not supported yet.
         case "ilobjectcopygui":
             include_once "./Services/Object/classes/class.ilObjectCopyGUI.php";
             $cp = new ilObjectCopyGUI($this);
             $cp->setType("roomsharing");
             $this->ctrl->forwardCommand($cp);
             break;
             // Various CalendarGUIs
         // Various CalendarGUIs
         case "ilcalendardaygui":
             $this->setActiveTabRegardingPrivilege();
             $day = new ilCalendarDayGUI(new ilDate($_GET["seed"], IL_CAL_DATE));
             $this->ctrl->forwardCommand($day);
             break;
         case "ilcalendarmonthgui":
             $this->setActiveTabRegardingPrivilege();
             $month = new ilCalendarMonthGUI(new ilDate($_GET["seed"], IL_CAL_DATE));
             $this->ctrl->forwardCommand($month);
             break;
         case "ilcalendarweekgui":
             $this->setActiveTabRegardingPrivilege();
             $week = new ilCalendarweekGUI(new ilDate($_GET["seed"], IL_CAL_DATE));
             $this->ctrl->forwardCommand($week);
             break;
         case "ilcalendarblockgui":
             $this->setActiveTabRegardingPrivilege();
             $this->ctrl->forwardCommand($this->cal);
             break;
             // Standard cmd handling if cmd is none of the above. In that case, the next page is
             // appointments.
         // Standard cmd handling if cmd is none of the above. In that case, the next page is
         // appointments.
         default:
             $cmd = $ilCtrl->getCmd('render');
             $this->{$cmd}();
             $has_calendar = true;
             break;
     }
     // Action menu (top right corner of the module)
     $this->addHeaderAction();
     if (ilCalendarSettings::_getInstance()->isEnabled() && $has_calendar) {
         //adds Minicalendar to the right if active
         $tpl->setRightContent($this->cal->getHTML());
     }
     $tpl->addCss(ilUtil::getStyleSheetLocation('filesystem', 'delos.css', 'Services/Calendar'));
     return true;
 }
 /**
  * execute command
  *
  * @global	ilLocatorGUI		$ilLocator
  * @global	ilAccessHandler		$ilAccess
  * @global	ilNavigationHistory	$ilNavigationHistory
  * @global	ilTemplate			$tpl
  * @global	ilCtrl				$ilCtrl
  * @global	ILIAS				$ilias 
  */
 function executeCommand()
 {
     global $ilLocator, $ilAccess, $ilNavigationHistory, $tpl, $ilCtrl, $ilErr;
     if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"]) && !$ilAccess->checkAccess("visible", "", $_GET["ref_id"])) {
         global $ilias;
         $ilias->raiseError($this->lng->txt("permission_denied"), $ilias->error_obj->MESSAGE);
     }
     // add entry to navigation history
     if (!$this->getCreationMode() && $ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
         $ilNavigationHistory->addItem($_GET["ref_id"], "ilias.php?baseClass=ilObjQuestionPoolGUI&cmd=questions&ref_id=" . $_GET["ref_id"], "qpl");
     }
     $cmd = $this->ctrl->getCmd("questions");
     $next_class = $this->ctrl->getNextClass($this);
     if (in_array($next_class, array('', 'ilobjquestionpoolgui')) && $cmd == 'questions') {
         $_GET['q_id'] = '';
     }
     $this->prepareOutput();
     $this->ctrl->setReturn($this, "questions");
     $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
     $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "ta.css", "Modules/Test"), "screen");
     if ($_GET["q_id"] < 1) {
         $q_type = $_POST["sel_question_types"] != "" ? $_POST["sel_question_types"] : $_GET["sel_question_types"];
     }
     if ($cmd != "createQuestion" && $cmd != "createQuestionForTest" && $next_class != "ilpageobjectgui") {
         if ($_GET["test_ref_id"] != "" or $_GET["calling_test"]) {
             $ref_id = $_GET["test_ref_id"];
             if (!$ref_id) {
                 $ref_id = $_GET["calling_test"];
             }
         }
     }
     switch ($next_class) {
         case 'ilmdeditorgui':
             if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
                 $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
             }
             include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';
             $md_gui = new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType());
             $md_gui->addObserver($this->object, 'MDUpdateListener', 'General');
             $this->ctrl->forwardCommand($md_gui);
             break;
         case "ilpageobjectgui":
             include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
             $this->tpl->setCurrentBlock("ContentStyle");
             $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
             $this->tpl->parseCurrentBlock();
             // syntax style
             $this->tpl->setCurrentBlock("SyntaxStyle");
             $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
             $this->tpl->parseCurrentBlock();
             include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
             $q_gui = assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
             $q_gui->setQuestionTabs();
             $q_gui->outAdditionalOutput();
             $q_gui->object->setObjId($this->object->getId());
             $question = $q_gui->object;
             $this->ctrl->saveParameter($this, "q_id");
             include_once "./Services/COPage/classes/class.ilPageObject.php";
             include_once "./Services/COPage/classes/class.ilPageObjectGUI.php";
             $this->lng->loadLanguageModule("content");
             $this->ctrl->setReturnByClass("ilPageObjectGUI", "view");
             $this->ctrl->setReturn($this, "questions");
             //$page =& new ilPageObject("qpl", $_GET["q_id"]);
             $page_gui = new ilPageObjectGUI("qpl", $_GET["q_id"]);
             $page_gui->setEditPreview(true);
             $page_gui->setEnabledTabs(false);
             $page_gui->setEnabledInternalLinks(false);
             if (strlen($this->ctrl->getCmd()) == 0 && !isset($_POST["editImagemapForward_x"])) {
                 $this->ctrl->setCmdClass(get_class($page_gui));
                 $this->ctrl->setCmd("preview");
             }
             //$page_gui->setQuestionXML($question->toXML(false, false, true));
             $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(TRUE)));
             $page_gui->setTemplateTargetVar("ADM_CONTENT");
             $page_gui->setOutputMode("edit");
             $page_gui->setHeader($question->getTitle());
             $page_gui->setFileDownloadLink($this->ctrl->getLinkTarget($this, "downloadFile"));
             $page_gui->setFullscreenLink($this->ctrl->getLinkTarget($this, "fullscreen"));
             $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTarget($this));
             $page_gui->setPresentationTitle($question->getTitle());
             $ret = $this->ctrl->forwardCommand($page_gui);
             $tpl->setContent($ret);
             break;
         case 'ilpermissiongui':
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui = new ilPermissionGUI($this);
             $ret = $this->ctrl->forwardCommand($perm_gui);
             break;
         case 'ilobjectcopygui':
             include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
             $cp = new ilObjectCopyGUI($this);
             $cp->setType('qpl');
             $this->ctrl->forwardCommand($cp);
             break;
         case "ilexportgui":
             include_once "./Services/Export/classes/class.ilExportGUI.php";
             $exp_gui = new ilExportGUI($this);
             $exp_gui->addFormat("zip", $this->lng->txt('qpl_export_xml'), $this, "createExportQTI");
             $exp_gui->addFormat("xls", $this->lng->txt('qpl_export_excel'), $this, "createExportExcel");
             //			$exp_gui->addCustomColumn($lng->txt("cont_public_access"), $this, "getPublicAccessColValue");
             //			$exp_gui->addCustomMultiCommand($lng->txt("cont_public_access"), $this, "publishExportFile");
             $ret = $this->ctrl->forwardCommand($exp_gui);
             break;
         case "ilinfoscreengui":
             $this->infoScreenForward();
             break;
         case 'ilassquestionhintsgui':
             // set return target
             $this->ctrl->setReturn($this, "questions");
             // set context tabs
             require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
             $questionGUI = assQuestionGUI::_getQuestionGUI($q_type, $_GET['q_id']);
             $questionGUI->object->setObjId($this->object->getId());
             $questionGUI->setQuestionTabs();
             // forward to ilAssQuestionHintsGUI
             require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsGUI.php';
             $gui = new ilAssQuestionHintsGUI($questionGUI);
             $ilCtrl->forwardCommand($gui);
             break;
         case "ilobjquestionpoolgui":
         case "":
             if ($cmd == 'questions') {
                 $this->ctrl->setParameter($this, 'q_id', '');
             }
             $cmd .= "Object";
             $ret = $this->{$cmd}();
             break;
         default:
             $this->ctrl->setReturn($this, "questions");
             include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
             $q_gui = assQuestionGUI::_getQuestionGUI($q_type, $_GET["q_id"]);
             $q_gui->object->setObjId($this->object->getId());
             $q_gui->setQuestionTabs();
             $ret = $this->ctrl->forwardCommand($q_gui);
             break;
     }
     if (strtolower($_GET["baseClass"]) != "iladministrationgui" && $this->getCreationMode() != true) {
         $this->tpl->show();
     }
 }