4 include_once (
"./Services/COPage/classes/class.ilPageObjectGUI.php");
5 include_once (
"classes/class.ilTabsGUI.php");
61 $this->tabs_gui =& $ilTabs;
62 $this->page =& $a_page_object;
63 $this->page_gui =& $a_page_object_gui;
65 $this->ctrl->saveParameter($this, array(
"hier_id",
"pc_id"));
76 $this->header = $a_header;
96 $this->locator =& $a_locator;
104 $this->ctrl->returnToParent($this);
109 $this->int_link_def_type = $a_type;
110 $this->int_link_def_id = $a_id;
115 $this->int_link_return = $a_return;
121 $this->page_back_title = $a_title;
131 $this->enable_internal_links = $a_val;
141 return $this->enable_internal_links;
151 $this->enable_keywords = $a_val;
171 $this->enable_anchors = $a_val;
191 $cmd = $this->ctrl->getCmd(
"displayPage");
192 $cmdClass = strtolower($this->ctrl->getCmdClass());
194 $hier_id =
$_GET[
"hier_id"];
195 $pc_id =
$_GET[
"pc_id"];
196 if(isset(
$_POST[
"new_hier_id"]))
198 $hier_id =
$_POST[
"new_hier_id"];
203 $new_type = (isset(
$_GET[
"new_type"]))
208 if (substr(
$cmd, 0, 5) ==
"exec_")
212 $pca = explode(
":", key(
$_POST[
"cmd"]));
215 $cmd = explode(
"_", $pca[0]);
217 $hier_id = implode(
$cmd,
"_");
222 $first_hier_character = substr($hier_id, 0, 1);
223 if ($first_hier_character ==
"c" ||
224 $first_hier_character ==
"r" ||
225 $first_hier_character ==
"i")
227 $hier_id = substr($hier_id, 1);
230 $this->page->buildDom();
231 $this->page->addHierIDs();
234 if ($cmdClass !=
"ilfilesystemgui")
236 $com = explode(
"_",
$cmd);
241 $next_class = $this->ctrl->getNextClass($this);
244 if ($com[0] ==
"insert" || $com[0] ==
"create")
249 if ($ctype ==
"mob") $ctype =
"media";
254 if (
$cmd ==
"editLinkedMedia")
256 $this->ctrl->setCmd(
"edit");
258 $_GET[
"pgEdMediaMode"] =
"editLinkedMedia";
261 if (
$_GET[
"pgEdMediaMode"] ==
"editLinkedMedia")
263 $this->ctrl->setParameter($this,
"pgEdMediaMode",
"editLinkedMedia");
264 $this->ctrl->setParameter($this,
"mob_id",
$_GET[
"mob_id"]);
265 if ($cmdClass !=
"ilinternallinkgui" && $cmdClass !=
"ilmdeditorgui"
266 && $cmdClass !=
"ilimagemapeditorgui" && $cmdClass !=
"ilfilesystemgui")
268 $this->ctrl->setCmdClass(
"ilobjmediaobjectgui");
269 $cmdClass =
"ilobjmediaobjectgui";
277 if (
$cmd !=
"insertFromClipboard" &&
$cmd !=
"pasteFromClipboard" &&
278 $cmd !=
"setMediaMode" &&
$cmd !=
"copyLinkedMediaToClipboard" &&
279 $cmd !=
"activatePage" &&
$cmd !=
"deactivatePage" &&
280 $cmd !=
"copyLinkedMediaToMediaPool" &&
$cmd !=
"showSnippetInfo" &&
281 $cmd !=
"deleteSelected" &&
$cmd !=
"paste" &&
282 $cmd !=
"copySelected" &&
$cmd !=
"cutSelected" &&
283 (
$cmd !=
"displayPage" ||
$_POST[
"editImagemapForward_x"] !=
"" ||
$_POST[
"imagemap_x"] !=
"") &&
284 (
$cmd !=
"displayPage" ||
$_POST[
"editImagemapForward_x"] !=
"") &&
285 $cmd !=
"activateSelected" &&
$cmd !=
"assignCharacteristicForm" &&
286 $cmd !=
"assignCharacteristic" &&
287 $cmd !=
"cancelCreate" &&
$cmd !=
"popup" &&
288 $cmdClass !=
"ileditclipboardgui" &&
$cmd !=
"addChangeComment" &&
289 ($cmdClass !=
"ilinternallinkgui" || ($next_class ==
"ilpcmediaobjectgui")))
291 if (
$_GET[
"pgEdMediaMode"] !=
"editLinkedMedia")
295 $cont_obj =& $this->page->getContentObject($hier_id, $pc_id);
299 $ilCtrl->returnToParent($this);
309 if ($ctype !=
"media" || !is_object (
$cont_obj))
313 $this->tpl->setTitle($this->
getHeader());
321 $this->ctrl->setParameter($this,
"hier_id", $hier_id);
322 $this->ctrl->setParameter($this,
"pc_id", $pc_id);
323 $this->ctrl->setCmd(
$cmd);
327 if ($next_class ==
"")
332 $this->ctrl->setCmdClass(
"ilPCSourcecodeGUI");
336 $this->ctrl->setCmdClass(
"ilPCParagraphGUI");
341 $this->ctrl->setCmdClass(
"ilPCTableGUI");
346 $this->ctrl->setCmdClass(
"ilPCDataTableGUI");
350 $this->ctrl->setCmdClass(
"ilPCTableDataGUI");
354 $this->ctrl->setCmdClass(
"ilPCMediaObjectGUI");
358 $this->ctrl->setCmdClass(
"ilPCListGUI");
362 $this->ctrl->setCmdClass(
"ilPCListItemGUI");
366 $this->ctrl->setCmdClass(
"ilPCFileListGUI");
370 $this->ctrl->setCmdClass(
"ilPCFileItemGUI");
374 $this->ctrl->setCmdClass(
"ilPCQuestionGUI");
378 $this->ctrl->setCmdClass(
"ilPCSectionGUI");
382 $this->ctrl->setCmdClass(
"ilPCResourcesGUI");
386 $this->ctrl->setCmdClass(
"ilPCMapGUI");
390 $this->ctrl->setCmdClass(
"ilPCTabsGUI");
394 $this->ctrl->setCmdClass(
"ilPCTabGUI");
398 $this->ctrl->setCmdClass(
"ilPCPluggedGUI");
402 $this->ctrl->setCmdClass(
"ilPCPlaceHolderGUI");
406 $this->ctrl->setCmdClass(
"ilPCContentIncludeGUI");
410 $next_class = $this->ctrl->getNextClass($this);
414 if (
$cmd ==
"displayPage" &&
$_POST[
"editImagemapForward_x"] ==
"" &&
$_POST[
"imagemap_x"] ==
"")
422 case "ilinternallinkgui":
424 $this->int_link_def_type, $this->int_link_def_id);
425 $link_gui->setMode(
"normal");
426 foreach ($this->page_gui->getPageConfig()->getIntLinkFilters() as $filter)
428 $link_gui->filterLinkType($filter);
430 $link_gui->setSetLinkTargetScript(
431 $this->ctrl->getLinkTarget($this,
"setInternalLink"));
432 $link_gui->setReturn($this->int_link_return);
433 $ret =& $this->ctrl->forwardCommand($link_gui);
437 case "ilpcsourcecodegui":
438 $this->tabs_gui->clearTargets();
439 include_once (
"./Services/COPage/classes/class.ilPCSourcecodeGUI.php");
441 $ret =& $this->ctrl->forwardCommand($src_gui);
445 case "ilpcparagraphgui":
446 $this->tabs_gui->clearTargets();
447 include_once (
"./Services/COPage/classes/class.ilPCParagraphGUI.php");
449 $par_gui->setEnableWikiLinks($this->page_gui->getEnabledWikiLinks());
450 $par_gui->setStyleId($this->page_gui->getStyleId());
454 $ret =& $this->ctrl->forwardCommand($par_gui);
459 $this->tabs_gui->clearTargets();
460 include_once (
"./Services/COPage/classes/class.ilPCTableGUI.php");
462 $tab_gui->setStyleId($this->page_gui->getStyleId());
463 $ret =& $this->ctrl->forwardCommand($tab_gui);
467 case "ilpctabledatagui":
468 $this->tabs_gui->clearTargets();
469 include_once (
"./Services/COPage/classes/class.ilPCTableDataGUI.php");
471 $ret =& $this->ctrl->forwardCommand($td_gui);
475 case "ilpcdatatablegui":
476 $this->tabs_gui->clearTargets();
477 include_once (
"./Services/COPage/classes/class.ilPCDataTableGUI.php");
480 $tab_gui->setStyleId($this->page_gui->getStyleId());
482 $ret =& $this->ctrl->forwardCommand($tab_gui);
486 case "ilpcmediaobjectgui":
487 include_once (
"./Services/COPage/classes/class.ilPCMediaObjectGUI.php");
489 $this->tabs_gui->clearTargets();
490 $this->tabs_gui->setBackTarget($this->page_gui->page_back_title,
491 $ilCtrl->getLinkTarget($this->page_gui,
"edit"));
493 $pcmob_gui->setStyleId($this->page_gui->getStyleId());
494 $pcmob_gui->setEnabledMapAreas($this->page_gui->getEnabledInternalLinks());
495 $ret =& $this->ctrl->forwardCommand($pcmob_gui);
499 case "ilobjmediaobjectgui":
500 $this->tabs_gui->clearTargets();
501 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"),
502 $ilCtrl->getParentReturn($this));
504 $mob_gui->getTabs($this->tabs_gui);
505 $mob_gui->setEnabledMapAreas($this->page_gui->getEnabledInternalLinks());
506 $this->tpl->setTitle($this->lng->txt(
"mob").
": ".
508 $ret =& $this->ctrl->forwardCommand($mob_gui);
513 $this->tabs_gui->clearTargets();
514 include_once (
"./Services/COPage/classes/class.ilPCListGUI.php");
516 $list_gui->setStyleId($this->page_gui->getStyleId());
517 $ret =& $this->ctrl->forwardCommand($list_gui);
521 case "ilpclistitemgui":
522 $this->tabs_gui->clearTargets();
523 include_once (
"./Services/COPage/classes/class.ilPCListItemGUI.php");
526 $ret =& $this->ctrl->forwardCommand($list_item_gui);
530 case "ilpcfilelistgui":
531 $this->tabs_gui->clearTargets();
532 include_once (
"./Services/COPage/classes/class.ilPCFileListGUI.php");
535 $file_list_gui->setStyleId($this->page_gui->getStyleId());
538 $ret =& $this->ctrl->forwardCommand($file_list_gui);
542 case "ilpcfileitemgui":
543 $this->tabs_gui->clearTargets();
544 include_once (
"./Services/COPage/classes/class.ilPCFileItemGUI.php");
547 $ret =& $this->ctrl->forwardCommand($file_item_gui);
551 case "ilpcquestiongui":
552 include_once(
"./Services/COPage/classes/class.ilPCQuestionGUI.php");
554 $pc_question_gui->setSelfAssessmentMode($this->page_gui->getEnabledSelfAssessment());
555 $pc_question_gui->setPageConfig($this->page_gui->getPageConfig());
557 if ($this->page_gui->getEnabledSelfAssessment())
559 $this->tabs_gui->clearTargets();
560 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"),
561 $ilCtrl->getParentReturn($this));
562 $ret = $this->ctrl->forwardCommand($pc_question_gui);
566 $cmd = $this->ctrl->getCmd();
567 $pc_question_gui->$cmd();
568 $this->ctrl->redirectByClass(array(
"ilobjquestionpoolgui", get_class(
$cont_obj)),
"editQuestion");
574 case "ilpcplaceholdergui":
575 $this->tabs_gui->clearTargets();
576 include_once (
"./Services/COPage/classes/class.ilPCPlaceHolderGUI.php");
582 $plch_gui->setStyleId($this->page_gui->getStyleId());
584 $ret =& $this->ctrl->forwardCommand($plch_gui);
588 case "ilpcsectiongui":
589 $this->tabs_gui->clearTargets();
590 include_once (
"./Services/COPage/classes/class.ilPCSectionGUI.php");
593 $sec_gui->setStyleId($this->page_gui->getStyleId());
595 $ret =& $this->ctrl->forwardCommand($sec_gui);
599 case "ilpcresourcesgui":
600 $this->tabs_gui->clearTargets();
601 include_once (
"./Services/COPage/classes/class.ilPCResourcesGUI.php");
603 $ret =& $this->ctrl->forwardCommand($res_gui);
608 $this->tabs_gui->clearTargets();
609 include_once (
"./Services/COPage/classes/class.ilPCMapGUI.php");
611 $ret =& $this->ctrl->forwardCommand($map_gui);
616 $this->tabs_gui->clearTargets();
617 include_once (
"./Services/COPage/classes/class.ilPCTabsGUI.php");
619 $tabs_gui->setStyleId($this->page_gui->getStyleId());
620 $ret =& $this->ctrl->forwardCommand($tabs_gui);
625 $this->tabs_gui->clearTargets();
626 include_once (
"./Services/COPage/classes/class.ilPCTabGUI.php");
627 $tab_gui =
new ilPCTabGUI($this->page,
$cont_obj, $hier_id, $pc_id);
629 $ret =& $this->ctrl->forwardCommand($tab_gui);
633 case "ilpcpluggedgui":
634 $this->tabs_gui->clearTargets();
635 include_once (
"./Services/COPage/classes/class.ilPCPluggedGUI.php");
638 $ret =& $this->ctrl->forwardCommand($plugged_gui);
642 case "ilpccontentincludegui":
643 $this->tabs_gui->clearTargets();
644 include_once (
"./Services/COPage/classes/class.ilPCContentIncludeGUI.php");
646 $ret =& $this->ctrl->forwardCommand($incl_gui);
650 if (
$cmd ==
"pasteFromClipboard")
654 else if (
$cmd ==
"paste")
677 if ($ilUser->getPref(
"ilPageEditor_JavaScript") !=
"disable"
678 && $ilSetting->get(
"enable_js_edit", 1)
693 $version = $ilBrowser->getVersion();
695 if ($ilBrowser->isFirefox() ||
696 ($ilBrowser->isIE() && !$ilBrowser->isMac()) ||
697 ($ilBrowser->isMozilla() && $version[0] >= 5))
706 $this->page_gui->activatePage();
711 $this->page_gui->deactivatePage();
721 $ilUser->writePref(
"ilPageEditor_MediaMode",
$_POST[
"media_mode"]);
722 $ilUser->writePref(
"ilPageEditor_HTMLMode",
$_POST[
"html_mode"]);
723 if ($ilias->getSetting(
"enable_js_edit"))
725 if ($ilUser->getPref(
"ilPageEditor_JavaScript") !=
$_POST[
"js_mode"])
728 if ($this->page->getParentType() ==
"lm" ||
729 $this->page->getParentType() ==
"dbk")
731 $this->ctrl->setParameterByClass(
"illmpageobjectgui",
"reloadTree",
"y");
734 $ilUser->writePref(
"ilPageEditor_JavaScript",
$_POST[
"js_mode"]);
738 if ($this->page->getParentType() ==
"lm" ||
739 $this->page->getParentType() ==
"dbk")
741 $this->ctrl->redirectByClass(
"illmpageobjectgui",
"edit");
745 $this->ctrl->returnToParent($this);
758 $this->ctrl->returnToParent($this);
768 $this->ctrl->setParameterByClass(
"ilmediapooltargetselector",
"mob_id",
$_POST[
"mob_id"]);
769 $this->ctrl->redirectByClass(
"ilmediapooltargetselector",
"listPools");
777 include_once(
"classes/class.ilHistory.php");
779 "", $this->page->getParentType().
":pg",
782 $this->ctrl->returnToParent($this);
790 if (is_int(strpos(
$_POST[
"target"][0],
";")))
794 if (is_array(
$_POST[
"target"]))
796 $updated = $this->page->deleteContents(
$_POST[
"target"]);
797 if($updated !==
true)
806 $this->ctrl->returnToParent($this);
814 if (is_int(strpos(
$_POST[
"target"][0],
";")))
818 if (is_array(
$_POST[
"target"]))
820 $this->page->copyContents(
$_POST[
"target"]);
822 $this->ctrl->returnToParent($this);
830 if (is_int(strpos(
$_POST[
"target"][0],
";")))
834 if (is_array(
$_POST[
"target"]))
836 $updated = $this->page->cutContents(
$_POST[
"target"]);
837 if($updated !==
true)
846 $this->ctrl->returnToParent($this);
855 $this->page->pasteContents($a_hier_id);
856 include_once(
"./Modules/LearningModule/classes/class.ilEditClipboard.php");
858 $this->ctrl->returnToParent($this);
866 if (is_int(strpos(
$_POST[
"target"][0],
";")))
870 if (is_array(
$_POST[
"target"]))
872 $updated = $this->page->switchEnableMultiple(
$_POST[
"target"]);
873 if($updated !==
true)
882 $this->ctrl->returnToParent($this);
892 if (is_int(strpos(
$_POST[
"target"][0],
";")))
896 if (is_array(
$_POST[
"target"]))
903 $tarr = explode(
":", $t);
904 $cont_obj =& $this->page->getContentObject($tarr[0], $tarr[1]);
907 $types[
"par"] =
"par";
911 $types[
"sec"] =
"sec";
915 if (count($types) == 0)
918 $this->ctrl->returnToParent($this);
923 $tpl->setContent($this->form->getHTML());
928 $this->ctrl->returnToParent($this);
941 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
943 $this->form->setTitle($this->lng->txt(
"cont_choose_characteristic"));
945 if ($a_types[
"par"] ==
"par")
947 $select_prop =
new ilSelectInputGUI($this->lng->txt(
"cont_choose_characteristic_text"),
949 include_once(
"./Services/COPage/classes/class.ilPCParagraphGUI.php");
951 $select_prop->setOptions($options);
952 $this->form->addItem($select_prop);
954 if ($a_types[
"sec"] ==
"sec")
956 $select_prop =
new ilSelectInputGUI($this->lng->txt(
"cont_choose_characteristic_section"),
958 include_once(
"./Services/COPage/classes/class.ilPCSectionGUI.php");
960 $select_prop->setOptions($options);
961 $this->form->addItem($select_prop);
964 foreach ($a_target as
$t)
967 $hidden->setValue($t);
968 $this->form->addItem($hidden);
971 $this->form->setFormAction($ilCtrl->getFormAction($this));
972 $this->form->addCommandButton(
"assignCharacteristic", $lng->txt(
"save"));
973 $this->form->addCommandButton(
"showPage", $lng->txt(
"cancel"));
984 if (is_array(
$_POST[
"target"]))
988 $tarr = explode(
":", $t);
989 $cont_obj =& $this->page->getContentObject($tarr[0], $tarr[1]);
999 $updated = $this->page->update();
1000 if($updated !==
true)
1009 $this->ctrl->returnToParent($this);
1019 $ilCtrl->setParameter($this,
"hier_id", $a_hier_id);
1020 $ilCtrl->setParameterByClass(
"ilEditClipboardGUI",
"returnCommand",
1021 rawurlencode($ilCtrl->getLinkTarget($this,
1022 "insertFromClipboard",
"",
false,
false)));
1024 $ilCtrl->redirectByClass(
"ilEditClipboardGUI",
"getObject");
1032 include_once(
"./Services/Clipboard/classes/class.ilEditClipboardGUI.php");
1034 include_once (
"./Services/COPage/classes/class.ilPCMediaObject.php");
1037 foreach ($ids as $id2)
1039 $id = explode(
":", $id2);
1046 $this->content_obj->createAlias($this->page,
$_GET[
"hier_id"]);
1047 $this->updated = $this->page->update();
1049 if (
$type ==
"incl")
1051 include_once(
"./Services/COPage/classes/class.ilPCContentInclude.php");
1053 $this->content_obj->
create($this->page,
$_GET[
"hier_id"]);
1054 $this->content_obj->setContentType(
"mep");
1055 $this->content_obj->setContentId($id);
1056 $this->updated = $this->page->update();
1060 $this->ctrl->returnToParent($this);
1068 $this->ctrl->returnToParent($this);
1076 if(is_object($this->locator))
1078 $this->locator->display();
1089 $stpl =
new ilTemplate(
"tpl.snippet_info.html",
true,
true,
"Services/COPage");
1091 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
1093 foreach ($mep_pools as $mep_id)
1097 foreach ($ref_ids as $rid)
1099 if (!$edit_link && $ilAccess->checkAccess(
"write",
"", $rid))
1101 $stpl->setCurrentBlock(
"edit_link");
1102 $stpl->setVariable(
"TXT_EDIT", $lng->txt(
"edit"));
1103 $stpl->setVariable(
"HREF_EDIT",
1104 "./goto.php?target=mep_".$rid);
1105 $stpl->parseCurrentBlock();
1108 $stpl->setCurrentBlock(
"pool");
1109 $stpl->setVariable(
"TXT_MEDIA_POOL", $lng->txt(
"obj_mep"));
1111 $stpl->parseCurrentBlock();
1114 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
1115 $stpl->setVariable(
"TXT_TITLE", $lng->txt(
"title"));
1117 $stpl->setVariable(
"TXT_BACK", $lng->txt(
"back"));
1118 $stpl->setVariable(
"HREF_BACK",
1119 $ilCtrl->getLinkTargetByClass(
"ilpageobjectgui",
"edit"));
1120 $tpl->setContent($stpl->get());