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 $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(); } }
/** * Forward to style object */ function forwardToStyleSheet() { global $ilCtrl, $ilTabs; $ilTabs->clearTargets(); $cmd = $ilCtrl->getCmd(); 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"); } }
function executeCommand() { // goto link to portfolio page if ($_GET["gtp"]) { $_GET["user_page"] = $_GET["gtp"]; } $this->setTitleAndDescription(); $next_class = $this->ctrl->getNextClass($this); $cmd = $this->ctrl->getCmd("view"); /* if($_REQUEST["ecal"]) { $cmd = "preview"; $next_class = ""; } */ switch ($next_class) { case "ilworkspaceaccessgui": if ($this->checkPermissionBool("write")) { $this->setTabs(); $this->tabs_gui->activateTab("share"); $this->tpl->setPermanentLink("prtf", $this->object->getId()); include_once './Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php'; $wspacc = new ilWorkspaceAccessGUI($this->object->getId(), $this->access_handler, true, $plink); $this->ctrl->forwardCommand($wspacc); } break; case 'ilportfoliopagegui': if ($this->determinePageCall()) { // only in edit mode $this->addLocator(); include_once "Services/Form/classes/class.ilFileInputGUI.php"; ilFileInputGUI::setPersonalWorkspaceQuotaCheck(true); } $this->handlePageCall($cmd); break; case "ilnotegui": $this->preview(); 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 != "preview") { $this->addLocator(); $this->setTabs(); } $this->{$cmd}(); break; } return true; }
/** * 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); } }
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; }