Ejemplo n.º 1
0
 /**
  * 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;
 }
 /**
  * Download file
  */
 public function download()
 {
     if (isset($_GET['file']) && $_GET['file']) {
         $_POST['file'] = array($_GET['file']);
     }
     parent::download();
 }
 function executeCommand()
 {
     global $tpl, $ilTabs;
     $next_class = $this->ctrl->getNextClass($this);
     switch ($next_class) {
         case 'ilpermissiongui':
             $this->prepareOutput();
             $ilTabs->activateTab("id_permissions");
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui =& new ilPermissionGUI($this);
             $ret =& $this->ctrl->forwardCommand($perm_gui);
             break;
         case "ilexternalfeedblockgui":
             $this->prepareOutput();
             $ilTabs->activateTab("id_settings");
             include_once "./Services/Block/classes/class.ilExternalFeedBlockGUI.php";
             $fb_gui =& new ilExternalFeedBlockGUI();
             $fb_gui->setGuiObject($this);
             if (is_object($this->object)) {
                 $fb_gui->setRefId($this->object->getRefId());
             }
             $ret =& $this->ctrl->forwardCommand($fb_gui);
             $tpl->setContent($ret);
             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 = $this->ctrl->forwardCommand($exp_gui);
             //				$this->tpl->show();
             break;
         default:
             $cmd = $this->ctrl->getCmd("view");
             if ($cmd != "create") {
                 $this->prepareOutput();
             }
             $cmd .= "Object";
             $this->{$cmd}();
             break;
     }
     return true;
 }
Ejemplo n.º 4
0
 function &executeCommand()
 {
     global $rbacsystem;
     $this->prepareOutput();
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     switch ($next_class) {
         case 'ilrepositorysearchgui':
             include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
             $rep_search =& new ilRepositorySearchGUI();
             $rep_search->setTitle($this->lng->txt('role_add_user'));
             $rep_search->setCallback($this, 'addUserObject');
             // Set tabs
             $this->tabs_gui->setTabActive('user_assignment');
             $this->ctrl->setReturn($this, 'userassignment');
             $ret =& $this->ctrl->forwardCommand($rep_search);
             break;
         case 'ilexportgui':
             $this->tabs_gui->setTabActive('export');
             include_once './Services/Export/classes/class.ilExportOptions.php';
             $eo = ilExportOptions::newInstance(ilExportOptions::allocateExportId());
             $eo->addOption(ilExportOptions::KEY_ROOT, 0, $this->object->getId(), $this->obj_ref_id);
             include_once './Services/Export/classes/class.ilExportGUI.php';
             $exp = new ilExportGUI($this, new ilObjRole($this->object->getId()));
             $exp->addFormat('xml');
             $this->ctrl->forwardCommand($exp);
             break;
         default:
             if (!$cmd) {
                 if ($this->showDefaultPermissionSettings()) {
                     $cmd = "perm";
                 } else {
                     $cmd = 'userassignment';
                 }
             }
             $cmd .= "Object";
             $this->{$cmd}();
             break;
     }
     return true;
 }
Ejemplo n.º 5
0
 /**
  * @param ilObjOrgUnitGUI $a_parent_gui
  * @param null            $a_main_obj
  */
 function __construct(ilObjOrgUnitGUI $a_parent_gui, $a_main_obj = null)
 {
     global $ilToolbar, $lng, $ilCtrl;
     parent::__construct($a_parent_gui, $a_main_obj);
     $this->toolbar = $ilToolbar;
     $this->lng = $lng;
     $this->ctrl = $ilCtrl;
     $this->ilObjOrgUnit = $a_parent_gui->object;
     if ($this->ilObjOrgUnit->getRefId() == ilObjOrgUnit::getRootOrgRefId()) {
         //Simple XML and Simple XLS Export should only be available in the root orgunit folder as it always exports the whole tree
         $this->extendExportGUI();
     }
 }
Ejemplo n.º 6
0
 public function __construct($a_parent_gui, $a_main_obj = null)
 {
     global $ilPluginAdmin;
     parent::__construct($a_parent_gui, $a_main_obj);
     $this->addFormat('xml', $a_parent_gui->lng->txt('ass_create_export_file'), $this, 'createTestExport');
     $this->addFormat('csv', $a_parent_gui->lng->txt('ass_create_export_test_results'), $this, 'createTestResultsExport');
     $this->addFormat('arc', $a_parent_gui->lng->txt('ass_create_export_test_archive'), $this, 'createTestArchiveExport');
     $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_MODULE, 'Test', 'texp');
     foreach ($pl_names as $pl) {
         /**
          * @var $plugin ilTestExportPlugin
          */
         $plugin = ilPluginAdmin::getPluginObject(IL_COMP_MODULE, 'Test', 'texp', $pl);
         $plugin->setTest($this->obj);
         $this->addFormat($plugin->getFormat(), $plugin->getFormatLabel(), $plugin, 'export');
     }
 }
 /**
  * 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 $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"])) {
         $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 "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());
             $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 "ilexportgui":
             include_once "./Services/Export/classes/class.ilExportGUI.php";
             $exp_gui = new ilExportGUI($this);
             $exp_gui->addFormat("zip", $this->lng->txt('qpl_export_xml'), $this, "createExportQTI");
             $exp_gui->addFormat("xls", $this->lng->txt('qpl_export_excel'), $this, "createExportExcel");
             //			$exp_gui->addCustomColumn($lng->txt("cont_public_access"), $this, "getPublicAccessColValue");
             //			$exp_gui->addCustomMultiCommand($lng->txt("cont_public_access"), $this, "publishExportFile");
             $ret = $this->ctrl->forwardCommand($exp_gui);
             break;
         case "ilinfoscreengui":
             $this->infoScreenForward();
             break;
         case 'ilassquestionhintsgui':
             // set return target
             $this->ctrl->setReturn($this, "questions");
             // set context tabs
             require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
             $questionGUI = assQuestionGUI::_getQuestionGUI($q_type, $_GET['q_id']);
             $questionGUI->object->setObjId($this->object->getId());
             $questionGUI->setQuestionTabs();
             // forward to ilAssQuestionHintsGUI
             require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsGUI.php';
             $gui = new ilAssQuestionHintsGUI($questionGUI);
             $ilCtrl->forwardCommand($gui);
             break;
         case '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();
             // 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();
             $ret = $this->ctrl->forwardCommand($q_gui);
             break;
     }
     if (strtolower($_GET["baseClass"]) != "iladministrationgui" && $this->getCreationMode() != true) {
         $this->tpl->show();
     }
 }
Ejemplo n.º 8
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;
 }
 /**
  * @return bool
  * @throws ilCtrlException
  */
 public function executeCommand()
 {
     global $ilCtrl, $ilTabs, $ilNavigationHistory, $ilUser, $tpl;
     /**
      * @var $ilCtrl ilCtrl
      */
     // Navigation History
     $link = $ilCtrl->getLinkTarget($this, "render");
     if ($this->object != NULL) {
         $ilNavigationHistory->addItem($this->object->getRefId(), $link, "dcl");
     }
     // Direct-Link Resource, redirect to viewgui
     if ($_GET[self::GET_DCL_GTR]) {
         $ilCtrl->setParameterByClass('ildatacollectionrecordviewgui', 'record_id', $_GET[self::GET_DCL_GTR]);
         $ilCtrl->redirectByClass('ildatacollectionrecordviewgui', 'renderRecord');
     }
     $next_class = $ilCtrl->getNextClass($this);
     if (!$this->getCreationMode() and $next_class != "ilinfoscreengui" and !$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":
             require_once './Services/Object/classes/class.ilCommonActionDispatcherGUI.php';
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $gui->enableCommentsSettings(false);
             $this->ctrl->forwardCommand($gui);
             break;
         case "ilpermissiongui":
             $this->prepareOutput();
             $ilTabs->activateTab("id_permissions");
             require_once './Services/AccessControl/classes/class.ilPermissionGUI.php';
             $perm_gui = new ilPermissionGUI($this);
             $this->ctrl->forwardCommand($perm_gui);
             break;
         case "ilobjectcopygui":
             require_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");
             require_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");
             require_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");
             require_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");
             require_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");
             require_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"));
             require_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");
             require_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");
             require_once './Modules/File/classes/class.ilObjFile.php';
             $file_gui = new ilObjFile($this);
             $this->ctrl->forwardCommand($file_gui);
             break;
         case "ildatacollectionrecordviewgui":
             $this->prepareOutput();
             require_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;
         case 'ilnotegui':
             $this->prepareOutput();
             require_once './Modules/DataCollection/classes/class.ilDataCollectionRecordViewGUI.php';
             // Forward the command to recordViewGUI
             $recordviewGui = new ilDataCollectionRecordViewGUI($this);
             $this->ctrl->forwardCommand($recordviewGui);
             $ilTabs->clearTargets();
             $ilTabs->setBackTarget($this->lng->txt("back"), $ilCtrl->getLinkTargetByClass("ilObjDataCollectionGUI", ""));
             break;
         case "ilexportgui":
             $this->prepareOutput();
             $ilTabs->setTabActive("export");
             //				$this->setLocator();
             $exp_gui = new ilExportGUI($this);
             $exp_gui->addFormat("xml");
             $this->ctrl->forwardCommand($exp_gui);
             break;
         default:
             return parent::executeCommand();
     }
     return true;
 }
 public function executeCommand()
 {
     global $ilNavigationHistory;
     $this->tpl->getStandardTemplate();
     // add entry to navigation history
     if (!$this->getCreationMode() && $this->getAccessHandler()->checkAccess("read", "", $this->node_id)) {
         $link = $this->ctrl->getLinkTarget($this, "view");
         $ilNavigationHistory->addItem($this->node_id, $link, "prtt");
     }
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd("view");
     switch ($next_class) {
         case 'ilportfoliotemplatepagegui':
             $this->determinePageCall();
             // has to be done before locator!
             $this->prepareOutput();
             $this->handlePageCall($cmd);
             break;
         case "ilnotegui":
             $this->preview();
             break;
         case "ilinfoscreengui":
             $this->prepareOutput();
             $this->infoScreenForward();
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case "ilpermissiongui":
             $this->prepareOutput();
             $this->tabs_gui->activateTab("id_permissions");
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui = new ilPermissionGUI($this);
             $this->ctrl->forwardCommand($perm_gui);
             break;
         case "ilobjectcopygui":
             include_once "./Services/Object/classes/class.ilObjectCopyGUI.php";
             $cp = new ilObjectCopyGUI($this);
             $cp->setType("prtt");
             $this->ctrl->forwardCommand($cmd);
             break;
         case 'ilexportgui':
             $this->prepareOutput();
             $this->tabs_gui->activateTab("export");
             include_once "./Services/Export/classes/class.ilExportGUI.php";
             $exp_gui = new ilExportGUI($this);
             $exp_gui->addFormat("xml");
             $this->ctrl->forwardCommand($exp_gui);
             break;
         case "ilobjstylesheetgui":
             include_once "./Services/Style/classes/class.ilObjStyleSheetGUI.php";
             $this->ctrl->setReturn($this, "editStyleProperties");
             $style_gui = new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
             $style_gui->omitLocator();
             if ($cmd == "create" || $_GET["new_type"] == "sty") {
                 $style_gui->setCreationMode(true);
             }
             if ($cmd == "confirmedDelete") {
                 $this->object->setStyleSheetId(0);
                 $this->object->update();
             }
             $ret = $this->ctrl->forwardCommand($style_gui);
             if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle") {
                 $style_id = $ret;
                 $this->object->setStyleSheetId($style_id);
                 $this->object->update();
                 $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
             }
             break;
         default:
             $this->addHeaderAction($cmd);
             return ilObject2GUI::executeCommand();
     }
 }
 /**
  * execute command
  */
 function executeCommand()
 {
     global $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();
 }
