public function executeCommand()
 {
     global $ilTabs;
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     $this->prepareOutput();
     switch ($next_class) {
         case 'ilinfoscreengui':
             // forwards command
             $this->infoScreen();
             break;
         case 'ilpermissiongui':
             $ilTabs->activateTab('id_permissions');
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $this->ctrl->forwardCommand(new ilPermissionGUI($this));
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         default:
             if (!$cmd || $cmd == 'view') {
                 $cmd = "editSettings";
             }
             $cmd .= "Object";
             $this->{$cmd}();
             break;
     }
     return true;
 }
 function &executeCommand()
 {
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     switch ($next_class) {
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case "ilobjectownershipmanagementgui":
             $this->prepareOutput();
             $this->tabs_gui->activateTab("ownership");
             include_once "Services/Object/classes/class.ilObjectOwnershipManagementGUI.php";
             $gui = new ilObjectOwnershipManagementGUI();
             $this->ctrl->forwardCommand($gui);
             break;
         default:
             $this->prepareOutput();
             if ($this->type != "wsrt") {
                 $this->addHeaderAction();
             }
             if (!$cmd) {
                 $cmd = "render";
             }
             $this->{$cmd}();
             break;
     }
     return true;
 }
 /**
  * Handles all commmands of this class, centralizes permission checks
  */
 function performCommand($cmd)
 {
     $next_class = $this->ctrl->getNextClass($this);
     switch ($next_class) {
         case 'ilcommonactiondispatchergui':
             require_once 'Services/Object/classes/class.ilCommonActionDispatcherGUI.php';
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             return $this->ctrl->forwardCommand($gui);
             break;
     }
     switch ($cmd) {
         case "editProperties":
             // list all commands that need write permission here
         // list all commands that need write permission here
         case "updateProperties":
             $this->checkPermission("write");
             $this->{$cmd}();
             break;
         case "showContent":
             // list all commands that need read permission here
             //case "...":
             //case "...":
             $this->checkPermission("read");
             $this->{$cmd}();
             break;
     }
 }
 /**
  * execute command
  */
 function executeCommand()
 {
     global $ilTabs, $lng, $ilAccess, $tpl, $ilCtrl, $ilLocator;
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     switch ($next_class) {
         case 'ilinfoscreengui':
             $this->prepareOutput();
             $this->addHeaderAction();
             $this->infoScreen();
             break;
         case 'ilpermissiongui':
             $this->prepareOutput();
             $ilTabs->activateTab("perm_settings");
             $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;
         default:
             $cmd = $this->ctrl->getCmd("listMaterials");
             $this->prepareOutput();
             $this->addHeaderAction();
             $this->{$cmd}();
             break;
     }
 }
 /**
  *	Plugin command execution runpoint.
  *
  *	The performCommand() method is called internally
  *	by ilias to handle a specific request action.
  *	The $cmd given as argument is used to identify
  *	the command to be executed.
  *
  *	@param string $cmd	The command (method) to execute.
  */
 public function performCommand($cmd)
 {
     /**
      * @var $ilTabs ilTabsGUI
      * @var $tpl    ilTemplate
      */
     global $ilTabs, $tpl;
     $tpl->setDescription($this->object->getDescription());
     $next_class = $this->ctrl->getNextClass($this);
     switch ($next_class) {
         case 'ilmdeditorgui':
             $this->checkPermission('write');
             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');
             $ilTabs->setTabActive('meta_data');
             $this->ctrl->forwardCommand($md_gui);
             return;
             break;
         case 'ilcommonactiondispatchergui':
             require_once 'Services/Object/classes/class.ilCommonActionDispatcherGUI.php';
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         default:
             switch ($cmd) {
                 case 'updateSettings':
                 case 'updateMemberships':
                 case 'initSelectTests':
                 case 'selectTests':
                 case 'performAddTests':
                 case 'removeTests':
                 case 'addMemberships':
                 case 'removeMemberships':
                 case 'editSettings':
                     $this->checkPermission('write');
                     $this->{$cmd}();
                     break;
                 case 'showContent':
                 case 'applyOverviewFilter':
                 case 'applyTestsFilter':
                 case 'applyGroupsFilter':
                 case 'resetOverviewFilter':
                 case 'resetTestsFilter':
                 case 'resetGroupsFilter':
                 case 'addToDesk':
                 case 'removeFromDesk':
                     if (in_array($cmd, array('addToDesk', 'removeFromDesk'))) {
                         $cmd .= 'Object';
                     }
                     $this->checkPermission('read');
                     $this->{$cmd}();
                     break;
                 case 'submitManualScores':
                     $this->{$cmd}();
             }
             break;
     }
     $this->addHeaderAction();
 }
