/**
  * Modify GUI objects, before they generate ouput
  *
  * @param string $a_comp component
  * @param string $a_part string that identifies the part of the UI that is handled
  * @param string $a_par array of parameters (depend on $a_comp and $a_part)
  */
 function modifyGUI($a_comp, $a_part, $contextElements = array())
 {
     // currently only implemented for $ilTabsGUI
     // Zeigt an, in welchem Modul man sich gerade in ILIAS befindet
     /*
     		if ($part == "tabs") {
     			var_dump($this->ctrl->getCalHistory());
     		}
     		/**/
     // tabs hook
     // note that you currently do not get information in $a_comp
     // here. So you need to use general GET/POST information
     // like $_GET["baseClass"], $ilCtrl->getCmdClass/getCmd
     // to determine the context.
     //if ($a_part == "tabs")
     if ($a_part == "tabs" && $this->isINCourseGUI()) {
         // $a_par["tabs"] is ilTabsGUI object
         /** @var ilTabsGUI $tabs */
         $tabs = $contextElements["tabs"];
         $this->ctrl->saveParameterByClass('ilCourseEmailSubscriptionGUI', 'ref_id');
         // saveparameterbyclass behält Einstellungsvariablen (ref_id) auch bei neuem Link
         $tabs->addTab('courseSubscription', 'Mitglieder Einschreiben', $this->ctrl->getLinkTargetByClass(array('ilUIPluginRouterGUI', 'ilCourseEmailSubscriptionGUI'), 'show'));
         //$tabs->addTab('test', 'test', 'test');
         /*
         $tabs = $contextElements["tabs"];
         $this->ctrl->saveParameterByClass('ilUIExampleUIHookGUI', 'ref_id');
         $tabs->addTab('courseSubscription', 'Mitglieder Einschreiben', $this->ctrl->getLinkTargetByClass(array('ilUIPluginRouterGUI', 'ilUIExampleUIHookGUI'), 'show'));
         */
     }
 }
 /**
  * @param $ilLocator
  */
 protected function buildHeader($ilLocator)
 {
     $this->tpl->setTitle($this->courseObject->getTitle());
     // Der Titel des Kurses
     $this->tpl->setDescription($this->courseObject->getDescription());
     // Die Beschreibung des Kurses
     $this->tpl->setTitleIcon(ilObject::_getIcon($this->courseObject->getId(), 'big'));
     // Das Bild soll des Kurses
     // Wir fügen einen Zurückknopf ein. Dieser soll die Members des Kurses anzeigen
     $this->ctrl->saveParameterByClass('ilObjCourseGUI', 'ref_id');
     //Wir müssen die ref_id speichern, damit der Link zum richtigen Kurs zeigt
     $this->tabs->setBackTarget('Zurück', $this->ctrl->getLinkTargetByClass(array('ilRepositoryGUI', 'ilObjCourseGUI'), 'members'));
     // Wir fügen in den folgenden zwei Zeilen den Locator hinzu. (Breadcrumbs über dem Titel).
     $ilLocator->addRepositoryItems($this->courseObject->getRefId());
     $this->tpl->setLocator($ilLocator->getHTML());
 }
 public function executeCommand()
 {
     $cmd = $this->ctrl->getCmd();
     $next_class = $this->ctrl->getNextClass($this);
     parent::prepareOutput();
     $this->showTree();
     switch ($next_class) {
         case "illocalusergui":
             $this->tabs_gui->setTabActive('administrate_users');
             $ilLocalUserGUI = new ilLocalUserGUI($this);
             $this->ctrl->forwardCommand($ilLocalUserGUI);
             break;
         case "ilextidgui":
             $this->tabs_gui->setTabActive("settings");
             $this->setSubTabsSettings();
             $ilExtIdGUI = new ilExtIdGUI($this);
             $this->ctrl->forwardCommand($ilExtIdGUI);
             break;
         case "ilorgunitsimpleimportgui":
             $this->tabs_gui->setTabActive("view_content");
             $ilOrgUnitSimpleImportGUI = new ilOrgUnitSimpleImportGUI($this);
             $this->ctrl->forwardCommand($ilOrgUnitSimpleImportGUI);
             $this->tabs_gui->clearTargets();
             $this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTarget($this));
             break;
         case "ilorgunitsimpleuserimportgui":
             $this->tabs_gui->setTabActive("view_content");
             $ilOrgUnitSimpleUserImportGUI = new ilOrgUnitSimpleUserImportGUI($this);
             $this->ctrl->forwardCommand($ilOrgUnitSimpleUserImportGUI);
             $this->tabs_gui->clearTargets();
             $this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTarget($this));
             break;
         case "ilorgunitstaffgui":
         case "ilrepositorysearchgui":
             $this->tabs_gui->setTabActive('orgu_staff');
             $ilOrgUnitStaffGUI = new ilOrgUnitStaffGUI($this);
             $this->ctrl->forwardCommand($ilOrgUnitStaffGUI);
             break;
         case "ilobjusergui":
             switch ($cmd) {
                 case "create":
                     $ilObjUserGUI = new ilObjUserGUI("", (int) $_GET['ref_id'], true, false);
                     $ilObjUserGUI->setCreationMode(true);
                     $this->ctrl->forwardCommand($ilObjUserGUI);
                     $this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTargetByClass("illocalusergui", 'index'));
                     break;
                 case "view":
                 case "update":
                     $ilObjUserGUI = new ilObjUserGUI("", (int) $_GET['obj_id'], false, false);
                     $ilObjUserGUI->setCreationMode(false);
                     $this->ctrl->forwardCommand($ilObjUserGUI);
                     break;
                 case "cancel":
                     $this->ctrl->redirectByClass("illocalusergui", "index");
                     break;
             }
             break;
         case "ilobjuserfoldergui":
             $ilObjUserFolderGUI = new ilObjUserFolderGUI("", (int) $_GET['ref_id'], true, false);
             $ilObjUserFolderGUI->setUserOwnerId((int) $_GET['ref_id']);
             $ilObjUserFolderGUI->setCreationMode(true);
             $this->ctrl->forwardCommand($ilObjUserFolderGUI);
             $this->tabs_gui->clearTargets();
             $this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTargetByClass("illocalusergui", 'index'));
             break;
         case "ilinfoscreengui":
             $this->tabs_gui->setTabActive("info_short");
             if (!$this->ilAccess->checkAccess("visible", "", $this->ref_id)) {
                 $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"), $this->ilias->error_obj->MESSAGE);
             }
             $info = new ilInfoScreenGUI($this);
             $this->ctrl->forwardCommand($info);
             break;
         case 'ilpermissiongui':
             $this->tabs_gui->setTabActive('perm_settings');
             $ilPermissionGUI = new ilPermissionGUI($this);
             $this->ctrl->forwardCommand($ilPermissionGUI);
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case 'illearningprogressgui':
         case 'illplistofprogressgui':
             $this->tabs_gui->clearTargets();
             $this->tabs_gui->setBackTarget($this->lng->txt('backto_staff'), $this->ctrl->getLinkTargetByClass("ilOrgUnitStaffGUI", 'showStaff'));
             if (!ilObjOrgUnitAccess::_checkAccessToUserLearningProgress($this->object->getRefid(), $_GET['obj_id'])) {
                 ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
                 $this->ctrl->redirectByClass("ilOrgUnitStaffGUI", "showStaff");
             }
             $this->ctrl->saveParameterByClass("illearningprogressgui", "obj_id");
             $this->ctrl->saveParameterByClass("illearningprogressgui", "recursive");
             include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
             $new_gui =& new ilLearningProgressGUI(ilLearningProgressGUI::LP_CONTEXT_USER_FOLDER, USER_FOLDER_ID, $_GET["obj_id"]);
             $this->ctrl->forwardCommand($new_gui);
             break;
         case 'ilorgunitexportgui':
             $this->tabs_gui->setTabActive('export');
             $ilOrgUnitExportGUI = new ilOrgUnitExportGUI($this);
             $ilOrgUnitExportGUI->addFormat('xml');
             $this->ctrl->forwardCommand($ilOrgUnitExportGUI);
             break;
         case 'iltranslationgui':
             $this->tabs_gui->setTabActive("settings");
             $this->setSubTabsSettings();
             $ilTranslationGui = new ilTranslationGUI($this);
             $this->ctrl->forwardCommand($ilTranslationGui);
             break;
         default:
             switch ($cmd) {
                 case '':
                 case 'view':
                 case 'render':
                 case 'cancel':
                     $this->view();
                     break;
                 case 'create':
                     parent::createObject();
                     break;
                 case 'save':
                     parent::saveObject();
                     break;
                 case 'delete':
                     parent::deleteObject();
                     break;
                 case 'confirmedDelete':
                     parent::confirmedDeleteObject();
                     break;
                 case 'cut':
                     parent::cutObject();
                     break;
                 case 'clear':
                     parent::clearObject();
                     break;
                 case 'enableAdministrationPanel':
                     parent::enableAdministrationPanelObject();
                     break;
                 case 'disableAdministrationPanel':
                     parent::disableAdministrationPanelObject();
                     break;
             }
             break;
     }
 }
 public function executeCommand()
 {
     $cmd = $this->ctrl->getCmd();
     $next_class = $this->ctrl->getNextClass($this);
     parent::prepareOutput();
     //Otherwise move-Objects would not work
     if ($cmd != "cut") {
         $this->showTree();
     }
     switch ($next_class) {
         case "illocalusergui":
             if (!ilObjOrgUnitAccess::_checkAccessAdministrateUsers((int) $_GET['ref_id'])) {
                 ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
                 $this->ctrl->redirect($this);
             }
             $this->tabs_gui->setTabActive('administrate_users');
             $ilLocalUserGUI = new ilLocalUserGUI($this);
             $this->ctrl->forwardCommand($ilLocalUserGUI);
             break;
         case "ilorgunitsimpleimportgui":
             $this->tabs_gui->setTabActive("view_content");
             $ilOrgUnitSimpleImportGUI = new ilOrgUnitSimpleImportGUI($this);
             $this->ctrl->forwardCommand($ilOrgUnitSimpleImportGUI);
             $this->tabs_gui->clearTargets();
             $this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTarget($this));
             break;
         case "ilorgunitsimpleuserimportgui":
             $this->tabs_gui->setTabActive("view_content");
             $ilOrgUnitSimpleUserImportGUI = new ilOrgUnitSimpleUserImportGUI($this);
             $this->ctrl->forwardCommand($ilOrgUnitSimpleUserImportGUI);
             $this->tabs_gui->clearTargets();
             $this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTarget($this));
             break;
         case "ilorgunitstaffgui":
         case "ilrepositorysearchgui":
             $this->tabs_gui->setTabActive('orgu_staff');
             $ilOrgUnitStaffGUI = new ilOrgUnitStaffGUI($this);
             $this->ctrl->forwardCommand($ilOrgUnitStaffGUI);
             break;
         case "ilobjusergui":
             switch ($cmd) {
                 case "create":
                     $ilObjUserGUI = new ilObjUserGUI("", (int) $_GET['ref_id'], true, false);
                     $ilObjUserGUI->setCreationMode(true);
                     $this->ctrl->forwardCommand($ilObjUserGUI);
                     $this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTargetByClass("illocalusergui", 'index'));
                     break;
                 case "save":
                     $ilObjUserGUI = new ilObjUserGUI("", $_GET['ref_id'], true, false);
                     $ilObjUserGUI->setCreationMode(true);
                     $this->ctrl->forwardCommand($ilObjUserGUI);
                     $this->tabs_gui->clearTargets();
                     $this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTargetByClass("illocalusergui", 'index'));
                     break;
                 case "view":
                 case "update":
                     $ilObjUserGUI = new ilObjUserGUI("", (int) $_GET['obj_id'], false, false);
                     $ilObjUserGUI->setCreationMode(false);
                     $this->ctrl->forwardCommand($ilObjUserGUI);
                     $this->tabs_gui->clearTargets();
                     $this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTargetByClass("illocalusergui", 'index'));
                     break;
                 case "cancel":
                     $this->ctrl->redirectByClass("illocalusergui", "index");
                     break;
             }
             break;
         case "ilobjuserfoldergui":
             switch ($cmd) {
                 case "view":
                     $this->ctrl->redirectByClass("illocalusergui", "index");
                     break;
                 default:
                     $ilObjUserFolderGUI = new ilObjUserFolderGUI("", (int) $_GET['ref_id'], true, false);
                     $ilObjUserFolderGUI->setUserOwnerId((int) $_GET['ref_id']);
                     $ilObjUserFolderGUI->setCreationMode(true);
                     $this->ctrl->forwardCommand($ilObjUserFolderGUI);
                     $this->tabs_gui->clearTargets();
                     $this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTargetByClass("illocalusergui", 'index'));
                     break;
             }
             break;
         case "ilinfoscreengui":
             $this->tabs_gui->setTabActive("info_short");
             if (!$this->ilAccess->checkAccess("read", "", $this->ref_id) and !$this->ilAccess->checkAccess("visible", "", $this->ref_id)) {
                 $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"), $this->ilias->error_obj->MESSAGE);
             }
             $info = new ilInfoScreenGUI($this);
             $this->parseInfoScreen($info);
             $this->ctrl->forwardCommand($info);
             // I guess this is how it was supposed to work, but it doesn't... it won't respect our sub-id and sub-type when creating the objects!
             // So we reimplemented the stuff in the method parseInfoScreen()
             //                $info = new ilInfoScreenGUI($this);
             //                $amd_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_INFO, 'orgu', $this->object->getId(), 'orgu_type', $this->object->getOrgUnitTypeId());
             //                $amd_gui->setInfoObject($info);
             //                $amd_gui->setSelectedOnly(true);
             //                $amd_gui->parse();
             //                $this->ctrl->forwardCommand($info);
             break;
         case 'ilpermissiongui':
             $this->tabs_gui->setTabActive('perm_settings');
             $ilPermissionGUI = new ilPermissionGUI($this);
             $this->ctrl->forwardCommand($ilPermissionGUI);
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case 'illearningprogressgui':
         case 'illplistofprogressgui':
             $this->tabs_gui->clearTargets();
             $this->tabs_gui->setBackTarget($this->lng->txt('backto_staff'), $this->ctrl->getLinkTargetByClass("ilOrgUnitStaffGUI", 'showStaff'));
             if (!ilObjOrgUnitAccess::_checkAccessToUserLearningProgress($this->object->getRefid(), $_GET['obj_id'])) {
                 ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
                 $this->ctrl->redirectByClass("ilOrgUnitStaffGUI", "showStaff");
             }
             $this->ctrl->saveParameterByClass("illearningprogressgui", "obj_id");
             $this->ctrl->saveParameterByClass("illearningprogressgui", "recursive");
             include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
             $new_gui =& new ilLearningProgressGUI(ilLearningProgressGUI::LP_CONTEXT_ORG_UNIT, $_GET["ref_id"], $_GET['obj_id']);
             $this->ctrl->forwardCommand($new_gui);
             break;
         case 'ilorgunitexportgui':
             $this->tabs_gui->setTabActive('export');
             $ilOrgUnitExportGUI = new ilOrgUnitExportGUI($this);
             $ilOrgUnitExportGUI->addFormat('xml');
             $this->ctrl->forwardCommand($ilOrgUnitExportGUI);
             break;
         case 'iltranslationgui':
             $this->tabs_gui->setTabActive("settings");
             $this->setSubTabsSettings('edit_translations');
             $ilTranslationGui = new ilTranslationGUI($this);
             $this->ctrl->forwardCommand($ilTranslationGui);
             break;
         case 'ilorgunittypegui':
             $this->tabs_gui->setTabActive('orgu_types');
             $types_gui = new ilOrgUnitTypeGUI($this);
             $this->ctrl->forwardCommand($types_gui);
             break;
         default:
             switch ($cmd) {
                 case '':
                 case 'view':
                 case 'render':
                 case 'cancel':
                 case 'cancelDelete':
                     $this->view();
                     break;
                 case 'performPaste':
                     $this->performPaste();
                     break;
                 case 'paste':
                     $this->performPaste();
                     break;
                 case 'performPasteIntoMultipleObjects':
                     $this->performPasteIntoMultipleObjectsObject();
                     break;
                 case 'create':
                     parent::createObject();
                     break;
                 case 'save':
                     parent::saveObject();
                     break;
                 case 'delete':
                     $this->tabs_gui->clearTargets();
                     $this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTarget($this));
                     parent::deleteObject();
                     break;
                 case 'confirmedDelete':
                     parent::confirmedDeleteObject();
                     break;
                 case 'cut':
                     $this->tabs_gui->clearTargets();
                     $this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTarget($this));
                     parent::cutObject();
                     break;
                 case 'clear':
                     parent::clearObject();
                     break;
                 case 'enableAdministrationPanel':
                     parent::enableAdministrationPanelObject();
                     break;
                 case 'disableAdministrationPanel':
                     parent::disableAdministrationPanelObject();
                     break;
                 case 'getAsynchItemList':
                     parent::getAsynchItemListObject();
                     break;
                 case 'editSettings':
                     $this->tabs_gui->setTabActive("settings");
                     $this->setSubTabsSettings('edit_settings');
                     $this->editSettings();
                     break;
                 case 'updateSettings':
                     $this->tabs_gui->setTabActive("settings");
                     $this->setSubTabsSettings('edit_settings');
                     $this->updateSettings();
                     break;
                 case 'editAdvancedSettings':
                     $this->tabs_gui->setTabActive("settings");
                     $this->setSubTabsSettings('edit_advanced_settings');
                     $this->editAdvancedSettings();
                     break;
                 case 'updateAdvancedSettings':
                     $this->tabs_gui->setTabActive("settings");
                     $this->setSubTabsSettings('edit_advanced_settings');
                     $this->updateAdvancedSettings();
                     break;
             }
             break;
     }
 }