4 include_once (
"./Services/COPage/classes/class.ilPageObjectGUI.php");
70 $this->tabs_gui = $ilTabs;
71 $this->page = $a_page_object;
72 $this->page_gui = $a_page_object_gui;
74 $this->ctrl->saveParameter($this,
array(
"hier_id",
"pc_id"));
105 $this->locator = $a_locator;
113 $this->ctrl->returnToParent($this);
118 $this->int_link_return = $a_return;
124 $this->page_back_title = $a_title;
134 $this->log->debug(
"ilPageEditorGUI: executeCommand begin");
136 $cmd = $this->ctrl->getCmd(
"displayPage");
138 $cmdClass = strtolower($this->ctrl->getCmdClass());
140 $hier_id =
$_GET[
"hier_id"];
141 $pc_id =
$_GET[
"pc_id"];
142 if(isset(
$_POST[
"new_hier_id"]))
144 $hier_id =
$_POST[
"new_hier_id"];
149 $new_type = (isset(
$_GET[
"new_type"]))
176 if (substr(
$cmd, 0, 5) ==
"exec_")
180 $pca = explode(
":", key(
$_POST[
"cmd"]));
183 $cmd = explode(
"_", $pca[0]);
185 $hier_id = implode(
$cmd,
"_");
190 $first_hier_character = substr($hier_id, 0, 1);
191 if ($first_hier_character ==
"c" ||
192 $first_hier_character ==
"r" ||
193 $first_hier_character ==
"i")
195 $hier_id = substr($hier_id, 1);
197 $this->page->buildDom();
198 $this->page->addHierIDs();
201 if ($cmdClass !=
"ilfilesystemgui")
203 $com = explode(
"_",
$cmd);
208 $next_class = $this->ctrl->getNextClass($this);
212 if ($com[0] ==
"insert" || $com[0] ==
"create")
217 if ($ctype ==
"mob") $ctype =
"media";
222 if (
$cmd ==
"editLinkedMedia")
224 $this->ctrl->setCmd(
"edit");
226 $_GET[
"pgEdMediaMode"] =
"editLinkedMedia";
229 if (
$_GET[
"pgEdMediaMode"] ==
"editLinkedMedia")
231 $this->ctrl->setParameter($this,
"pgEdMediaMode",
"editLinkedMedia");
232 $this->ctrl->setParameter($this,
"mob_id",
$_GET[
"mob_id"]);
233 if ($cmdClass !=
"ilinternallinkgui" && $cmdClass !=
"ilmdeditorgui" 234 && $cmdClass !=
"ilimagemapeditorgui" && $cmdClass !=
"ilfilesystemgui")
236 $this->ctrl->setCmdClass(
"ilobjmediaobjectgui");
237 $cmdClass =
"ilobjmediaobjectgui";
244 echo ";$cmd;".$next_class.
";";
246 echo "-$cmd-".$this->ctrl->getCmd().
"-";
253 if (
$cmd !=
"insertFromClipboard" &&
$cmd !=
"pasteFromClipboard" &&
254 $cmd !=
"setMediaMode" &&
$cmd !=
"copyLinkedMediaToClipboard" &&
255 $cmd !=
"activatePage" &&
$cmd !=
"deactivatePage" &&
256 $cmd !=
"copyLinkedMediaToMediaPool" &&
$cmd !=
"showSnippetInfo" &&
257 $cmd !=
"deleteSelected" &&
$cmd !=
"paste" &&
258 $cmd !=
"cancelDeleteSelected" &&
$cmd !=
"confirmedDeleteSelected" &&
259 $cmd !=
"copySelected" &&
$cmd !=
"cutSelected" &&
260 (
$cmd !=
"displayPage" ||
$_POST[
"editImagemapForward_x"] !=
"" ||
$_POST[
"imagemap_x"] !=
"") &&
261 (
$cmd !=
"displayPage" ||
$_POST[
"editImagemapForward_x"] !=
"") &&
262 $cmd !=
"activateSelected" &&
$cmd !=
"assignCharacteristicForm" &&
263 $cmd !=
"assignCharacteristic" &&
264 $cmdClass !=
"ilrepositoryselector2inputgui" &&
265 $cmd !=
"cancelCreate" &&
$cmd !=
"popup" &&
266 $cmdClass !=
"ileditclipboardgui" &&
$cmd !=
"addChangeComment" &&
267 ($cmdClass !=
"ilinternallinkgui" || ($next_class ==
"ilpcmediaobjectgui")))
269 if (
$_GET[
"pgEdMediaMode"] !=
"editLinkedMedia")
273 $cont_obj = $this->page->getContentObject($hier_id, $pc_id);
274 if (!is_object($cont_obj))
276 $this->log->debug(
"ilPageEditorGUI: ...returnToParent (cmdClass: $cmdClass, nextClass: $next_class".
277 ", hier_id: ".$hier_id.
", pc_id: ".$pc_id.
")");
278 $ilCtrl->returnToParent($this);
280 $ctype = $cont_obj->getType();
289 if ($ctype !=
"media" || !is_object ($cont_obj))
293 $this->tpl->setTitle($this->
getHeader());
302 $this->ctrl->setParameter($this,
"hier_id", $hier_id);
303 $this->ctrl->setParameter($this,
"pc_id", $pc_id);
304 $this->ctrl->setCmd(
$cmd);
309 if ($next_class ==
"")
311 include_once(
"./Services/COPage/classes/class.ilCOPagePCDef.php");
313 if (is_array($pc_def))
315 $this->ctrl->setCmdClass($pc_def[
"pc_gui_class"]);
317 $next_class = $this->ctrl->getNextClass($this);
321 if (
$cmd ==
"displayPage" &&
$_POST[
"editImagemapForward_x"] ==
"" &&
$_POST[
"imagemap_x"] ==
"")
327 $this->log->debug(
"ilPageEditorGUI: ... next_class:".$next_class.
", pc_id:".$pc_id.
328 ", hier_id:".$hier_id.
", ctype:".$ctype.
", cmd:".
$cmd);
331 case "ilinternallinkgui":
333 $this->page_gui->getPageConfig()->getIntLinkHelpDefaultType(),
334 $this->page_gui->getPageConfig()->getIntLinkHelpDefaultId());
336 $link_gui->setFilterWhiteList(
337 $this->page_gui->getPageConfig()->getIntLinkFilterWhiteList());
338 foreach ($this->page_gui->getPageConfig()->getIntLinkFilters() as $filter)
340 $link_gui->filterLinkType($filter);
344 $link_gui->setReturn($this->int_link_return);
345 if ($ilCtrl->isAsynch())
347 $link_gui->setMode(
"asynch");
350 $ret = $this->ctrl->forwardCommand($link_gui);
354 case "ilpcmediaobjectgui":
355 include_once (
"./Services/COPage/classes/class.ilPCMediaObjectGUI.php");
357 $this->tabs_gui->clearTargets();
358 $this->tabs_gui->setBackTarget($this->page_gui->page_back_title,
359 $ilCtrl->getLinkTarget($this->page_gui,
"edit"));
361 $pcmob_gui->setStyleId($this->page_gui->getStyleId());
362 $pcmob_gui->setEnabledMapAreas($this->page_gui->getPageConfig()->getEnableInternalLinks());
363 $ret = $this->ctrl->forwardCommand($pcmob_gui);
364 $ilHelp->setScreenIdComponent(
"copg_media");
368 case "ilobjmediaobjectgui":
369 $this->tabs_gui->clearTargets();
370 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"),
371 $ilCtrl->getParentReturn($this));
374 $mob_gui->setEnabledMapAreas($this->page_gui->getPageConfig()->getEnableInternalLinks());
375 $this->tpl->setTitle($this->lng->txt(
"mob").
": ".
377 $ret = $this->ctrl->forwardCommand($mob_gui);
381 case "ilpcquestiongui":
382 include_once(
"./Services/COPage/classes/class.ilPCQuestionGUI.php");
383 $pc_question_gui =
new ilPCQuestionGUI($this->page, $cont_obj, $hier_id, $pc_id);
384 $pc_question_gui->setSelfAssessmentMode($this->page_gui->getPageConfig()->getEnableSelfAssessment());
385 $pc_question_gui->setPageConfig($this->page_gui->getPageConfig());
387 if ($this->page_gui->getPageConfig()->getEnableSelfAssessment())
389 $this->tabs_gui->clearTargets();
390 $ilHelp->setScreenIdComponent(
"copg_pcqst");
391 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"),
392 $ilCtrl->getParentReturn($this));
393 $ret = $this->ctrl->forwardCommand($pc_question_gui);
397 $cmd = $this->ctrl->getCmd();
398 $pc_question_gui->$cmd();
399 $this->ctrl->redirectByClass(
array(
"ilobjquestionpoolgui", get_class($cont_obj)),
"editQuestion");
404 case "ilpcpluggedgui":
405 $this->tabs_gui->clearTargets();
406 include_once (
"./Services/COPage/classes/class.ilPCPluggedGUI.php");
407 $plugged_gui =
new ilPCPluggedGUI($this->page, $cont_obj, $hier_id,
409 $ret = $this->ctrl->forwardCommand($plugged_gui);
415 include_once(
"./Services/COPage/classes/class.ilCOPagePCDef.php");
419 $this->tabs_gui->clearTargets();
420 $this->tabs_gui->setBackTarget($this->page_gui->page_back_title,
421 $ilCtrl->getLinkTarget($this->page_gui,
"edit"));
422 $ilHelp->setScreenIdComponent(
"copg_".$pc_def[
"pc_type"]);
424 $gui_class_name = $pc_def[
"pc_gui_class"];
425 $pc_gui =
new $gui_class_name($this->page, $cont_obj, $hier_id, $pc_id);
426 if ($pc_def[
"style_classes"])
428 $pc_gui->setStyleId($this->page_gui->getStyleId());
430 $pc_gui->setPageConfig($this->page_gui->getPageConfig());
431 $ret = $this->ctrl->forwardCommand($pc_gui);
437 if (
$cmd ==
"pasteFromClipboard")
441 else if (
$cmd ==
"paste")
454 $this->log->debug(
"ilPageEditorGUI: executeCommand end");
467 if ($ilUser->getPref(
"ilPageEditor_JavaScript") !=
"disable" 485 $this->page_gui->activatePage();
490 $this->page_gui->deactivatePage();
500 $ilUser->writePref(
"ilPageEditor_MediaMode",
$_POST[
"media_mode"]);
501 $ilUser->writePref(
"ilPageEditor_HTMLMode",
$_POST[
"html_mode"]);
502 if ($ilUser->getPref(
"ilPageEditor_JavaScript") !=
$_POST[
"js_mode"])
505 if ($this->page->getParentType() ==
"lm")
507 $this->ctrl->setParameterByClass(
"illmpageobjectgui",
"reloadTree",
"y");
510 $ilUser->writePref(
"ilPageEditor_JavaScript",
$_POST[
"js_mode"]);
513 if ($this->page->getParentType() ==
"lm")
515 $this->ctrl->redirectByClass(
"illmpageobjectgui",
"edit");
519 $this->ctrl->returnToParent($this);
532 $this->ctrl->returnToParent($this);
542 $this->ctrl->setParameterByClass(
"ilmediapooltargetselector",
"mob_id",
$_POST[
"mob_id"]);
543 $this->ctrl->redirectByClass(
"ilmediapooltargetselector",
"listPools");
551 include_once(
"./Services/History/classes/class.ilHistory.php");
553 "", $this->page->getParentType().
":pg",
556 $this->ctrl->returnToParent($this);
566 $targets = explode(
";",
$_POST[
"target"][0]);
568 if (count($targets) == 0)
571 $this->ctrl->returnToParent($this);
575 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
577 $cgui->setFormAction($ilCtrl->getFormAction($this));
578 $cgui->setHeaderText($lng->txt(
"copg_confirm_el_deletion"));
579 $cgui->setCancel($lng->txt(
"cancel"),
"cancelDeleteSelected");
580 $cgui->setConfirm($lng->txt(
"confirm"),
"confirmedDeleteSelected");
581 $cgui->addHiddenItem(
"target",
$_POST[
"target"][0]);
583 $tpl->setContent($cgui->getHTML());
595 $this->ctrl->returnToParent($this);
604 $targets = explode(
";",
$_POST[
"target"]);
605 if (count($targets) > 0)
607 $updated = $this->page->deleteContents($targets,
true,
608 $this->page_gui->getPageConfig()->getEnableSelfAssessment());
609 if($updated !==
true)
618 $this->ctrl->returnToParent($this);
628 if (is_int(strpos(
$_POST[
"target"][0],
";")))
632 if (is_array(
$_POST[
"target"]))
634 $this->page->copyContents(
$_POST[
"target"]);
637 $this->ctrl->returnToParent($this);
647 if (is_int(strpos(
$_POST[
"target"][0],
";")))
651 if (is_array(
$_POST[
"target"]))
653 $updated = $this->page->cutContents(
$_POST[
"target"]);
654 if($updated !==
true)
664 $this->ctrl->returnToParent($this);
673 $this->page->pasteContents($a_hier_id, $this->page_gui->getPageConfig()->getEnableSelfAssessment());
674 include_once(
"./Modules/LearningModule/classes/class.ilEditClipboard.php");
676 $this->ctrl->returnToParent($this);
684 if (is_int(strpos(
$_POST[
"target"][0],
";")))
688 if (is_array(
$_POST[
"target"]))
690 $updated = $this->page->switchEnableMultiple(
$_POST[
"target"],
true,
691 $this->page_gui->getPageConfig()->getEnableSelfAssessment());
692 if($updated !==
true)
701 $this->ctrl->returnToParent($this);
711 if (is_int(strpos(
$_POST[
"target"][0],
";")))
715 if (is_array(
$_POST[
"target"]))
722 $tarr = explode(
":", $t);
723 $cont_obj = $this->page->getContentObject($tarr[0], $tarr[1]);
724 if (is_object($cont_obj) && $cont_obj->getType() ==
"par")
726 $types[
"par"] =
"par";
728 if (is_object($cont_obj) && $cont_obj->getType() ==
"sec")
730 $types[
"sec"] =
"sec";
734 if (count($types) == 0)
737 $this->ctrl->returnToParent($this);
742 $tpl->setContent($this->form->getHTML());
747 $this->ctrl->returnToParent($this);
760 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
762 $this->form->setTitle($this->lng->txt(
"cont_choose_characteristic"));
764 if ($a_types[
"par"] ==
"par")
766 $select_prop =
new ilSelectInputGUI($this->lng->txt(
"cont_choose_characteristic_text"),
768 include_once(
"./Services/COPage/classes/class.ilPCParagraphGUI.php");
771 $this->form->addItem($select_prop);
773 if ($a_types[
"sec"] ==
"sec")
775 $select_prop =
new ilSelectInputGUI($this->lng->txt(
"cont_choose_characteristic_section"),
777 include_once(
"./Services/COPage/classes/class.ilPCSectionGUI.php");
780 $this->form->addItem($select_prop);
783 foreach ($a_target as
$t)
786 $hidden->setValue($t);
787 $this->form->addItem($hidden);
790 $this->form->setFormAction($ilCtrl->getFormAction($this));
791 $this->form->addCommandButton(
"assignCharacteristic", $lng->txt(
"save"));
792 $this->form->addCommandButton(
"showPage", $lng->txt(
"cancel"));
803 if (is_array(
$_POST[
"target"]))
807 $tarr = explode(
":", $t);
808 $cont_obj = $this->page->getContentObject($tarr[0], $tarr[1]);
809 if (is_object($cont_obj) && $cont_obj->getType() ==
"par")
811 $cont_obj->setCharacteristic($char_par);
813 if (is_object($cont_obj) && $cont_obj->getType() ==
"sec")
815 $cont_obj->setCharacteristic($char_sec);
818 $updated = $this->page->update();
819 if($updated !==
true)
828 $this->ctrl->returnToParent($this);
838 $ilCtrl->setParameter($this,
"hier_id", $a_hier_id);
839 $ilCtrl->setParameterByClass(
"ilEditClipboardGUI",
"returnCommand",
840 rawurlencode($ilCtrl->getLinkTarget($this,
841 "insertFromClipboard",
"",
false,
false)));
843 $ilCtrl->redirectByClass(
"ilEditClipboardGUI",
"getObject");
851 include_once(
"./Services/Clipboard/classes/class.ilEditClipboardGUI.php");
853 include_once (
"./Services/COPage/classes/class.ilPCMediaObject.php");
856 foreach ($ids as $id2)
858 $id = explode(
":", $id2);
864 $this->content_obj->readMediaObject($id);
865 $this->content_obj->createAlias($this->page,
$_GET[
"hier_id"]);
866 $this->updated = $this->page->update();
870 include_once(
"./Services/COPage/classes/class.ilPCContentInclude.php");
872 $this->content_obj->create($this->page,
$_GET[
"hier_id"]);
873 $this->content_obj->setContentType(
"mep");
874 $this->content_obj->setContentId($id);
875 $this->updated = $this->page->update();
879 $this->ctrl->returnToParent($this);
887 $this->ctrl->returnToParent($this);
895 if(is_object($this->locator))
897 $this->locator->display();
908 $stpl =
new ilTemplate(
"tpl.snippet_info.html",
true,
true,
"Services/COPage");
910 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
912 foreach ($mep_pools as $mep_id)
916 foreach ($ref_ids as $rid)
918 if (!$edit_link && $ilAccess->checkAccess(
"write",
"", $rid))
920 $stpl->setCurrentBlock(
"edit_link");
921 $stpl->setVariable(
"TXT_EDIT", $lng->txt(
"edit"));
922 $stpl->setVariable(
"HREF_EDIT",
923 "./goto.php?target=mep_".$rid);
924 $stpl->parseCurrentBlock();
927 $stpl->setCurrentBlock(
"pool");
928 $stpl->setVariable(
"TXT_MEDIA_POOL", $lng->txt(
"obj_mep"));
930 $stpl->parseCurrentBlock();
933 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
934 $stpl->setVariable(
"TXT_TITLE", $lng->txt(
"title"));
936 $stpl->setVariable(
"TXT_BACK", $lng->txt(
"back"));
937 $stpl->setVariable(
"HREF_BACK",
938 $ilCtrl->getLinkTarget($this->page_gui,
"edit"));
939 $tpl->setContent($stpl->get());
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static _isBrowserJSEditCapable()
checks wether browser is javascript editing capable
static isPCGUIClassName($a_class_name, $a_lower_case=false)
Is given class name a pc gui class?
setIntLinkReturn($a_return)
returnToContext()
redirect to parent context
displayLocator()
display locator
setMediaMode()
set media and editing mode
cutSelected()
Cut selected items.
showSnippetInfo()
Show snippet info.
static getPCDefinitionByGUIClassName($a_gui_class_name)
Get PC definition by name.
confirmedDeleteSelected()
Delete selected items.
assignCharacteristicForm()
Assign characeristic to text blocks/sections.
displayPage()
Default for POST reloads and missing.
static _getCharacteristics($a_style_id)
Get characteristics.
static _lookupTitle($a_id)
lookup object title
paste($a_hier_id)
paste from clipboard (redirects to clipboard)
executeCommand()
execute command
setLocator(&$a_locator)
set locator object
static lookupTitle($a_page_id)
Lookup title.
static _getAllReferences($a_id)
get all reference ids of object
__construct(&$a_page_object, &$a_page_object_gui)
Constructor.
setMode($a_mode="text")
Set mode.
copySelected()
Copy selected items.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
initCharacteristicForm($a_target, $a_types)
Init map creation/update form.
copyLinkedMediaToClipboard()
copy linked media object to clipboard
Class ilPCContentInclude.
static _getCharacteristics($a_style_id)
Get characteristics.
if(!is_array($argv)) $options
assignCharacteristic()
Assign characteristic.
insertFromClipboard()
insert object from clipboard
copyLinkedMediaToMediaPool()
copy linked media object to media pool
activateSelected()
(de-)activate selected items
special template class to simplify handling of ITX/PEAR
static _doJSEditing()
checks if current user has activated js editing and if browser is js capable
redirection script todo: (a better solution should control the processing via a xml file) ...
setHeader($a_header)
set header title
addChangeComment()
add change comment to history
Add a drawing to the header
cancelDeleteSelected()
Cancel deletion.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static _createEntry($a_obj_id, $a_action, $a_info_params="", $a_obj_type="", $a_user_comment="", $a_update_last=false)
Creates a new history entry for an object.
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static requirePCGUIClassByName($a_name)
Get instance.
setPageBackTitle($a_title)
static getLogger($a_component_id)
Get component logger.
static getPCDefinitionByType($a_pc_type)
Get PC definition by type.
static setAction($a_action)
pasteFromClipboard($a_hier_id)
paste from clipboard (redirects to clipboard)
Confirmation screen class.
getHeader()
get header title