예제 #6
0
 /**
  * execute command
  */
 function &executeCommand()
 {
     global $rbacsystem, $tpl, $ilAccess;
     // load additional language modules
     $this->lng->loadLanguageModule("barometer");
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd("showSummary");
     $this->ctrl->setReturn($this, "showSummary");
     $this->setTabs();
     switch ($next_class) {
         case "ilnotegui":
             $this->showSummary();
             // forwards command
             break;
         case "ilcolumngui":
             $this->showSummary();
             break;
         case "ilpublicuserprofilegui":
             include_once "./Services/User/classes/class.ilPublicUserProfileGUI.php";
             $user_profile = new ilPublicUserProfileGUI($_GET["user_id"]);
             $user_profile->setBackUrl($this->ctrl->getLinkTarget($this, "showSummary"));
             $html = $this->ctrl->forwardCommand($user_profile);
             $tpl->setContent($html);
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         default:
             return $this->{$cmd}();
             break;
     }
     return true;
 }
 /**
  * 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;
         default:
             $cmd = $this->ctrl->getCmd();
             $cmd .= 'Object';
             $this->{$cmd}();
             break;
     }
     $this->addHeaderAction();
     return true;
 }
 /**
  * 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;
 }
 /**
  * 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;
 }
예제 #10
0
 /**
  * execute command
  */
 function &executeCommand()
 {
     global $ilCtrl, $ilTabs, $ilUser;
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     switch ($next_class) {
         case "ilnotegui":
             $this->getTabs();
             $ilTabs->setTabActive("pg");
             return $this->preview();
             break;
         case "ilratinggui":
             // for rating side block
             include_once "./Services/Rating/classes/class.ilRatingGUI.php";
             $rating_gui = new ilRatingGUI();
             $rating_gui->setObject($this->getPageObject()->getParentId(), "wiki", $this->getPageObject()->getId(), "wpg");
             $this->ctrl->forwardCommand($rating_gui);
             $ilCtrl->redirect($this, "preview");
             break;
         case "ilpageobjectgui":
             die("Deprecated. Wikipage gui forwarding to ilpageobject");
             return;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $gui->enableCommentsSettings(false);
             $gui->setRatingCallback($this, "preview");
             $this->ctrl->forwardCommand($gui);
             break;
         default:
             if ($_GET["ntf"]) {
                 include_once "./Services/Notification/classes/class.ilNotification.php";
                 switch ($_GET["ntf"]) {
                     case 1:
                         ilNotification::setNotification(ilNotification::TYPE_WIKI, $ilUser->getId(), $this->getPageObject()->getParentId(), false);
                         break;
                     case 2:
                         // remove all page notifications here?
                         ilNotification::setNotification(ilNotification::TYPE_WIKI, $ilUser->getId(), $this->getPageObject()->getParentId(), true);
                         break;
                     case 3:
                         ilNotification::setNotification(ilNotification::TYPE_WIKI_PAGE, $ilUser->getId(), $this->getPageObject()->getId(), false);
                         break;
                     case 4:
                         ilNotification::setNotification(ilNotification::TYPE_WIKI_PAGE, $ilUser->getId(), $this->getPageObject()->getId(), true);
                         break;
                 }
                 $ilCtrl->redirect($this, "preview");
             }
             $this->setPresentationTitle($this->getWikiPage()->getTitle());
             return parent::executeCommand();
     }
 }
