Ejemplo n.º 1
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;
 }
Ejemplo n.º 2
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;
 }
 public function executeCommand()
 {
     global $ilCtrl, $ilTabs, $ilNavigationHistory, $ilUser, $tpl;
     // Navigation History
     $link = $ilCtrl->getLinkTarget($this, "render");
     if ($this->object != NULL) {
         $ilNavigationHistory->addItem($this->object->getRefId(), $link, "dcl");
     }
     //Direct-Link Resource
     if ($_GET["dcl_gtr"]) {
         $ilCtrl->setCmdClass("ildatacollectionrecordviewgui");
         $_GET['record_id'] = $_GET["dcl_gtr"];
         $ilCtrl->setCmd("renderRecord");
     }
     $next_class = $ilCtrl->getNextClass($this);
     $cmd = $ilCtrl->getCmd();
     if (!$this->getCreationMode() && $next_class != "ilinfoscreengui" && !$this->checkPermissionBool("read")) {
         $tpl->getStandardTemplate();
         $tpl->setContent("Permission Denied.");
         return;
     }
     switch ($next_class) {
         case "ilinfoscreengui":
             $this->prepareOutput();
             $ilTabs->activateTab("id_info");
             $this->infoScreenForward();
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case "ilpermissiongui":
             $this->prepareOutput();
             $ilTabs->activateTab("id_permissions");
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui = new ilPermissionGUI($this);
             $this->ctrl->forwardCommand($perm_gui);
             break;
         case "ilobjectcopygui":
             include_once "./Services/Object/classes/class.ilObjectCopyGUI.php";
             $cp = new ilObjectCopyGUI($this);
             $cp->setType("dcl");
             $tpl->getStandardTemplate();
             $this->ctrl->forwardCommand($cp);
             break;
         case "ildatacollectionfieldlistgui":
             $this->prepareOutput();
             $this->addListFieldsTabs("list_fields");
             $ilTabs->setTabActive("id_fields");
             include_once "./Modules/DataCollection/classes/class.ilDataCollectionFieldListGUI.php";
             $fieldlist_gui = new ilDataCollectionFieldListGUI($this, $this->table_id);
             $this->ctrl->forwardCommand($fieldlist_gui);
             break;
         case "ildatacollectiontableeditgui":
             $this->prepareOutput();
             $ilTabs->setTabActive("id_fields");
             include_once "./Modules/DataCollection/classes/class.ilDataCollectionTableEditGUI.php";
             $tableedit_gui = new ilDataCollectionTableEditGUI($this);
             $this->ctrl->forwardCommand($tableedit_gui);
             break;
         case "ildatacollectionfieldeditgui":
             $this->prepareOutput();
             $ilTabs->activateTab("id_fields");
             include_once "./Modules/DataCollection/classes/class.ilDataCollectionFieldEditGUI.php";
             $fieldedit_gui = new ilDataCollectionFieldEditGUI($this, $this->table_id, $_REQUEST["field_id"]);
             $this->ctrl->forwardCommand($fieldedit_gui);
             break;
         case "ildatacollectionrecordlistgui":
             $this->addHeaderAction(false);
             $this->prepareOutput();
             $ilTabs->activateTab("id_records");
             include_once "./Modules/DataCollection/classes/class.ilDataCollectionRecordListGUI.php";
             $recordlist_gui = new ilDataCollectionRecordListGUI($this, $this->table_id);
             $this->ctrl->forwardCommand($recordlist_gui);
             break;
         case "ildatacollectionrecordeditgui":
             $this->prepareOutput();
             $ilTabs->activateTab("id_records");
             include_once "./Modules/DataCollection/classes/class.ilDataCollectionRecordEditGUI.php";
             $recordedit_gui = new ilDataCollectionRecordEditGUI($this);
             $this->ctrl->forwardCommand($recordedit_gui);
             break;
         case "ildatacollectionrecordviewviewdefinitiongui":
             $this->prepareOutput();
             // page editor will set its own tabs
             $ilTabs->clearTargets();
             $ilTabs->setBackTarget($this->lng->txt("back"), $ilCtrl->getLinkTargetByClass("ildatacollectionfieldlistgui", "listFields"));
             include_once "./Modules/DataCollection/classes/class.ilDataCollectionRecordViewViewdefinitionGUI.php";
             $recordedit_gui = new ilDataCollectionRecordViewViewdefinitionGUI($this->table_id);
             // needed for editor
             $recordedit_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(0, "dcl"));
             if (!$this->checkPermissionBool("write")) {
                 $recordedit_gui->setEnableEditing(false);
             }
             $ret = $this->ctrl->forwardCommand($recordedit_gui);
             if ($ret != "") {
                 $this->tpl->setContent($ret);
             }
             $ilTabs->removeTab('history');
             $ilTabs->removeTab('clipboard');
             // Fixme
             $ilTabs->removeTab('pg');
             break;
         case "ildatacollectionrecordlistviewdefinitiongui":
             $this->prepareOutput();
             $this->addListFieldsTabs("list_viewdefinition");
             $ilTabs->setTabActive("id_fields");
             include_once "./Modules/DataCollection/classes/class.ilDataCollectionRecordListViewdefinitionGUI.php";
             $recordlist_gui = new ilDataCollectionRecordListViewdefinitionGUI($this, $this->table_id);
             $this->ctrl->forwardCommand($recordlist_gui);
             break;
         case "ilobjfilegui":
             $this->prepareOutput();
             $ilTabs->setTabActive("id_records");
             include_once "./Modules/File/classes/class.ilObjFile.php";
             $file_gui = new ilObjFile($this);
             $this->ctrl->forwardCommand($file_gui);
             break;
         case "ildatacollectionrecordviewgui":
             $this->prepareOutput();
             include_once "./Modules/DataCollection/classes/class.ilDataCollectionRecordViewGUI.php";
             $recordview_gui = new ilDataCollectionRecordViewGUI($this);
             $this->ctrl->forwardCommand($recordview_gui);
             $ilTabs->clearTargets();
             $ilTabs->setBackTarget($this->lng->txt("back"), $ilCtrl->getLinkTargetByClass("ilObjDataCollectionGUI", ""));
             break;
         case "ilratinggui":
             $rgui = new ilRatingGUI();
             $rgui->setObject($_GET['record_id'], "dcl_record", $_GET["field_id"], "dcl_field");
             $rgui->executeCommand();
             $ilCtrl->redirectByClass("ilDataCollectionRecordListGUI", "listRecords");
             break;
         default:
             return parent::executeCommand();
     }
     return true;
 }
 public function executeCommand()
 {
     global $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();
     }
 }