Ejemplo n.º 12
0
 function executeCommand()
 {
     global $ilUser, $ilCtrl, $tpl, $ilTabs, $ilAccess;
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     $this->prepareOutput();
     // see ilWikiPageGUI::printViewOrderList()
     // printView() and pdfExport() cannot be in ilWikiPageGUI because of stylesheet confusion
     if ($cmd == "printView" || $cmd == "pdfExport") {
         $next_class = null;
     }
     switch ($next_class) {
         case "ilinfoscreengui":
             $this->checkPermission("visible");
             $this->addHeaderAction();
             $this->infoScreen();
             // forwards command
             break;
         case 'ilpermissiongui':
             $this->addHeaderAction();
             $ilTabs->activateTab("perm_settings");
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui =& new ilPermissionGUI($this);
             $ret =& $this->ctrl->forwardCommand($perm_gui);
             break;
         case 'ilwikipagegui':
             $this->checkPermission("read");
             include_once "./Modules/Wiki/classes/class.ilWikiPageGUI.php";
             $wpage_gui = ilWikiPageGUI::getGUIForTitle($this->object->getId(), ilWikiUtil::makeDbTitle($_GET["page"]), $_GET["old_nr"], $this->object->getRefId());
             include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
             $wpage_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId($this->object->getStyleSheetId(), "wiki"));
             $this->setContentStyleSheet();
             if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()) && (!$ilAccess->checkAccess("edit_content", "", $this->object->getRefId()) || $wpage_gui->getPageObject()->getBlocked())) {
                 $wpage_gui->setEnableEditing(false);
             }
             // alter title and description
             //				$tpl->setTitle($wpage_gui->getPageObject()->getTitle());
             //				$tpl->setDescription($this->object->getTitle());
             $ret = $this->ctrl->forwardCommand($wpage_gui);
             if ($ret != "") {
                 $tpl->setContent($ret);
             }
             break;
         case 'ilpublicuserprofilegui':
             require_once './Services/User/classes/class.ilPublicUserProfileGUI.php';
             $profile_gui = new ilPublicUserProfileGUI($_GET["user"]);
             $ret = $this->ctrl->forwardCommand($profile_gui);
             $tpl->setContent($ret);
             break;
         case "ilobjstylesheetgui":
             include_once "./Services/Style/classes/class.ilObjStyleSheetGUI.php";
             $this->ctrl->setReturn($this, "editStyleProperties");
             $style_gui = new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
             $style_gui->omitLocator();
             if ($cmd == "create" || $_GET["new_type"] == "sty") {
                 $style_gui->setCreationMode(true);
             }
             if ($cmd == "confirmedDelete") {
                 $this->object->setStyleSheetId(0);
                 $this->object->update();
             }
             $ret = $this->ctrl->forwardCommand($style_gui);
             if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle") {
                 $style_id = $ret;
                 $this->object->setStyleSheetId($style_id);
                 $this->object->update();
                 $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
             }
             break;
         case "ilexportgui":
             //				$this->prepareOutput();
             $this->addHeaderAction();
             $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;
         case "ilratinggui":
             // for rating category editing
             $this->checkPermission("write");
             $this->addHeaderAction();
             $ilTabs->activateTab("settings");
             $this->setSettingsSubTabs("rating_categories");
             include_once "Services/Rating/classes/class.ilRatingGUI.php";
             $gui = new ilRatingGUI();
             $gui->setObject($this->object->getId(), $this->object->getType());
             $gui->setExportCallback(array($this, "getSubObjectTitle"), $this->lng->txt("page"));
             $this->ctrl->forwardCommand($gui);
             break;
         case "ilwikistatgui":
             $this->checkPermission("statistics_read");
             $this->addHeaderAction();
             $ilTabs->activateTab("statistics");
             include_once "Modules/Wiki/classes/class.ilWikiStatGUI.php";
             $gui = new ilWikiStatGUI($this->object->getId());
             $this->ctrl->forwardCommand($gui);
             break;
         case "ilwikipagetemplategui":
             $this->addHeaderAction();
             $ilTabs->activateTab("settings");
             $this->setSettingsSubTabs("page_templates");
             include_once "./Modules/Wiki/classes/class.ilWikiPageTemplateGUI.php";
             $wptgui = new ilWikiPageTemplateGUI($this);
             $this->ctrl->forwardCommand($wptgui);
             break;
         default:
             $this->addHeaderAction();
             if (!$cmd) {
                 $cmd = "infoScreen";
             }
             $cmd .= "Object";
             if ($cmd != "infoScreenObject") {
                 $this->checkPermission("read");
             } else {
                 $this->checkPermission("visible");
             }
             $this->{$cmd}();
             break;
     }
     return $ret;
 }
 function &executeCommand()
 {
     global $ilUser, $rbacsystem, $ilAccess, $ilNavigationHistory, $ilErr, $ilCtrl;
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     $this->prepareOutput();
     // add entry to navigation history
     if (!$this->getCreationMode() && $ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
         $ilNavigationHistory->addItem($_GET["ref_id"], $ilCtrl->getLinkTargetByClass("ilrepositorygui", "frameset"), "grp");
     }
     switch ($next_class) {
         case 'ilgroupregistrationgui':
             $this->ctrl->setReturn($this, '');
             $this->tabs_gui->setTabActive('join');
             include_once './Modules/Group/classes/class.ilGroupRegistrationGUI.php';
             $registration = new ilGroupRegistrationGUI($this->object);
             $this->ctrl->forwardCommand($registration);
             break;
         case 'ilpermissiongui':
             $this->tabs_gui->setTabActive('perm_settings');
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui =& new ilPermissionGUI($this);
             $ret =& $this->ctrl->forwardCommand($perm_gui);
             break;
         case 'ilrepositorysearchgui':
             include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
             $rep_search =& new ilRepositorySearchGUI();
             $rep_search->setCallback($this, 'addUserObject', array(ilObjGroup::GRP_MEMBER => $this->lng->txt('il_grp_member'), ilObjGroup::GRP_ADMIN => $this->lng->txt('il_grp_admin')));
             // Set tabs
             $this->tabs_gui->setTabActive('members');
             $this->ctrl->setReturn($this, 'members');
             $ret =& $this->ctrl->forwardCommand($rep_search);
             $this->setSubTabs('members');
             $this->tabs_gui->setSubTabActive('members');
             break;
         case "ilinfoscreengui":
             $ret =& $this->infoScreen();
             break;
         case "illearningprogressgui":
             include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
             $new_gui =& new ilLearningProgressGUI(LP_MODE_REPOSITORY, $this->object->getRefId(), $_GET['user_id'] ? $_GET['user_id'] : $ilUser->getId());
             $this->ctrl->forwardCommand($new_gui);
             $this->tabs_gui->setTabActive('learning_progress');
             break;
         case 'ilobjcoursegroupinggui':
             $this->setSubTabs('settings');
             include_once './Modules/Course/classes/class.ilObjCourseGroupingGUI.php';
             $this->ctrl->setReturn($this, 'edit');
             $crs_grp_gui =& new ilObjCourseGroupingGUI($this->object, (int) $_GET['obj_id']);
             $this->ctrl->forwardCommand($crs_grp_gui);
             $this->tabs_gui->setTabActive('settings');
             $this->tabs_gui->setSubTabActive('groupings');
             break;
         case 'ilcoursecontentgui':
             include_once './Modules/Course/classes/class.ilCourseContentGUI.php';
             $course_content_obj = new ilCourseContentGUI($this);
             $this->ctrl->forwardCommand($course_content_obj);
             break;
         case 'ilpublicuserprofilegui':
             require_once './Services/User/classes/class.ilPublicUserProfileGUI.php';
             $this->setSubTabs('members');
             $this->tabs_gui->setTabActive('group_members');
             $this->tabs_gui->setSubTabActive('grp_members_gallery');
             $profile_gui = new ilPublicUserProfileGUI($_GET["user"]);
             $profile_gui->setBackUrl($ilCtrl->getLinkTarget($this, "membersGallery"));
             $html = $this->ctrl->forwardCommand($profile_gui);
             $this->tpl->setVariable("ADM_CONTENT", $html);
             break;
         case "ilcolumngui":
             $this->tabs_gui->setTabActive('none');
             $this->checkPermission("read");
             include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
             $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId()));
             $this->renderObject();
             break;
             // container page editing
         // container page editing
         case "ilpageobjectgui":
             $ret = $this->forwardToPageObject();
             if ($ret != "") {
                 $this->tpl->setContent($ret);
             }
             break;
         case 'ilobjectcopygui':
             include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
             $cp = new ilObjectCopyGUI($this);
             $cp->setType('grp');
             $this->ctrl->forwardCommand($cp);
             break;
         case "ilobjstylesheetgui":
             $this->forwardToStyleSheet();
             break;
         case 'ilobjectcustomuserfieldsgui':
             include_once './Services/Membership/classes/class.ilObjectCustomUserFieldsGUI.php';
             $cdf_gui = new ilObjectCustomUserFieldsGUI($this->object->getId());
             $this->setSubTabs('settings');
             $this->tabs_gui->setTabActive('settings');
             $this->ctrl->forwardCommand($cdf_gui);
             break;
         case 'ilmemberagreementgui':
             include_once 'Services/Membership/classes/class.ilMemberAgreementGUI.php';
             $this->ctrl->setReturn($this, '');
             $this->tabs_gui->setTabActive('view_content');
             $agreement = new ilMemberAgreementGUI($this->object->getRefId());
             $this->ctrl->forwardCommand($agreement);
             break;
         case 'ilexportgui':
             $this->tabs_gui->setTabActive('export');
             include_once './Services/Export/classes/class.ilExportGUI.php';
             $exp = new ilExportGUI($this);
             $exp->addFormat('xml');
             $this->ctrl->forwardCommand($exp);
             break;
         case 'ilmemberexportgui':
             include_once './Services/Membership/classes/Export/class.ilMemberExportGUI.php';
             $this->setSubTabs('members');
             $this->tabs_gui->setTabActive('members');
             $this->tabs_gui->setSubTabActive('export_members');
             $export = new ilMemberExportGUI($this->object->getRefId());
             $this->ctrl->forwardCommand($export);
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case 'ilobjectservicesettingsgui':
             $this->ctrl->setReturn($this, 'edit');
             $this->setSubTabs("settings");
             $this->tabs_gui->activateTab('settings');
             $this->tabs_gui->activateSubTab('tool_settings');
             include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
             $service = new ilObjectServiceSettingsGUI($this, $this->object->getId(), array(ilObjectServiceSettingsGUI::CALENDAR_VISIBILITY));
             $this->ctrl->forwardCommand($service);
             break;
         case 'ilsessionoverviewgui':
             $this->setSubTabs('members');
             $this->tabs_gui->setTabActive('members');
             $this->tabs_gui->setSubTabActive('events');
             include_once './Modules/Group/classes/class.ilGroupParticipants.php';
             $prt = ilGroupParticipants::_getInstanceByObjId($this->object->getId());
             include_once './Modules/Session/classes/class.ilSessionOverviewGUI.php';
             $overview = new ilSessionOverviewGUI($this->object->getRefId(), $prt);
             $this->ctrl->forwardCommand($overview);
             break;
         default:
             // check visible permission
             if (!$this->getCreationMode() and !$ilAccess->checkAccess('visible', '', $this->object->getRefId(), 'grp')) {
                 $ilErr->raiseError($this->lng->txt("msg_no_perm_read"), $ilErr->MESSAGE);
             }
             // #9401 - see also ilStartupGUI::_checkGoto()
             if ($cmd == 'infoScreenGoto') {
                 if ($this->object->isRegistrationEnabled()) {
                     $cmd = 'join';
                 } else {
                     $cmd = 'infoScreen';
                 }
             }
             // check read permission
             if (!$this->getCreationMode() && !$rbacsystem->checkAccess('read', $this->object->getRefId()) && $cmd != 'infoScreen' || $cmd == 'join') {
                 // no join permission -> redirect to info screen
                 if (!$rbacsystem->checkAccess('join', $this->object->getRefId())) {
                     $this->ctrl->redirect($this, "infoScreen");
                 } else {
                     include_once './Modules/Group/classes/class.ilGroupRegistrationGUI.php';
                     $this->ctrl->redirectByClass("ilGroupRegistrationGUI", "show");
                 }
             }
             if (!$cmd) {
                 $cmd = 'view';
             }
             $cmd .= 'Object';
             $this->{$cmd}();
             break;
     }
     $this->addHeaderAction();
 }