예제 #11
0
 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();
     }
 }
 /**
  * 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();
     }
 }
 /**
  * execute command
  */
 function &executeCommand()
 {
     global $ilAccess, $ilTabs, $ilErr;
     if (strtolower($_GET["baseClass"]) == "iladministrationgui" || $this->getCreationMode() == true) {
         $this->prepareOutput();
     } else {
         $this->getTemplate();
         $this->setLocator();
         $this->setTabs();
     }
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     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 "ilfilesystemgui":
             $this->fs_gui =& new ilFileSystemGUI($this->object->getDataDirectory());
             $this->fs_gui->setTableId("sahsfs" . $this->object->getId());
             $ret =& $this->ctrl->forwardCommand($this->fs_gui);
             break;
         case "ilcertificategui":
             include_once "./Services/Certificate/classes/class.ilCertificateGUI.php";
             include_once "./Modules/ScormAicc/classes/class.ilSCORMCertificateAdapter.php";
             $output_gui = new ilCertificateGUI(new ilSCORMCertificateAdapter($this->object));
             $ret =& $this->ctrl->forwardCommand($output_gui);
             break;
         case "illearningprogressgui":
             include_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 'illicensegui':
             include_once "./Services/License/classes/class.ilLicenseGUI.php";
             $license_gui =& new ilLicenseGUI($this);
             $ret =& $this->ctrl->forwardCommand($license_gui);
             break;
         case "ilinfoscreengui":
             include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php";
             $info = new ilInfoScreenGUI($this);
             $info->enablePrivateNotes();
             $info->enableLearningProgress();
             // add read / back button
             if ($ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
                 if (!$this->object->getEditable()) {
                     $info->addButton($this->lng->txt("view"), "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=" . $this->object->getRefID(), ' target="ilContObj' . $this->object->getId() . '" ');
                 }
             }
             $info->enableNews();
             if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
                 $info->enableNewsEditing();
                 $news_set = new ilSetting("news");
                 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
                 if ($enable_internal_rss) {
                     $info->setBlockProperty("news", "settings", true);
                 }
             }
             // show standard meta data section
             $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
             // forward the command
             $this->ctrl->forwardCommand($info);
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case "ilobjstylesheetgui":
             //$this->addLocations();
             $this->ctrl->setReturn($this, "properties");
             $ilTabs->clearTargets();
             $style_gui =& new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
             $style_gui->omitLocator();
             if ($cmd == "create" || $_GET["new_type"] == "sty") {
                 $style_gui->setCreationMode(true);
             }
             //$ret =& $style_gui->executeCommand();
             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 ($this->object && !$this->object->getEditable()) {
                 $cmd = $this->ctrl->getCmd("properties");
             } else {
                 $cmd = $this->ctrl->getCmd("frameset");
             }
             if ((strtolower($_GET["baseClass"]) == "iladministrationgui" || $this->getCreationMode() == true) && $cmd != "frameset") {
                 $cmd .= "Object";
             }
             // #9225
             if ($cmd == "redrawHeaderAction") {
                 $cmd .= "Object";
             }
             $ret =& $this->{$cmd}();
             break;
     }
 }
