Esempio n. 1
0
 /**
  * execute command
  */
 function &executeCommand()
 {
     global $ilCtrl, $ilTabs, $lng, $ilAccess, $tpl;
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     //$this->ctrl->addTab("clipboard", $this->ctrl->getLinkTargetByClass("ilEditClipboardGUI", "view")
     //	, "view", "ilEditClipboardGUI");
     $this->getTabs();
     $ilCtrl->setReturn($this, "edit");
     //echo "-".$next_class."-";
     switch ($next_class) {
         case 'ilmdeditorgui':
             //$this->setTabs();
             $ilTabs->setTabActive("meta_data");
             include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';
             $md_gui =& new ilMDEditorGUI($this->meta_data_rep_obj_id, $this->meta_data_sub_obj_id, $this->meta_data_type);
             if (is_object($this->meta_data_observer_obj)) {
                 $md_gui->addObserver($this->meta_data_observer_obj, $this->meta_data_observer_func, "General");
             }
             $this->ctrl->forwardCommand($md_gui);
             break;
         case "ileditclipboardgui":
             //$this->tabs_gui->clearTargets();
             //$this->ctrl->setReturn($this, "view");
             $clip_gui = new ilEditClipboardGUI();
             $clip_gui->setPageBackTitle($this->page_back_title);
             //$ret =& $clip_gui->executeCommand();
             $ret =& $this->ctrl->forwardCommand($clip_gui);
             break;
             // notes
         // notes
         case "ilnotegui":
             switch ($_GET["notes_mode"]) {
                 default:
                     $html = $this->edit();
                     $ilTabs->setTabActive("edit");
                     return $html;
             }
             break;
         case 'ilpublicuserprofilegui':
             require_once './Services/User/classes/class.ilPublicUserProfileGUI.php';
             $profile_gui = new ilPublicUserProfileGUI($_GET["user"]);
             $ret = $this->ctrl->forwardCommand($profile_gui);
             break;
         case "ilpageeditorgui":
             if (!$this->getEnableEditing()) {
                 ilUtil::sendFailure($lng->txt("permission_denied"), true);
                 $ilCtrl->redirect($this, "preview");
             }
             $page_editor = new ilPageEditorGUI($this->getPageObject(), $this);
             $page_editor->setLocator($this->locator);
             $page_editor->setHeader($this->getHeader());
             $page_editor->setPageBackTitle($this->page_back_title);
             $page_editor->setIntLinkReturn($this->int_link_return);
             //$page_editor->executeCommand();
             $ret =& $this->ctrl->forwardCommand($page_editor);
             break;
         case 'ilnewsitemgui':
             include_once "./Services/News/classes/class.ilNewsItemGUI.php";
             $news_item_gui = new ilNewsItemGUI();
             $news_item_gui->setEnableEdit(true);
             $news_item_gui->setContextObjId($this->news_obj_id);
             $news_item_gui->setContextObjType($this->news_obj_type);
             $news_item_gui->setContextSubObjId($this->obj->getId());
             $news_item_gui->setContextSubObjType("pg");
             $ret = $ilCtrl->forwardCommand($news_item_gui);
             break;
             $profile_gui = new ilPublicUserProfileGUI($_GET["user"]);
             $ret = $this->ctrl->forwardCommand($profile_gui);
             break;
         case "ilpropertyformgui":
             include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
             $form = $this->initOpenedContentForm();
             $this->ctrl->forwardCommand($form);
             break;
         case "ilinternallinkgui":
             $this->lng->loadLanguageModule("content");
             require_once "./Services/Link/classes/class.ilInternalLinkGUI.php";
             $link_gui = new ilInternalLinkGUI("Media_Media", 0);
             //$link_gui->filterLinkType("RepositoryItem");
             $link_gui->filterLinkType("PageObject_FAQ");
             $link_gui->filterLinkType("GlossaryItem");
             $link_gui->filterLinkType("Media_Media");
             $link_gui->filterLinkType("Media_FAQ");
             $link_gui->setFilterWhiteList(true);
             $link_gui->setMode("asynch");
             $ilCtrl->forwardCommand($link_gui);
             break;
         case "ilquestioneditgui":
             $this->setQEditTabs("question");
             include_once "./Modules/TestQuestionPool/classes/class.ilQuestionEditGUI.php";
             $edit_gui = new ilQuestionEditGUI();
             $edit_gui->setPageConfig($this->getPageConfig());
             //			    $edit_gui->addNewIdListener($this, "setNewQuestionId");
             $edit_gui->setSelfAssessmentEditingMode(true);
             $ret = $ilCtrl->forwardCommand($edit_gui);
             $this->tpl->setContent($ret);
             break;
         case 'ilassquestionfeedbackeditinggui':
             $this->onFeedbackEditingForwarding();
             // set tabs
             $this->setQEditTabs("feedback");
             // load required lang mods
             $lng->loadLanguageModule("assessment");
             // set context tabs
             require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
             require_once 'Modules/TestQuestionPool/classes/class.assQuestion.php';
             $questionGUI = assQuestionGUI::_getQuestionGUI(assQuestion::_getQuestionType((int) $_GET['q_id']), (int) $_GET['q_id']);
             $questionGUI->object->setObjId(0);
             $questionGUI->object->setSelfAssessmentEditingMode(true);
             $questionGUI->object->setPreventRteUsage($this->getPageConfig()->getPreventRteUsage());
             // 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 "ilpagemultilanggui":
             				$ilCtrl->setReturn($this, "edit");
             				include_once("./Services/COPage/classes/class.ilPageMultiLangGUI.php");
             				$ml_gui = new ilPageMultiLangGUI($this->getPageObject()->getParentType(), $this->getPageObject()->getParentId(),
             					$this->getPageConfig()->getSinglePageMode());
             				//$this->setTabs("settings");
             				//$this->setSubTabs("cont_multilinguality");
             				$ret = $this->ctrl->forwardCommand($ml_gui);
             				break;*/
         /*			case "ilpagemultilanggui":
         				$ilCtrl->setReturn($this, "edit");
         				include_once("./Services/COPage/classes/class.ilPageMultiLangGUI.php");
         				$ml_gui = new ilPageMultiLangGUI($this->getPageObject()->getParentType(), $this->getPageObject()->getParentId(),
         					$this->getPageConfig()->getSinglePageMode());
         				//$this->setTabs("settings");
         				//$this->setSubTabs("cont_multilinguality");
         				$ret = $this->ctrl->forwardCommand($ml_gui);
         				break;*/
         default:
             $cmd = $this->ctrl->getCmd("preview");
             $ret = $this->{$cmd}();
             break;
     }
     //echo "+$ret+";
     return $ret;
 }
 /**
  * execute command
  */
 function &executeCommand()
 {
     global $ilCtrl;
     $next_class = $ilCtrl->getNextClass();
     $cmd = $ilCtrl->getCmd("getHTML");
     switch ($next_class) {
         case "ilnewsitemgui":
             include_once "./Services/News/classes/class.ilNewsItemGUI.php";
             $news_item_gui = new ilNewsItemGUI();
             $news_item_gui->setEnableEdit($this->getEnableEdit());
             $html = $ilCtrl->forwardCommand($news_item_gui);
             return $html;
         default:
             return $this->{$cmd}();
     }
 }
 /**
  * execute command
  */
 function &executeCommand()
 {
     global $ilCtrl, $ilTabs, $lng;
     $next_class = $this->ctrl->getNextClass($this);
     $cmd = $this->ctrl->getCmd();
     //$this->ctrl->addTab("clipboard", $this->ctrl->getLinkTargetByClass("ilEditClipboardGUI", "view")
     //	, "view", "ilEditClipboardGUI");
     $this->getTabs();
     $ilCtrl->setReturn($this, "edit");
     //echo "-".$next_class."-";
     switch ($next_class) {
         case 'ilmdeditorgui':
             //$this->setTabs();
             $ilTabs->setTabActive("meta_data");
             include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';
             $md_gui =& new ilMDEditorGUI($this->meta_data_rep_obj_id, $this->meta_data_sub_obj_id, $this->meta_data_type);
             if (is_object($this->meta_data_observer_obj)) {
                 $md_gui->addObserver($this->meta_data_observer_obj, $this->meta_data_observer_func, "General");
             }
             $this->ctrl->forwardCommand($md_gui);
             break;
         case "ileditclipboardgui":
             //$this->tabs_gui->clearTargets();
             //$this->ctrl->setReturn($this, "view");
             $clip_gui = new ilEditClipboardGUI();
             $clip_gui->setPageBackTitle($this->page_back_title);
             //$ret =& $clip_gui->executeCommand();
             $ret =& $this->ctrl->forwardCommand($clip_gui);
             break;
             // notes
         // notes
         case "ilnotegui":
             switch ($_GET["notes_mode"]) {
                 default:
                     $html = $this->edit();
                     $ilTabs->setTabActive("edit");
                     return $html;
             }
             break;
         case 'ilpublicuserprofilegui':
             require_once './Services/User/classes/class.ilPublicUserProfileGUI.php';
             $profile_gui = new ilPublicUserProfileGUI($_GET["user"]);
             $ret = $this->ctrl->forwardCommand($profile_gui);
             break;
         case "ilpageeditorgui":
             if (!$this->getEnableEditing()) {
                 ilUtil::sendFailure($lng->txt("permission_denied"), true);
                 $ilCtrl->redirect($this, "preview");
             }
             $page_editor =& new ilPageEditorGUI($this->getPageObject(), $this);
             $page_editor->setLocator($this->locator);
             $page_editor->setHeader($this->getHeader());
             $page_editor->setPageBackTitle($this->page_back_title);
             $page_editor->setEnableInternalLinks($this->getEnabledInternalLinks());
             $page_editor->setEnableKeywords($this->getEnableKeywords());
             $page_editor->setEnableAnchors($this->getEnableAnchors());
             $page_editor->setIntLinkHelpDefault($this->int_link_def_type, $this->int_link_def_id);
             $page_editor->setIntLinkReturn($this->int_link_return);
             //$page_editor->executeCommand();
             $ret =& $this->ctrl->forwardCommand($page_editor);
             break;
         case 'ilnewsitemgui':
             include_once "./Services/News/classes/class.ilNewsItemGUI.php";
             $news_item_gui = new ilNewsItemGUI();
             $news_item_gui->setEnableEdit(true);
             $news_item_gui->setContextObjId($this->news_obj_id);
             $news_item_gui->setContextObjType($this->news_obj_type);
             $news_item_gui->setContextSubObjId($this->obj->getId());
             $news_item_gui->setContextSubObjType("pg");
             $ret = $ilCtrl->forwardCommand($news_item_gui);
             break;
             $profile_gui = new ilPublicUserProfileGUI($_GET["user"]);
             $ret = $this->ctrl->forwardCommand($profile_gui);
             break;
         case "ilpropertyformgui":
             include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
             $form = $this->initOpenedContentForm();
             $this->ctrl->forwardCommand($form);
             break;
         case "ilinternallinkgui":
             $this->lng->loadLanguageModule("content");
             require_once "./Modules/LearningModule/classes/class.ilInternalLinkGUI.php";
             $link_gui = new ilInternalLinkGUI("Media_Media", 0);
             //$link_gui->filterLinkType("RepositoryItem");
             $link_gui->filterLinkType("PageObject_FAQ");
             $link_gui->filterLinkType("GlossaryItem");
             $link_gui->filterLinkType("Media_Media");
             $link_gui->filterLinkType("Media_FAQ");
             $link_gui->setFilterWhiteList(true);
             $link_gui->setMode("asynch");
             $ilCtrl->forwardCommand($link_gui);
             break;
         default:
             $cmd = $this->ctrl->getCmd("preview");
             $ret = $this->{$cmd}();
             break;
     }
     //echo "+$ret+";
     return $ret;
 }