Ejemplo n.º 14
0
 function executeCommand()
 {
     global $rbacsystem, $ilUser, $ilAccess, $ilErr, $ilTabs, $ilNavigationHistory, $ilCtrl;
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     $this->prepareOutput();
     // show repository tree
     $this->showRepTree(true);
     // add entry to navigation history
     if (!$this->getCreationMode() && $ilAccess->checkAccess('read', '', $_GET['ref_id'])) {
         $link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "frameset");
         $ilNavigationHistory->addItem($_GET['ref_id'], $link, 'crs');
     }
     if (!$this->getCreationMode()) {
         if (IS_PAYMENT_ENABLED) {
             include_once 'Services/Payment/classes/class.ilPaymentObject.php';
             if (ilPaymentObject::_requiresPurchaseToAccess($this->object->getRefId(), $type = isset($_GET['purchasetype']) ? $_GET['purchasetype'] : NULL)) {
                 $ilTabs->setTabActive('info_short');
                 include_once 'Services/Payment/classes/class.ilShopPurchaseGUI.php';
                 $this->ctrl->setReturn($this, '');
                 $pp_gui = new ilShopPurchaseGUI($this->object->getRefId());
                 $this->ctrl->forwardCommand($pp_gui);
                 return true;
             }
         }
     }
     switch ($next_class) {
         case "ilinfoscreengui":
             $this->infoScreen();
             // forwards command
             break;
         case 'ilmdeditorgui':
             if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
                 $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
             }
             include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';
             $md_gui =& new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType());
             $md_gui->addObserver($this->object, 'MDUpdateListener', 'General');
             $this->ctrl->forwardCommand($md_gui);
             $this->tabs_gui->setTabActive('meta_data');
             break;
         case 'ilcourseregistrationgui':
             $this->ctrl->setReturn($this, 'infoScreen');
             $this->tabs_gui->setTabActive('join');
             include_once './Modules/Course/classes/class.ilCourseRegistrationGUI.php';
             $registration = new ilCourseRegistrationGUI($this->object);
             $this->ctrl->forwardCommand($registration);
             break;
         case 'ilobjectcustomuserfieldsgui':
             include_once './Services/Membership/classes/class.ilObjectCustomUserFieldsGUI.php';
             if (isset($_REQUEST['member_id'])) {
                 $this->ctrl->setReturn($this, 'members');
             }
             $cdf_gui = new ilObjectCustomUserFieldsGUI($this->object->getId());
             $this->setSubTabs('properties');
             $this->tabs_gui->setTabActive('settings');
             $this->ctrl->forwardCommand($cdf_gui);
             break;
         case "ilcourseobjectivesgui":
             include_once './Modules/Course/classes/class.ilCourseObjectivesGUI.php';
             $this->ctrl->setReturn($this, "");
             $reg_gui =& new ilCourseObjectivesGUI($this->object->getRefId());
             $ret =& $this->ctrl->forwardCommand($reg_gui);
             break;
         case 'ilobjcoursegroupinggui':
             include_once './Modules/Course/classes/class.ilObjCourseGroupingGUI.php';
             $this->ctrl->setReturn($this, 'edit');
             $this->setSubTabs('properties');
             $crs_grp_gui =& new ilObjCourseGroupingGUI($this->object, (int) $_GET['obj_id']);
             $this->ctrl->forwardCommand($crs_grp_gui);
             $this->tabs_gui->setTabActive('settings');
             $this->tabs_gui->setSubTabActive('groupings');
             break;
         case "ilcolumngui":
             $this->tabs_gui->setTabActive('none');
             $this->checkPermission("read");
             //$this->prepareOutput();
             //include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
             //$this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
             //	ilObjStyleSheet::getContentStylePath(0));
             //$this->renderObject();
             $this->viewObject();
             break;
         case "ilconditionhandlergui":
             include_once './Services/AccessControl/classes/class.ilConditionHandlerGUI.php';
             // preconditions for whole course
             $this->setSubTabs("properties");
             $this->tabs_gui->setTabActive('settings');
             $new_gui =& new ilConditionHandlerGUI($this);
             $this->ctrl->forwardCommand($new_gui);
             break;
         case "illearningprogressgui":
             include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
             $new_gui =& new ilLearningProgressGUI(ilLearningProgressGUI::LP_CONTEXT_REPOSITORY, $this->object->getRefId(), $_GET['user_id'] ? $_GET['user_id'] : $ilUser->getId());
             $this->ctrl->forwardCommand($new_gui);
             $this->tabs_gui->setTabActive('learning_progress');
             break;
         case 'illicenseoverviewgui':
             include_once "./Services/License/classes/class.ilLicenseOverviewGUI.php";
             $license_gui =& new ilLicenseOverviewGUI($this, ilLicenseOverviewGUI::LIC_MODE_REPOSITORY);
             $ret =& $this->ctrl->forwardCommand($license_gui);
             $this->tabs_gui->setTabActive('licenses');
             break;
         case 'ilpermissiongui':
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $this->tabs_gui->setTabActive('perm_settings');
             $perm_gui =& new ilPermissionGUI($this);
             $ret =& $this->ctrl->forwardCommand($perm_gui);
             break;
         case 'ilrepositorysearchgui':
             include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
             $rep_search =& new ilRepositorySearchGUI();
             if (ilCourseParticipant::_getInstanceByObjId($this->object->getId(), $GLOBALS['ilUser']->getId())->isAdmin() or $this->checkPermissionBool('edit_permission')) {
                 $rep_search->setCallback($this, 'assignMembersObject', $this->getLocalRoles());
             } else {
                 $rep_search->setCallback($this, 'assignMembersObject', array(ilCourseConstants::CRS_MEMBER => $this->lng->txt('crs_member'), ilCourseConstants::CRS_TUTOR => $this->lng->txt('crs_tutor')));
             }
             $this->checkLicenses();
             // Set tabs
             $this->ctrl->setReturn($this, 'members');
             $ret =& $this->ctrl->forwardCommand($rep_search);
             $this->setSubTabs('members');
             $this->tabs_gui->setTabActive('members');
             $this->tabs_gui->setSubTabActive('crs_member_administration');
             break;
         case 'ilcoursecontentinterface':
             $this->initCourseContentInterface();
             $this->cci_obj->cci_setContainer($this);
             $this->ctrl->forwardCommand($this->cci_obj);
             $this->setSubTabs('content');
             $this->tabs_gui->setTabActive('content');
             break;
         case 'ilcoursecontentgui':
             $this->ctrl->setReturn($this, 'members');
             include_once './Modules/Course/classes/class.ilCourseContentGUI.php';
             $course_content_obj = new ilCourseContentGUI($this);
             $this->ctrl->forwardCommand($course_content_obj);
             break;
         case 'ilpublicuserprofilegui':
             $this->tpl->enableDragDropFileUpload(null);
             require_once './Services/User/classes/class.ilPublicUserProfileGUI.php';
             $profile_gui = new ilPublicUserProfileGUI($_GET["user"]);
             $this->setSubTabs('members');
             $this->tabs_gui->setTabActive('members');
             $profile_gui->setBackUrl($ilCtrl->getLinkTarget($this, "membersGallery"));
             $this->tabs_gui->setSubTabActive('crs_members_gallery');
             $html = $this->ctrl->forwardCommand($profile_gui);
             $this->tpl->setVariable("ADM_CONTENT", $html);
             break;
         case 'ilmemberexportgui':
             include_once './Services/Membership/classes/Export/class.ilMemberExportGUI.php';
             $this->setSubTabs('members');
             $this->tabs_gui->setTabActive('members');
             $this->tabs_gui->setSubTabActive('export_members');
             $export = new ilMemberExportGUI($this->object->getRefId());
             $this->ctrl->forwardCommand($export);
             break;
         case 'ilmemberagreementgui':
             include_once 'Services/Membership/classes/class.ilMemberAgreementGUI.php';
             $this->tabs_gui->clearTargets();
             $this->ctrl->setReturn($this, '');
             $agreement = new ilMemberAgreementGUI($this->object->getRefId());
             $this->ctrl->forwardCommand($agreement);
             break;
         case 'ilsessionoverviewgui':
             $this->setSubTabs('members');
             $this->tabs_gui->setTabActive('members');
             $this->tabs_gui->setSubTabActive('events');
             include_once './Modules/Course/classes/class.ilCourseParticipants.php';
             $prt = ilCourseParticipants::_getInstanceByObjId($this->object->getId());
             include_once './Modules/Session/classes/class.ilSessionOverviewGUI.php';
             $overview = new ilSessionOverviewGUI($this->object->getRefId(), $prt);
             $this->ctrl->forwardCommand($overview);
             break;
             // container page editing
         // container page editing
         case "ilcontainerpagegui":
             $ret = $this->forwardToPageObject();
             if ($ret != "") {
                 $this->tpl->setContent($ret);
             }
             break;
         case "ilcontainerstartobjectspagegui":
             // file downloads, etc. (currently not active)
             include_once "Services/Container/classes/class.ilContainerStartObjectsPageGUI.php";
             $pgui = new ilContainerStartObjectsPageGUI($this->object->getId());
             $ret = $this->ctrl->forwardCommand($pgui);
             if ($ret) {
                 $this->tpl->setContent($ret);
             }
             break;
         case 'ilobjectcopygui':
             include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
             $cp = new ilObjectCopyGUI($this);
             $cp->setType('crs');
             $this->ctrl->forwardCommand($cp);
             break;
         case "ilobjstylesheetgui":
             $this->forwardToStyleSheet();
             break;
         case 'ilcourseparticipantsgroupsgui':
             include_once './Modules/Course/classes/class.ilCourseParticipantsGroupsGUI.php';
             $cmg_gui = new ilCourseParticipantsGroupsGUI($this->object->getRefId());
             $this->setSubTabs('members');
             $this->tabs_gui->setTabActive('members');
             $this->ctrl->forwardCommand($cmg_gui);
             break;
         case 'ilexportgui':
             $this->tabs_gui->setTabActive('export');
             include_once './Services/Export/classes/class.ilExportGUI.php';
             $exp = new ilExportGUI($this);
             $exp->addFormat('xml');
             $this->ctrl->forwardCommand($exp);
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case 'ildidactictemplategui':
             $this->ctrl->setReturn($this, 'edit');
             include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateGUI.php';
             $did = new ilDidacticTemplateGUI($this);
             $this->ctrl->forwardCommand($did);
             break;
         case "ilcertificategui":
             $this->tabs_gui->activateTab("settings");
             $this->setSubTabs("properties");
             include_once "./Services/Certificate/classes/class.ilCertificateGUI.php";
             include_once "./Modules/Course/classes/class.ilCourseCertificateAdapter.php";
             $output_gui = new ilCertificateGUI(new ilCourseCertificateAdapter($this->object));
             $this->ctrl->forwardCommand($output_gui);
             break;
         case 'ilobjectservicesettingsgui':
             $this->ctrl->setReturn($this, 'edit');
             $this->setSubTabs("properties");
             $this->tabs_gui->activateTab('settings');
             $this->tabs_gui->acltivateSubTab('tool_settings');
             include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
             $service = new ilObjectServiceSettingsGUI($this, $this->object->getId(), array(ilObjectServiceSettingsGUI::CALENDAR_VISIBILITY));
             $this->ctrl->forwardCommand($service);
             break;
         case 'illoeditorgui':
             #$this->tabs_gui->clearTargets();
             #$this->tabs_gui->setBackTarget($this->lng->txt('back'),$this->ctrl->getLinkTarget($this,''));
             $this->tabs_gui->activateTab('crs_objectives');
             include_once './Modules/Course/classes/Objectives/class.ilLOEditorGUI.php';
             $editor = new ilLOEditorGUI($this->object);
             $this->ctrl->forwardCommand($editor);
             break;
         case 'ilcontainerstartobjectsgui':
             $this->ctrl->setReturn($this, 'edit');
             $this->tabs_gui->clearTargets();
             $this->tabs_gui->setBackTarget($this->lng->txt("back_to_crs_content"), $this->ctrl->getLinkTarget($this, "edit"));
             $this->tabs_gui->addTab("start", $this->lng->txt("crs_start_objects"), $this->ctrl->getLinkTargetByClass("ilcontainerstartobjectsgui", "listStructure"));
             include_once './Services/Container/classes/class.ilContainerStartObjectsGUI.php';
             $stgui = new ilContainerStartObjectsGUI($this->object);
             $this->ctrl->forwardCommand($stgui);
             break;
         case 'illomembertestresultgui':
             include_once './Modules/Course/classes/Objectives/class.ilLOMemberTestResultGUI.php';
             $GLOBALS['ilCtrl']->setReturn($this, 'members');
             $GLOBALS['ilTabs']->clearTargets();
             $GLOBALS['ilTabs']->setBackTarget($GLOBALS['lng']->txt('back'), $GLOBALS['ilCtrl']->getLinkTarget($this, 'members'));
             $result_view = new ilLOMemberTestResultGUI($this, $this->object, (int) $_REQUEST['uid']);
             $this->ctrl->forwardCommand($result_view);
             break;
         default:
             /*                if(!$this->creation_mode)
                             {
                                 $this->checkPermission('visible');
                             }*/
             /*
             if(!$this->creation_mode and !$ilAccess->checkAccess('visible','',$this->object->getRefId(),'crs'))
             {
                 $ilErr->raiseError($this->lng->txt("msg_no_perm_read"),$ilErr->MESSAGE);
             }
             */
             // #9401 - see also ilStartupGUI::_checkGoto()
             if ($cmd == 'infoScreenGoto') {
                 if (ilObjCourse::_isActivated($this->object->getId()) && ilObjCourse::_registrationEnabled($this->object->getId())) {
                     $cmd = 'join';
                 } else {
                     $cmd = 'infoScreen';
                 }
             }
             if (!$this->creation_mode) {
                 if ($cmd == "infoScreen") {
                     $this->checkPermission("visible");
                 } else {
                     //						$this->checkPermission("read");
                 }
             }
             if (!$this->creation_mode && $cmd != 'infoScreen' && $cmd != 'sendfile' && $cmd != 'unsubscribe' && $cmd != 'performUnsubscribe' && !$ilAccess->checkAccess("read", '', $this->object->getRefId()) || $cmd == 'join' || $cmd == 'subscribe') {
                 include_once './Modules/Course/classes/class.ilCourseParticipants.php';
                 if ($rbacsystem->checkAccess('join', $this->object->getRefId()) && !ilCourseParticipants::_isParticipant($this->object->getRefId(), $ilUser->getId())) {
                     include_once './Modules/Course/classes/class.ilCourseRegistrationGUI.php';
                     $this->ctrl->redirectByClass("ilCourseRegistrationGUI");
                 } else {
                     $this->infoScreenObject();
                     break;
                 }
             }
             if ($cmd == 'listObjectives') {
                 include_once './Modules/Course/classes/class.ilCourseObjectivesGUI.php';
                 $this->ctrl->setReturn($this, "");
                 $obj_gui =& new ilCourseObjectivesGUI($this->object->getRefId());
                 $ret =& $this->ctrl->forwardCommand($obj_gui);
                 break;
             }
             // Dirty hack for course timings view
             if ($this->forwardToTimingsView()) {
                 break;
             }
             if (!$cmd) {
                 $cmd = 'view';
             }
             $cmd .= 'Object';
             $this->{$cmd}();
             break;
     }
     $this->addHeaderAction();
     return true;
 }