예제 #14
0
 /**
  * execute command
  */
 function executeCommand()
 {
     global $ilUser, $ilLocator, $ilTabs;
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     if (strtolower($_GET["baseClass"]) == "iladministrationgui" || $this->getCreationMode() == true) {
         $this->prepareOutput();
     } else {
         if (!in_array($cmd, array("", "framset")) || $next_class != "") {
             $this->getTemplate();
             $this->setLocator();
             $this->setTabs();
         }
     }
     if (!$this->getCreationMode()) {
         if (IS_PAYMENT_ENABLED) {
             include_once 'Services/Payment/classes/class.ilPaymentObject.php';
             if (ilPaymentObject::_requiresPurchaseToAccess($_GET['ref_id'], $type = isset($_GET['purchasetype']) ? $_GET['purchasetype'] : NULL)) {
                 $this->tpl->getStandardTemplate();
                 include_once 'Services/Payment/classes/class.ilShopPurchaseGUI.php';
                 $pp = new ilShopPurchaseGUI((int) $_GET['ref_id']);
                 $ret = $this->ctrl->forwardCommand($pp);
                 return true;
             }
         }
     }
     switch ($next_class) {
         case 'ilmdeditorgui':
             $this->checkPermission("write");
             $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 "ilfilesystemgui":
             $this->checkPermission("write");
             $ilTabs->activateTab('id_list_files');
             $fs_gui = new ilFileSystemGUI($this->object->getDataDirectory());
             $fs_gui->activateLabels(true, $this->lng->txt("cont_purpose"));
             $fs_gui->setUseUploadDirectory(true);
             $fs_gui->setTableId("htlmfs" . $this->object->getId());
             if ($this->object->getStartFile() != "") {
                 $fs_gui->labelFile($this->object->getStartFile(), $this->lng->txt("cont_startfile"));
             }
             $fs_gui->addCommand($this, "setStartFile", $this->lng->txt("cont_set_start_file"));
             $this->ctrl->forwardCommand($fs_gui);
             // try to set start file automatically
             require_once "./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php";
             if (!ilObjFileBasedLMAccess::_determineStartUrl($this->object->getId())) {
                 $do_update = false;
                 $pcommand = $fs_gui->getLastPerformedCommand();
                 if (is_array($pcommand)) {
                     $valid = array("index.htm", "index.html", "start.htm", "start.html");
                     if ($pcommand["cmd"] == "create_file") {
                         $file = strtolower(basename($pcommand["name"]));
                         if (in_array($file, $valid)) {
                             $this->object->setStartFile($pcommand["name"]);
                             $do_update = $pcommand["name"];
                         }
                     } else {
                         if ($pcommand["cmd"] == "unzip_file") {
                             $zip_file = strtolower(basename($pcommand["name"]));
                             $suffix = strrpos($zip_file, ".");
                             if ($suffix) {
                                 $zip_file = substr($zip_file, 0, $suffix);
                             }
                             foreach ($pcommand["added"] as $file) {
                                 $chk_file = null;
                                 if (stristr($file, ".htm")) {
                                     $chk_file = strtolower(basename($file));
                                     $suffix = strrpos($chk_file, ".");
                                     if ($suffix) {
                                         $chk_file = substr($chk_file, 0, $suffix);
                                     }
                                 }
                                 if (in_array(basename($file), $valid) || $zip_file && $chk_file && $chk_file == $zip_file) {
                                     $this->object->setStartFile($file);
                                     $do_update = $file;
                                     break;
                                 }
                             }
                         }
                     }
                 }
                 if ($do_update) {
                     ilUtil::sendInfo(sprintf($this->lng->txt("cont_start_file_set_to"), $do_update), true);
                     $this->object->update();
                     $this->ctrl->redirectByClass("ilfilesystemgui", "listFiles");
                 }
             }
             break;
         case "ilinfoscreengui":
             $ret =& $this->outputInfoScreen();
             break;
         case "illearningprogressgui":
             $ilTabs->activateTab('id_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);
             break;
         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 'illicensegui':
             $ilTabs->activateTab('id_license');
             include_once "./Services/License/classes/class.ilLicenseGUI.php";
             $license_gui =& new ilLicenseGUI($this);
             $ret =& $this->ctrl->forwardCommand($license_gui);
             break;
         case "ilexportgui":
             $ilTabs->activateTab("export");
             include_once "./Services/Export/classes/class.ilExportGUI.php";
             $exp_gui = new ilExportGUI($this);
             $exp_gui->addFormat("xml");
             $exp_gui->addFormat("html", "", $this, "exportHTML");
             $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:
             $cmd = $this->ctrl->getCmd("frameset");
             if (strtolower($_GET["baseClass"]) == "iladministrationgui" || $this->getCreationMode() == true) {
                 $cmd .= "Object";
             }
             $ret =& $this->{$cmd}();
             break;
     }
     $this->addHeaderAction();
 }
예제 #15
0
 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;
 }
 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;
 }