Ejemplo n.º 5
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();
 }
 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.º 7
0
 /**
  * @return bool
  * @throws ilCloudException
  */
 public function executeCommand()
 {
     global $ilCtrl, $ilTabs, $ilNavigationHistory, $lng;
     // Navigation History
     $link = $ilCtrl->getLinkTarget($this, "render");
     try {
         ilCloudConnector::getActiveServices();
     } catch (Exception $e) {
         ilUtil::sendFailure($lng->txt("cld_no_service_active"), true);
         ilObjectGUI::redirectToRefId($this->parent_id);
     }
     if ($this->object != NULL) {
         $ilNavigationHistory->addItem($this->object->getRefId(), $link, "cld");
         try {
             ilCloudConnector::checkServiceActive($this->object->getServiceName());
         } catch (Exception $e) {
             ilUtil::sendFailure($lng->txt("cld_plugin_not_active"), true);
             ilObjectGUI::redirectToRefId($this->parent_id);
         }
         if ($this->object->getAuthComplete() == false && !$_GET["authMode"]) {
             if ($this->checkPermissionBool("write")) {
                 $this->serviceAuth($this->object);
             } else {
                 ilUtil::sendFailure($lng->txt("cld_auth_failed"), true);
                 ilObjectGUI::redirectToRefId($this->parent_id);
             }
         }
         $this->plugin_service = ilCloudConnector::getServiceClass($this->object->getServiceName(), $this->object->getId(), false);
     }
     $next_class = $ilCtrl->getNextClass($this);
     $cmd = $ilCtrl->getCmd($this);
     switch ($cmd) {
         case "editSettings":
             $next_class = "ilcloudpluginsettingsgui";
             break;
         case "afterServiceAuth":
             $this->checkPermission("write");
             $this->{$cmd}();
             return;
         case "render":
             $this->addHeaderAction();
             break;
     }
     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 "ilcloudpluginuploadgui":
             if ($this->checkPermissionBool("upload")) {
                 $upload_gui = ilCloudConnector::getUploadGUIClass($this->plugin_service);
                 $this->ctrl->forwardCommand($upload_gui);
             }
             break;
         case "ilcloudplugincreatefoldergui":
             if ($this->checkPermissionBool("folders_create")) {
                 $folder_gui = ilCloudConnector::getCreateFolderGUIClass($this->plugin_service);
                 $this->ctrl->forwardCommand($folder_gui);
             }
             break;
         case "ilcloudplugindeletegui":
             if ($this->checkPermissionBool("delete_files") || $this->checkPermissionBool("delete_folders")) {
                 $delete_gui = ilCloudConnector::getDeleteGUIClass($this->plugin_service);
                 $this->ctrl->forwardCommand($delete_gui);
             }
             break;
         case "ilcloudpluginsettingsgui":
             $this->prepareOutput();
             if ($this->checkPermissionBool("write")) {
                 $settings_gui = ilCloudConnector::getSettingsGUIClass($this->plugin_service);
                 $settings_gui->setCloudObject($this->object);
                 $this->ctrl->forwardCommand($settings_gui);
             }
             break;
         case "ilcloudpluginactionlistgui":
             $action_list_gui = ilCloudConnector::getActionListGUIClass($this->plugin_service);
             $this->ctrl->forwardCommand($action_list_gui);
             break;
         case "ilcloudpluginitemcreationlistgui":
             $item_creation_gui = ilCloudConnector::getItemCreationListGUIClass($this->plugin_service);
             $this->ctrl->forwardCommand($item_creation_gui);
             break;
         case "ilcloudpluginfiletreegui":
             $file_tree_gui = ilCloudConnector::getFileTreeGUIClass($this->plugin_service, ilCloudFileTree::getFileTreeFromSession());
             $this->ctrl->forwardCommand($file_tree_gui);
             break;
         case "ilcloudpluginheaderactiongui":
             $header_action_gui = ilCloudConnector::getHeaderActionGUIClass($this->plugin_service);
             $this->ctrl->forwardCommand($header_action_gui);
             break;
         case "ilcloudplugininitgui":
             $init_gui = ilCloudConnector::getInitGUIClass($this->plugin_service);
             $this->ctrl->forwardCommand($init_gui);
             break;
         default:
             return parent::executeCommand();
     }
     return true;
 }
 /**
  * executeCommand
  */
 public function executeCommand()
 {
     global $ilCtrl, $ilTabs, $ilNavigationHistory, $tpl, $lng;
     // Navigation History
     $link = $ilCtrl->getLinkTarget($this, $this->getStandardCmd());
     if ($this->object != NULL) {
         $ilNavigationHistory->addItem($this->object->getRefId(), $link, "bibl");
     }
     $next_class = $ilCtrl->getNextClass($this);
     $this->cmd = $ilCtrl->getCmd();
     switch ($next_class) {
         case "ilinfoscreengui":
             $this->prepareOutput();
             $ilTabs->activateTab("id_info");
             $this->infoScreenForward();
             break;
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case "ilpermissiongui":
             $this->prepareOutput();
             $ilTabs->activateTab("id_permissions");
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui = new ilPermissionGUI($this);
             $this->ctrl->forwardCommand($perm_gui);
             break;
         case "ilobjectcopygui":
             include_once "./Services/Object/classes/class.ilObjectCopyGUI.php";
             $cp = new ilObjectCopyGUI($this);
             $cp->setType('bibl');
             $tpl->getStandardTemplate();
             $this->ctrl->forwardCommand($cp);
             break;
         case "ilobjfilegui":
             $this->prepareOutput();
             $ilTabs->setTabActive("id_records");
             include_once "./Modules/File/classes/class.ilObjFile.php";
             $file_gui = new ilObjFile($this);
             $this->ctrl->forwardCommand($file_gui);
             break;
         case "ilexportgui":
             $this->prepareOutput();
             $ilTabs->setTabActive("export");
             $exp_gui = new ilExportGUI($this);
             $exp_gui->addFormat("xml");
             $this->ctrl->forwardCommand($exp_gui);
             break;
         default:
             return parent::executeCommand();
     }
     return true;
 }