Ejemplo n.º 15
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();
 }
 /**
  * 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;
 }
Ejemplo n.º 17
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();
 }
Ejemplo n.º 18
0
 /**
  * execute command
  */
 function &executeCommand()
 {
     global $lng, $ilAccess, $ilTabs, $ilErr;
     $cmd = $this->ctrl->getCmd();
     $next_class = $this->ctrl->getNextClass($this);
     switch ($next_class) {
         case 'ilmdeditorgui':
             $this->checkPermission("write");
             $this->getTemplate();
             $this->setTabs();
             $this->setLocator();
             $this->addHeaderAction();
             include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';
             $md_gui =& new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType());
             $md_gui->addObserver($this->object, 'MDUpdateListener', 'General');
             $this->ctrl->forwardCommand($md_gui);
             break;
         case "ilglossarytermgui":
             $this->getTemplate();
             //				$this->quickList();
             $this->ctrl->setReturn($this, "listTerms");
             $term_gui =& new ilGlossaryTermGUI($this->term_id);
             $term_gui->setGlossary($this->object);
             //$ret =& $term_gui->executeCommand();
             $ret =& $this->ctrl->forwardCommand($term_gui);
             break;
         case "ilinfoscreengui":
             $this->addHeaderAction();
             $this->showInfoScreen();
             break;
         case "ilobjstylesheetgui":
             include_once "./Services/Style/classes/class.ilObjStyleSheetGUI.php";
             $this->ctrl->setReturn($this, "editStyleProperties");
             $style_gui = new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
             $style_gui->omitLocator();
             if ($cmd == "create" || $_GET["new_type"] == "sty") {
                 $style_gui->setCreationMode(true);
             }
             if ($cmd == "confirmedDelete") {
                 $this->object->setStyleSheetId(0);
                 $this->object->update();
             }
             $ret = $this->ctrl->forwardCommand($style_gui);
             if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle") {
                 $style_id = $ret;
                 $this->object->setStyleSheetId($style_id);
                 $this->object->update();
                 $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
             }
             break;
         case 'ilpermissiongui':
             if (strtolower($_GET["baseClass"]) == "iladministrationgui") {
                 $this->prepareOutput();
             } else {
                 $this->getTemplate();
                 $this->setTabs();
                 $this->setLocator();
                 $this->addHeaderAction();
             }
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui =& new ilPermissionGUI($this);
             $ret =& $this->ctrl->forwardCommand($perm_gui);
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case "ilobjtaxonomygui":
             $this->getTemplate();
             $this->setTabs();
             $this->setLocator();
             $this->addHeaderAction();
             $ilTabs->activateTab("settings");
             $this->setSettingsSubTabs("taxonomy");
             include_once "./Services/Taxonomy/classes/class.ilObjTaxonomyGUI.php";
             $this->ctrl->setReturn($this, "properties");
             $tax_gui = new ilObjTaxonomyGUI();
             $tax_gui->setMultiple(false);
             /*include_once("./Modules/Glossary/classes/class.ilTermTaxInfo.php");
             		$term_info = new ilTermTaxInfo();*/
             //$tax_gui->activateAssignedItemSorting($term_info, "glo", "term");
             $tax_gui->setAssignedObject($this->object->getId());
             $ret = $this->ctrl->forwardCommand($tax_gui);
             break;
         case "ilexportgui":
             $this->getTemplate();
             $this->setTabs();
             $ilTabs->activateTab("export");
             $this->setLocator();
             include_once "./Services/Export/classes/class.ilExportGUI.php";
             $exp_gui = new ilExportGUI($this);
             //$exp_gui->addFormat("xml", "", $this, "export");
             $exp_gui->addFormat("xml");
             $exp_gui->addFormat("html", "", $this, "exportHTML");
             $exp_gui->addCustomColumn($lng->txt("cont_public_access"), $this, "getPublicAccessColValue");
             $exp_gui->addCustomMultiCommand($lng->txt("cont_public_access"), $this, "publishExportFile");
             $ret = $this->ctrl->forwardCommand($exp_gui);
             break;
         case 'ilobjectcopygui':
             $this->prepareOutput();
             include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
             $cp = new ilObjectCopyGUI($this);
             $cp->setType('glo');
             $this->ctrl->forwardCommand($cp);
             break;
         default:
             $cmd = $this->ctrl->getCmd("listTerms");
             if ($cmd == "create" && $_POST["new_type"] == "term") {
                 $this->ctrl->setCmd("create");
                 $this->ctrl->setCmdClass("ilGlossaryTermGUI");
                 $ret =& $this->executeCommand();
                 return;
             } else {
                 if (!in_array($cmd, array("frameset", "quickList"))) {
                     if (strtolower($_GET["baseClass"]) == "iladministrationgui" || $this->getCreationMode() == true) {
                         $this->prepareOutput();
                         $cmd .= "Object";
                     } else {
                         $this->getTemplate();
                         $this->setTabs();
                         $this->setLocator();
                         $this->addHeaderAction();
                         if ($cmd == "redrawHeaderAction") {
                             $cmd = "redrawHeaderActionObject";
                         }
                     }
                 }
                 $ret =& $this->{$cmd}();
             }
             break;
     }
     if (!in_array($cmd, array("frameset", "quickList"))) {
         if (strtolower($_GET["baseClass"]) != "iladministrationgui") {
             if (!$this->getCreationMode()) {
                 $this->tpl->show();
             }
         }
     } else {
         $this->tpl->show(false);
     }
 }
 /**
  * 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;
 }
Ejemplo n.º 20
0
 public function executeCommand()
 {
     /**
      * @var $ilNavigationHistory ilNavigationHistory
      * @var $ilAccess ilAccessHandler
      * @var $ilCtrl ilCtrl
      * @var $ilTabs ilTabsGUI
      * @var $ilErr  ilErrorHandling
      * @var $ilUser ilObjUser
      */
     global $ilNavigationHistory, $ilAccess, $ilCtrl, $ilTabs, $ilErr, $ilUser;
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     $exclude_cmds = array('viewThread', 'markPostUnread', 'markPostRead', 'showThreadNotification', 'cancelPostActivation', 'cancelPostDeactivation', 'performPostActivation', 'performPostDeactivation', 'performPostAndChildPostsActivation', 'askForPostActivation', 'askForPostDeactivation', 'toggleThreadNotification', 'toggleThreadNotificationTab', 'toggleStickiness', 'cancelPost', 'savePost', 'quotePost', 'getQuotationHTMLAsynch', 'setTreeStateAsynch', 'fetchTreeChildrenAsync');
     if (!in_array($cmd, $exclude_cmds)) {
         $this->prepareOutput();
     }
     // add entry to navigation history
     if (!$this->getCreationMode() && !$ilCtrl->isAsynch() && $ilAccess->checkAccess('read', '', $_GET['ref_id'])) {
         $ilNavigationHistory->addItem($_GET['ref_id'], 'ilias.php?baseClass=ilRepositoryGUI&amp;cmd=showThreads&amp;ref_id=' . $_GET['ref_id'], 'frm');
     }
     switch ($next_class) {
         case 'ilpermissiongui':
             require_once 'Services/AccessControl/classes/class.ilPermissionGUI.php';
             $perm_gui = new ilPermissionGUI($this);
             $this->ctrl->forwardCommand($perm_gui);
             break;
         case 'ilforumexportgui':
             require_once 'Modules/Forum/classes/class.ilForumExportGUI.php';
             $fex_gui = new ilForumExportGUI($this);
             $this->ctrl->forwardCommand($fex_gui);
             exit;
             break;
         case 'ilforummoderatorsgui':
             require_once 'Modules/Forum/classes/class.ilForumModeratorsGUI.php';
             $fm_gui = new ilForumModeratorsGUI($this);
             $this->ctrl->forwardCommand($fm_gui);
             break;
         case 'ilinfoscreengui':
             $this->infoScreen();
             break;
         case 'ilcolumngui':
             $this->showThreadsObject();
             break;
         case 'ilpublicuserprofilegui':
             include_once 'Services/User/classes/class.ilPublicUserProfileGUI.php';
             $profile_gui = new ilPublicUserProfileGUI((int) $_GET['user']);
             $add = $this->getUserProfileAdditional((int) $_GET['ref_id'], (int) $_GET['user']);
             $profile_gui->setAdditional($add);
             $ret = $this->ctrl->forwardCommand($profile_gui);
             $this->tpl->setContent($ret);
             break;
         case 'ilobjectcopygui':
             include_once 'Services/Object/classes/class.ilObjectCopyGUI.php';
             $cp = new ilObjectCopyGUI($this);
             $cp->setType('frm');
             $this->ctrl->forwardCommand($cp);
             break;
         case 'ilexportgui':
             $ilTabs->setTabActive('export');
             include_once 'Services/Export/classes/class.ilExportGUI.php';
             $exp = new ilExportGUI($this);
             $exp->addFormat('xml');
             $this->ctrl->forwardCommand($exp);
             break;
         case "ilratinggui":
             if (!$this->objProperties->isIsThreadRatingEnabled() || $ilUser->isAnonymous()) {
                 $ilErr->raiseError($this->lng->txt('msg_no_perm_read'), $ilErr->MESSAGE);
             }
             require_once 'Services/Rating/classes/class.ilRatingGUI.php';
             $rating_gui = new ilRatingGUI();
             $rating_gui->setObject($this->object->getId(), $this->object->getType(), $this->objCurrentTopic->getId(), 'thread');
             $ilCtrl->setParameter($this, 'thr_pk', (int) $_GET['thr_pk']);
             $this->ctrl->forwardCommand($rating_gui);
             $avg = ilRating::getOverallRatingForObject($this->object->getId(), $this->object->getType(), (int) $_GET['thr_pk'], 'thread');
             $this->objCurrentTopic->setAverageRating($avg['avg']);
             $this->objCurrentTopic->update();
             $ilCtrl->redirect($this, "showThreads");
             break;
         case 'ilcommonactiondispatchergui':
             include_once 'Services/Object/classes/class.ilCommonActionDispatcherGUI.php';
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         default:
             // alex, 11 Jan 2011:
             // I inserted this workaround due to bug report 6971.
             // In general the command handling is quite obscure here.
             // The form action of the table should be filled
             // with $ilCtrl->getFormAction(..) not with $ilCtrl->getLinkTarget(..)
             // Commands should be determined with $ilCtrl->getCmd() not
             // with accessing $_POST['selected_cmd'], since this is internal
             // of ilTable2GUI/ilCtrl and may change.
             if (isset($_POST['select_cmd2'])) {
                 $_POST['selected_cmd'] = $_POST["selected_cmd2"];
             }
             if (isset($_POST['selected_cmd']) && $_POST['selected_cmd'] != null) {
                 $member_cmd = array('enableAdminForceNoti', 'disableAdminForceNoti', 'enableHideUserToggleNoti', 'disableHideUserToggleNoti');
                 in_array($_POST['selected_cmd'], $member_cmd) ? $cmd = $_POST['selected_cmd'] : ($cmd = 'performThreadsAction');
             } else {
                 if (!$cmd && !$_POST['selected_cmd']) {
                     $cmd = 'showThreads';
                 }
             }
             $cmd .= 'Object';
             $this->{$cmd}();
             break;
     }
     // suppress for topic level
     if ($cmd != 'viewThreadObject' && $cmd != 'showUserObject') {
         $this->addHeaderAction();
     }
 }
 function &executeCommand()
 {
     global $rbacsystem, $ilNavigationHistory, $ilAccess, $ilCtrl, $ilTabs;
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     switch ($next_class) {
         case "ilobjusergui":
             include_once './Services/User/classes/class.ilObjUserGUI.php';
             $this->tabs_gui->setTabActive('administrate_users');
             if (!$_GET['obj_id']) {
                 $this->gui_obj = new ilObjUserGUI("", $_GET['ref_id'], true, false);
                 $this->gui_obj->setCreationMode($this->creation_mode);
                 $ret =& $this->ctrl->forwardCommand($this->gui_obj);
             } else {
                 $this->gui_obj = new ilObjUserGUI("", $_GET['obj_id'], false, false);
                 $this->gui_obj->setCreationMode($this->creation_mode);
                 $ret =& $this->ctrl->forwardCommand($this->gui_obj);
             }
             $ilTabs->clearTargets();
             $ilTabs->setBackTarget($this->lng->txt('backto_lua'), $this->ctrl->getLinkTarget($this, 'listUsers'));
             break;
         case "ilobjuserfoldergui":
             include_once './Services/User/classes/class.ilObjUserFolderGUI.php';
             $this->tabs_gui->setTabActive('administrate_users');
             $this->gui_obj = new ilObjUserFolderGUI("", (int) $_GET['ref_id'], true, false);
             $this->gui_obj->setUserOwnerId((int) $_GET['ref_id']);
             $this->gui_obj->setCreationMode($this->creation_mode);
             $ret =& $this->ctrl->forwardCommand($this->gui_obj);
             break;
         case "ilcolumngui":
             $this->checkPermission("read");
             $this->prepareOutput();
             include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
             $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId()));
             $this->renderObject();
             break;
         case 'ilpermissiongui':
             $this->prepareOutput();
             $this->tabs_gui->setTabActive('perm_settings');
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui =& new ilPermissionGUI($this);
             $ret =& $this->ctrl->forwardCommand($perm_gui);
             break;
         case 'ilinfoscreengui':
             $this->prepareOutput();
             $this->infoScreen();
             break;
         case 'ilcontainerlinklistgui':
             include_once "Services/Container/classes/class.ilContainerLinkListGUI.php";
             $link_list_gui =& new ilContainerLinkListGUI();
             $ret =& $this->ctrl->forwardCommand($link_list_gui);
             break;
             // container page editing
         // container page editing
         case "ilpageobjectgui":
             $this->prepareOutput(false);
             $ret = $this->forwardToPageObject();
             if ($ret != "") {
                 $this->tpl->setContent($ret);
             }
             break;
         case 'ilobjectcopygui':
             $this->prepareOutput();
             include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
             $cp = new ilObjectCopyGUI($this);
             $cp->setType('cat');
             $this->ctrl->forwardCommand($cp);
             break;
         case "ilobjstylesheetgui":
             $this->forwardToStyleSheet();
             break;
         case 'ilusertablegui':
             include_once './Services/User/classes/class.ilUserTableGUI.php';
             $u_table = new ilUserTableGUI($this, "listUsers");
             $u_table->initFilter();
             $this->ctrl->setReturn($this, 'listUsers');
             $this->ctrl->forwardCommand($u_table);
             break;
         case "ilcommonactiondispatchergui":
             $this->prepareOutput();
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case 'ildidactictemplategui':
             $this->ctrl->setReturn($this, 'edit');
             include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateGUI.php';
             $did = new ilDidacticTemplateGUI($this);
             $this->ctrl->forwardCommand($did);
             break;
         case 'ilexportgui':
             $this->prepareOutput();
             $this->tabs_gui->setTabActive('export');
             include_once './Services/Export/classes/class.ilExportGUI.php';
             $exp = new ilExportGUI($this);
             $exp->addFormat('xml');
             $this->ctrl->forwardCommand($exp);
             break;
         default:
             if ($cmd == "infoScreen") {
                 $this->checkPermission("visible");
             } else {
                 $this->checkPermission("read");
             }
             // add entry to navigation history
             if (!$this->getCreationMode() && $ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
                 $ilNavigationHistory->addItem($_GET["ref_id"], $ilCtrl->getLinkTargetByClass("ilrepositorygui", "frameset"), "cat");
             }
             $this->prepareOutput();
             include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
             if (is_object($this->object)) {
                 $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId()));
             }
             if (!$cmd) {
                 $cmd = "render";
             }
             $cmd .= "Object";
             $this->{$cmd}();
             break;
     }
     $this->addHeaderAction();
     return true;
 }
 /**
  * execute command
  */
 function &executeCommand()
 {
     global $ilTabs, $lng, $ilAccess, $tpl, $ilCtrl;
     if ($this->ctrl->getRedirectSource() == "ilinternallinkgui") {
         $this->explorer();
         return;
     }
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     $new_type = $_POST["new_type"] ? $_POST["new_type"] : $_GET["new_type"];
     if ($new_type != "" && ($cmd != "confirmRemove" && $cmd != "copyToClipboard" && $cmd != "pasteFromClipboard")) {
         $this->setCreationMode(true);
     }
     if (!$this->getCreationMode()) {
         $tree =& $this->object->getTree();
         if ($_GET["mepitem_id"] == "") {
             $_GET["mepitem_id"] = $tree->getRootId();
         }
     }
     if ($cmd == "create") {
         switch ($_POST["new_type"]) {
             case "mob":
                 $this->ctrl->redirectByClass("ilobjmediaobjectgui", "create");
                 break;
             case "fold":
                 // todo
                 $this->ctrl->redirectByClass("ilobjfoldergui", "create");
                 break;
         }
     }
     switch ($next_class) {
         case 'ilmediapoolpagegui':
             $this->prepareOutput();
             $this->addHeaderAction();
             $this->setMediaPoolPageTabs();
             include_once "./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php";
             $mep_page_gui = new ilMediaPoolPageGUI($_GET["mepitem_id"], $_GET["old_nr"]);
             if (!$ilAccess->checkAccess("write", "", $this->object->getRefId())) {
                 $mep_page_gui->setEnableEditing(false);
             }
             $ret = $this->ctrl->forwardCommand($mep_page_gui);
             if ($ret != "") {
                 $tpl->setContent($ret);
             }
             $this->tpl->show();
             break;
         case "ilobjmediaobjectgui":
             //$cmd.="Object";
             if ($cmd == "create" || $cmd == "save" || $cmd == "cancel") {
                 $ret_obj = $_GET["mepitem_id"];
                 $ilObjMediaObjectGUI =& new ilObjMediaObjectGUI("", 0, false, false);
                 $ilObjMediaObjectGUI->setWidthPreset($this->object->getDefaultWidth());
                 $ilObjMediaObjectGUI->setHeightPreset($this->object->getDefaultHeight());
             } else {
                 $ret_obj = $tree->getParentId($_GET["mepitem_id"]);
                 $ilObjMediaObjectGUI =& new ilObjMediaObjectGUI("", ilMediaPoolItem::lookupForeignId($_GET["mepitem_id"]), false, false);
                 $this->ctrl->setParameter($this, "mepitem_id", $this->getParentFolderId());
                 $ilTabs->setBackTarget($lng->txt("back"), $this->ctrl->getLinkTarget($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia"));
             }
             if ($this->ctrl->getCmdClass() == "ilinternallinkgui") {
                 $this->ctrl->setReturn($this, "explorer");
             } else {
                 $this->ctrl->setParameter($this, "mepitem_id", $ret_obj);
                 $this->ctrl->setReturn($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
                 $this->ctrl->setParameter($this, "mepitem_id", $_GET["mepitem_id"]);
             }
             $this->getTemplate();
             $ilObjMediaObjectGUI->setTabs();
             $this->setLocator();
             //$ret =& $ilObjMediaObjectGUI->executeCommand();
             $ret = $this->ctrl->forwardCommand($ilObjMediaObjectGUI);
             if ($cmd == "save" && $ret != false) {
                 $mep_item = new ilMediaPoolItem();
                 $mep_item->setTitle($ret->getTitle());
                 $mep_item->setType("mob");
                 $mep_item->setForeignId($ret->getId());
                 $mep_item->create();
                 $parent = $_GET["mepitem_id"] == "" ? $tree->getRootId() : $_GET["mepitem_id"];
                 $tree->insertNode($mep_item->getId(), $parent);
                 ilUtil::redirect("ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=" . $_GET["ref_id"] . "&mepitem_id=" . $_GET["mepitem_id"]);
             } else {
                 $this->tpl->show();
             }
             break;
         case "ilobjfoldergui":
             // todo
             $this->addHeaderAction();
             $folder_gui = new ilObjFolderGUI("", 0, false, false);
             $this->ctrl->setReturn($this, "listMedia");
             $cmd .= "Object";
             switch ($cmd) {
                 case "createObject":
                     $this->prepareOutput();
                     $folder_gui =& new ilObjFolderGUI("", 0, false, false);
                     $folder_gui->setFormAction("save", $this->ctrl->getFormActionByClass("ilobjfoldergui"));
                     $folder_gui->createObject();
                     $this->tpl->show();
                     break;
                 case "saveObject":
                     //$folder_gui->setReturnLocation("save", $this->ctrl->getLinkTarget($this, "listMedia"));
                     $parent = $_GET["mepitem_id"] == "" ? $tree->getRootId() : $_GET["mepitem_id"];
                     $folder_gui->setFolderTree($tree);
                     $folder_gui->saveObject($parent);
                     //$this->ctrl->redirect($this, "listMedia");
                     break;
                 case "editObject":
                     $this->prepareOutput();
                     $folder_gui =& new ilObjFolderGUI("", ilMediaPoolItem::lookupForeignId($_GET["mepitem_id"]), false, false);
                     $this->ctrl->setParameter($this, "foldereditmode", "1");
                     $folder_gui->setFormAction("update", $this->ctrl->getFormActionByClass("ilobjfoldergui"));
                     $folder_gui->editObject();
                     $this->tpl->show();
                     break;
                 case "updateObject":
                     $folder_gui =& new ilObjFolderGUI("", ilMediaPoolItem::lookupForeignId($_GET["mepitem_id"]), false, false);
                     $this->ctrl->setParameter($this, "mepitem_id", $this->getParentFolderId());
                     $this->ctrl->setReturn($this, "listMedia");
                     $folder_gui->updateObject(true);
                     // this returns to parent
                     break;
                 case "cancelObject":
                     if ($_GET["foldereditmode"]) {
                         $this->ctrl->setParameter($this, "mepitem_id", $this->getParentFolderId());
                     }
                     $this->ctrl->redirect($this, "listMedia");
                     break;
             }
             break;
         case "ileditclipboardgui":
             $this->prepareOutput();
             $this->addHeaderAction();
             $this->ctrl->setReturn($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
             $clip_gui = new ilEditClipboardGUI();
             $clip_gui->setMultipleSelections(true);
             $clip_gui->setInsertButtonTitle($lng->txt("mep_copy_to_mep"));
             $ilTabs->setTabActive("clipboard");
             //$ret =& $clip_gui->executeCommand();
             $ret =& $this->ctrl->forwardCommand($clip_gui);
             $this->tpl->show();
             break;
         case 'ilinfoscreengui':
             $this->prepareOutput();
             $this->addHeaderAction();
             $this->infoScreen();
             $this->tpl->show();
             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);
             $this->tpl->show();
             break;
         case "ilexportgui":
             $this->prepareOutput();
             $this->addHeaderAction();
             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 "ilfilesystemgui":
             $this->prepareOutput();
             $this->addHeaderAction();
             $ilTabs->clearTargets();
             $ilTabs->setBackTarget($lng->txt("back"), $ilCtrl->getLinkTarget($this, "listMedia"));
             $mset = new ilSetting("mobs");
             if (trim($mset->get("upload_dir")) != "") {
                 include_once "./Services/FileSystem/classes/class.ilFileSystemGUI.php";
                 $fs_gui = new ilFileSystemGUI($mset->get("upload_dir"));
                 $fs_gui->setPostDirPath(true);
                 $fs_gui->setTableId("mepud" . $this->object->getId());
                 $fs_gui->setAllowFileCreation(false);
                 $fs_gui->setAllowDirectoryCreation(false);
                 $fs_gui->clearCommands();
                 $fs_gui->addCommand($this, "selectUploadDirFiles", $this->lng->txt("mep_sel_upload_dir_files"), false, true);
                 //$fs_gui->addCommand($this, "assignFullscreenObject", $this->lng->txt("cont_assign_full"));
                 $ret =& $this->ctrl->forwardCommand($fs_gui);
             }
             $this->tpl->show();
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         default:
             $this->prepareOutput();
             $this->addHeaderAction();
             $cmd = $this->ctrl->getCmd("frameset");
             $this->{$cmd}();
             if (!$this->getCreationMode()) {
                 $this->tpl->show();
             }
             break;
     }
 }
Ejemplo n.º 23
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;
 }
 public function executeCommand()
 {
     global $ilCtrl, $ilTabs, $ilErr, $ilAccess;
     //if($this->ctrl->getTargetScript() == 'link_resources.php')
     if ($_GET["baseClass"] == 'ilLinkResourceHandlerGUI') {
         $_GET['view_mode'] = isset($_GET['switch_mode']) ? $_GET['switch_mode'] : $_GET['view_mode'];
         $ilCtrl->saveParameter($this, 'view_mode');
         $this->__prepareOutput();
     }
     $this->lng->loadLanguageModule("webr");
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     switch ($next_class) {
         case "ilinfoscreengui":
             $this->infoScreenForward();
             // forwards command
             break;
         case 'ilmdeditorgui':
             if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
                 $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
             }
             $this->prepareOutput();
             $ilTabs->activateTab('id_meta_data');
             include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';
             $md_gui =& new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType());
             $md_gui->addObserver($this->object, 'MDUpdateListener', 'General');
             $this->ctrl->forwardCommand($md_gui);
             break;
         case 'ilpermissiongui':
             $this->prepareOutput();
             $ilTabs->activateTab('id_permissions');
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui =& new ilPermissionGUI($this);
             $ret =& $this->ctrl->forwardCommand($perm_gui);
             break;
         case 'ilobjectcopygui':
             $this->prepareOutput();
             include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
             $cp = new ilObjectCopyGUI($this);
             $cp->setType('webr');
             $this->ctrl->forwardCommand($cp);
             break;
         case 'ilexportgui':
             $this->prepareOutput();
             $this->tabs_gui->setTabActive('export');
             include_once './Services/Export/classes/class.ilExportGUI.php';
             $exp = new ilExportGUI($this);
             $exp->addFormat('xml');
             $this->ctrl->forwardCommand($exp);
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case "ilpropertyformgui":
             include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
             $this->initFormLink(self::LINK_MOD_EDIT);
             $this->ctrl->forwardCommand($this->form);
             break;
         case "ilinternallinkgui":
             $this->lng->loadLanguageModule("content");
             require_once "./Modules/LearningModule/classes/class.ilInternalLinkGUI.php";
             $link_gui = new ilInternalLinkGUI("RepositoryItem", 0);
             $link_gui->filterLinkType("PageObject");
             $link_gui->filterLinkType("GlossaryItem");
             $link_gui->filterLinkType("RepositoryItem");
             $link_gui->setFilterWhiteList(true);
             $link_gui->setMode("asynch");
             $ilCtrl->forwardCommand($link_gui);
             break;
         default:
             if (!$cmd) {
                 $this->ctrl->setCmd("view");
             }
             parent::executeCommand();
     }
     if (!$this->getCreationMode()) {
         // Fill meta header tags
         include_once 'Services/MetaData/classes/class.ilMDUtils.php';
         ilMDUtils::_fillHTMLMetaTags($this->object->getId(), $this->object->getId(), 'webr');
         $this->addHeaderAction();
     }
     return true;
 }
Ejemplo n.º 25
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;
 }
Ejemplo n.º 26
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();
 }