예제 #17
0
 /**
  * execute command
  */
 function executeCommand()
 {
     global $ilNavigationHistory, $ilAccess, $ilias, $lng, $ilCtrl, $ilUser;
     if (IS_PAYMENT_ENABLED) {
         include_once 'Services/Payment/classes/class.ilPaymentObject.php';
         if ($ilAccess->checkAccess('visible', '', $_GET['ref_id']) && $this->needs_to_be_purchased) {
             if (!((int) $_GET['obj_id'] && ($this->lm->getPublicAccessMode() == 'selected' && ilLMObject::_isPagePublic($_GET['obj_id'])) && ($this->ctrl->getCmd() == 'layout' || $this->ctrl->getCmd() == ''))) {
                 unset($_GET['obj_id']);
                 $this->tpl->getStandardTemplate();
                 $this->ilLocator();
                 include_once 'Services/Payment/classes/class.ilShopPurchaseGUI.php';
                 $pp = new ilShopPurchaseGUI((int) $_GET['ref_id']);
                 $ret = $this->ctrl->forwardCommand($pp);
                 $this->tpl->show();
                 return true;
             }
         }
     }
     // check read permission, payment and parent conditions
     // todo: replace all this by ilAccess call
     if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"]) && !(($this->ctrl->getCmd() == "infoScreen" || $this->ctrl->getNextClass() == "ilinfoscreengui") && $ilAccess->checkAccess("visible", "", $_GET["ref_id"]))) {
         $ilias->raiseError($lng->txt("permission_denied"), $ilias->error_obj->WARNING);
     }
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd("layout", array("showPrintView"));
     $cmd = isset($_POST['cmd']['citation']) ? "ilCitation" : $cmd;
     $obj_id = $_GET["obj_id"];
     $this->ctrl->setParameter($this, "obj_id", $_GET["obj_id"]);
     $ilNavigationHistory->addItem($_GET["ref_id"], $this->ctrl->getLinkTarget($this), "lm");
     $this->ctrl->setParameter($this, "obj_id", $obj_id);
     switch ($next_class) {
         case "ilnotegui":
             $ret = $this->layout();
             break;
         case "ilinfoscreengui":
             $ret = $this->outputInfoScreen();
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $gui->enableCommentsSettings(false);
             $this->ctrl->forwardCommand($gui);
             break;
         case "illmpagegui":
             include_once "./Modules/LearningModule/classes/class.ilLMPageGUI.php";
             $page_gui = $this->getLMPageGUI($_GET["obj_id"]);
             $this->basicPageGuiInit($page_gui);
             $ret = $ilCtrl->forwardCommand($page_gui);
             break;
         case "ilglossarydefpagegui":
             include_once "./Modules/Glossary/classes/class.ilGlossaryDefPageGUI.php";
             $page_gui = new ilGlossaryDefPageGUI($_GET["obj_id"]);
             $this->basicPageGuiInit($page_gui);
             $ret = $ilCtrl->forwardCommand($page_gui);
             break;
         case "illearningprogressgui":
             $this->initScreenHead("learning_progress");
             include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
             $new_gui = new ilLearningProgressGUI(ilLearningProgressGUI::LP_CONTEXT_REPOSITORY, $_GET["ref_id"], $ilUser->getId());
             $this->ctrl->forwardCommand($new_gui);
             break;
         case "ilratinggui":
             include_once "./Services/Rating/classes/class.ilRatingGUI.php";
             $rating_gui = new ilRatingGUI();
             $rating_gui->setObject($this->lm->getId(), "lm", $_GET["obj_id"], "lm");
             $this->ctrl->forwardCommand($rating_gui);
             break;
         default:
             $ret = $this->{$cmd}();
             break;
     }
 }
예제 #18
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();
     }
 }
 /**
  * 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();
     }
 }
예제 #20
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();
 }
예제 #21
0
 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;
     }
 }
 /**
  * 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());
             $new_gui->activateStatistics();
             $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");
             $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 "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case "ilpagemultilanggui":
             $this->addHeaderAction();
             $this->addLocations(true);
             $ilCtrl->setReturn($this, "properties");
             include_once "./Services/COPage/classes/class.ilPageMultiLangGUI.php";
             $ml_gui = new ilPageMultiLangGUI("lm", $this->object->getId());
             $this->setTabs("settings");
             $this->setSubTabs("cont_multilinguality");
             $ret = $this->ctrl->forwardCommand($ml_gui);
             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;
 }
 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();
     }
 }
예제 #24
0
 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();
 }
예제 #25
0
 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;
 }
 /**
  * execute command
  */
 function executeCommand()
 {
     global $ilUser, $ilLocator, $ilTabs;
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     if (strtolower($_GET["baseClass"]) == "iladministrationgui" || $this->getCreationMode() == true) {
         $this->prepareOutput();
     } else {
         if (!in_array($cmd, array("", "framset")) || $next_class != "") {
             $this->getTemplate();
             $this->setLocator();
             $this->setTabs();
         }
     }
     if (!$this->getCreationMode()) {
         if (IS_PAYMENT_ENABLED) {
             include_once 'Services/Payment/classes/class.ilPaymentObject.php';
             if (ilPaymentObject::_requiresPurchaseToAccess($_GET['ref_id'], $type = isset($_GET['purchasetype']) ? $_GET['purchasetype'] : NULL)) {
                 $this->tpl->getStandardTemplate();
                 include_once 'Services/Payment/classes/class.ilShopPurchaseGUI.php';
                 $pp = new ilShopPurchaseGUI((int) $_GET['ref_id']);
                 $ret = $this->ctrl->forwardCommand($pp);
                 return true;
             }
         }
     }
     switch ($next_class) {
         case 'ilmdeditorgui':
             $this->checkPermission("write");
             $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 "ilfilesystemgui":
             $this->checkPermission("write");
             $ilTabs->activateTab('id_list_files');
             $fs_gui =& new ilFileSystemGUI($this->object->getDataDirectory());
             $fs_gui->activateLabels(true, $this->lng->txt("cont_purpose"));
             $fs_gui->setTableId("htlmfs" . $this->object->getId());
             if ($this->object->getStartFile() != "") {
                 $fs_gui->labelFile($this->object->getStartFile(), $this->lng->txt("cont_startfile"));
             }
             $fs_gui->addCommand($this, "setStartFile", $this->lng->txt("cont_set_start_file"));
             $ret =& $this->ctrl->forwardCommand($fs_gui);
             break;
         case "ilinfoscreengui":
             $ret =& $this->outputInfoScreen();
             break;
         case "illearningprogressgui":
             $ilTabs->activateTab('id_learning_progress');
             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);
             break;
         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 'illicensegui':
             $ilTabs->activateTab('id_license');
             include_once "./Services/License/classes/class.ilLicenseGUI.php";
             $license_gui =& new ilLicenseGUI($this);
             $ret =& $this->ctrl->forwardCommand($license_gui);
             break;
         case "ilexportgui":
             $ilTabs->activateTab("export");
             include_once "./Services/Export/classes/class.ilExportGUI.php";
             $exp_gui = new ilExportGUI($this);
             $exp_gui->addFormat("xml");
             $exp_gui->addFormat("html", "", $this, "exportHTML");
             $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:
             $cmd = $this->ctrl->getCmd("frameset");
             if (strtolower($_GET["baseClass"]) == "iladministrationgui" || $this->getCreationMode() == true) {
                 $cmd .= "Object";
             }
             $ret =& $this->{$cmd}();
             break;
     }
     $this->addHeaderAction();
 }
 /**
  * execute command
  */
 function &executeCommand()
 {
     global $ilCtrl;
     $next_class = $ilCtrl->getNextClass();
     $cmd = $ilCtrl->getCmd("getHTML");
     switch ($next_class) {
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $ilCtrl->forwardCommand($gui);
             break;
         default:
             if (method_exists($this, $cmd)) {
                 return $this->{$cmd}();
             } else {
                 $cmd .= 'Object';
                 return $this->{$cmd}();
             }
     }
 }
 /**
  * Handles all commmands of this class, centralizes permission checks
  */
 function performCommand($cmd)
 {
     global $tpl;
     $tpl->setDescription($this->object->getDescription());
     switch ($cmd) {
         // list all commands that need write permission here
         /* Assignments */
         case "listAssignments":
             // Overview of assignments
         // Overview of assignments
         case "addAssignment":
             // Add assignment form
         // Add assignment form
         case "saveAssignment":
             // Save new assignment
         // Save new assignment
         case "editAssignment":
             // Edit assignment form
         // Edit assignment form
         case "updateAssignment":
             // Save edited assignment
         // Save edited assignment
         case "confirmDeleteAssignment":
             // Confirm for deletion of selected assignment(s)
         // Confirm for deletion of selected assignment(s)
         case "deleteAssignment":
             // Delete assignment(s) for real
         // Delete assignment(s) for real
         case "orderAssignmentsByDeadline":
             // Order assignments by deadline
         // Order assignments by deadline
         case "saveAssignmentsOrder":
             // Order Assignments as set
             /* Settings */
         // Order Assignments as set
         /* Settings */
         case "settings":
             // Settings form
         // Settings form
         case "updateSettings":
             // Save settings
             /* Submissions and Grades */
         // Save settings
         /* Submissions and Grades */
         case "showSubmissions":
             // Submissions per assignment
         // Submissions per assignment
         case "saveStatus":
             // Update submission users
         // Update submission users
         case "selectAssignment":
             // Select an assignment
         // Select an assignment
         case "addUserFromAutoComplete":
             // Add user from dropdown
         // Add user from dropdown
         case "addParticipant":
             // Add user from search
         // Add user from search
         case "showParticipants":
             // Submissions per user
         // Submissions per user
         case "saveStatusParticipant":
             // Update user submissions
         // Update user submissions
         case "selectParticipant":
             // Select a user
         // Select a user
         case "redirectFeedbackMail":
             //
         //
         case "sendMembers":
             //
         //
         case "confirmDeassignMembers":
             //
         //
         case "deassignMembers":
             //
         //
         case "downloadSubmittedFile":
             //
         //
         case "showGradesOverview":
             // Grades overview
         // Grades overview
         case "exportExcel":
             // Export grades as xls
         // Export grades as xls
         case "saveGrades":
             // Update grades
             /* Ephorus stuff */
         // Update grades
         /* Ephorus stuff */
         case "viewReport":
             // View the report of the selected document
         // View the report of the selected document
         case "changeVisibility":
             // Change the index of the selected document
             $this->checkPermission("write");
             $this->{$cmd}();
             break;
             // list all commands that need read permission here
             /* Assignments */
         // list all commands that need read permission here
         /* Assignments */
         case "showOverview":
             // Assignment overview
         // Assignment overview
         case "downloadFile":
             // Download selected assignment file
         // Download selected assignment file
         case "submissionScreen":
             // Add submission
         // Add submission
         case "deliverFile":
             // Save file to server
         // Save file to server
         case "deliverUnzip":
             // Save zip
         // Save zip
         case "download":
             // Download own submitted document(s)
         // Download own submitted document(s)
         case "confirmDeleteDelivered":
             // Confirm for deletion of document(s)
         // Confirm for deletion of document(s)
         case "deleteDelivered":
             // Delete document(s) for real
         // Delete document(s) for real
         case "listPublicSubmissions":
             // Show all Submissions
         // Show all Submissions
         case "downloadReturned":
             // Download all Submissions
         // Download all Submissions
         case "downloadAllDeliveredFiles":
             $this->checkPermission("read");
             $this->{$cmd}();
             break;
             /* ilFileSystemGUI */
         /* ilFileSystemGUI */
         case "listFiles":
             // Edit assignment files
         // Edit assignment files
         case "uploadFile":
             // Edit assignment files
         // Edit assignment files
         case "extCommand_0":
             // Assignment overview
         // Assignment overview
         case "extCommand_1":
             // Add submission
         // Add submission
         case "extCommand_2":
             // Save file to server
         // Save file to server
         case "extCommand_3":
             // Save zip
         // Save zip
         case "deleteFile":
             //
         //
         case "renameFile":
             //
         //
         case "cancelRename":
             //
             $this->checkPermission("write");
             $this->fileSystemHandler($cmd);
             break;
             /* ilRepositorySearchGUI */
         /* ilRepositorySearchGUI */
         case "doUserAutoComplete":
             // Search for users auto-complete box
         // Search for users auto-complete box
         case "showSearch":
             //
         //
         case "performSearch":
             //
         //
         case "addUser":
             //
             $this->checkPermission("write");
             $this->repoSearchHandler($cmd);
             break;
             /* Cancel ilRepositorySearchGUI */
         /* Cancel ilRepositorySearchGUI */
         case "cancel":
             // Cancel search for users
             $this->checkPermission("write");
             $this->showSubmissions();
             break;
             /* Fix for edit timings */
         /* Fix for edit timings */
         case "edit":
         case "update":
         case "listConditions":
         case "selector":
         case "add":
         case "assign":
         case "saveObligatorySettings":
         case "askDelete":
         case "delete":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
     }
 }
 /**
  * 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;
 }
예제 #30
0
 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;
 }