4 include_once (
"./Services/COPage/classes/class.ilPageObjectGUI.php");
63 $this->tabs_gui =& $ilTabs;
64 $this->page =& $a_page_object;
65 $this->page_gui =& $a_page_object_gui;
67 $this->ctrl->saveParameter($this, array(
"hier_id",
"pc_id"));
78 $this->header = $a_header;
98 $this->locator =& $a_locator;
106 $this->ctrl->returnToParent($this);
111 $this->int_link_return = $a_return;
117 $this->page_back_title = $a_title;
127 $cmd = $this->ctrl->getCmd(
"displayPage");
129 $cmdClass = strtolower($this->ctrl->getCmdClass());
131 $hier_id =
$_GET[
"hier_id"];
132 $pc_id =
$_GET[
"pc_id"];
133 if(isset(
$_POST[
"new_hier_id"]))
135 $hier_id =
$_POST[
"new_hier_id"];
140 $new_type = (isset(
$_GET[
"new_type"]))
167 if (substr(
$cmd, 0, 5) ==
"exec_")
171 $pca = explode(
":", key(
$_POST[
"cmd"]));
174 $cmd = explode(
"_", $pca[0]);
176 $hier_id = implode(
$cmd,
"_");
181 $first_hier_character = substr($hier_id, 0, 1);
182 if ($first_hier_character ==
"c" ||
183 $first_hier_character ==
"r" ||
184 $first_hier_character ==
"i")
186 $hier_id = substr($hier_id, 1);
188 $this->page->buildDom();
189 $this->page->addHierIDs();
192 if ($cmdClass !=
"ilfilesystemgui")
194 $com = explode(
"_",
$cmd);
199 $next_class = $this->ctrl->getNextClass($this);
203 if ($com[0] ==
"insert" || $com[0] ==
"create")
208 if ($ctype ==
"mob") $ctype =
"media";
213 if (
$cmd ==
"editLinkedMedia")
215 $this->ctrl->setCmd(
"edit");
217 $_GET[
"pgEdMediaMode"] =
"editLinkedMedia";
220 if (
$_GET[
"pgEdMediaMode"] ==
"editLinkedMedia")
222 $this->ctrl->setParameter($this,
"pgEdMediaMode",
"editLinkedMedia");
223 $this->ctrl->setParameter($this,
"mob_id",
$_GET[
"mob_id"]);
224 if ($cmdClass !=
"ilinternallinkgui" && $cmdClass !=
"ilmdeditorgui" 225 && $cmdClass !=
"ilimagemapeditorgui" && $cmdClass !=
"ilfilesystemgui")
227 $this->ctrl->setCmdClass(
"ilobjmediaobjectgui");
228 $cmdClass =
"ilobjmediaobjectgui";
235 echo
";$cmd;".$next_class.
";";
237 echo
"-$cmd-".$this->ctrl->getCmd().
"-";
244 if (
$cmd !=
"insertFromClipboard" &&
$cmd !=
"pasteFromClipboard" &&
245 $cmd !=
"setMediaMode" &&
$cmd !=
"copyLinkedMediaToClipboard" &&
246 $cmd !=
"activatePage" &&
$cmd !=
"deactivatePage" &&
247 $cmd !=
"copyLinkedMediaToMediaPool" &&
$cmd !=
"showSnippetInfo" &&
248 $cmd !=
"deleteSelected" &&
$cmd !=
"paste" &&
249 $cmd !=
"copySelected" &&
$cmd !=
"cutSelected" &&
250 (
$cmd !=
"displayPage" ||
$_POST[
"editImagemapForward_x"] !=
"" ||
$_POST[
"imagemap_x"] !=
"") &&
251 (
$cmd !=
"displayPage" ||
$_POST[
"editImagemapForward_x"] !=
"") &&
252 $cmd !=
"activateSelected" &&
$cmd !=
"assignCharacteristicForm" &&
253 $cmd !=
"assignCharacteristic" &&
254 $cmd !=
"cancelCreate" &&
$cmd !=
"popup" &&
255 $cmdClass !=
"ileditclipboardgui" &&
$cmd !=
"addChangeComment" &&
256 ($cmdClass !=
"ilinternallinkgui" || ($next_class ==
"ilpcmediaobjectgui")))
258 if (
$_GET[
"pgEdMediaMode"] !=
"editLinkedMedia")
262 $cont_obj =& $this->page->getContentObject($hier_id, $pc_id);
263 if (!is_object($cont_obj))
265 $ilCtrl->returnToParent($this);
267 $ctype = $cont_obj->getType();
276 if ($ctype !=
"media" || !is_object ($cont_obj))
280 $this->tpl->setTitle($this->
getHeader());
289 $this->ctrl->setParameter($this,
"hier_id", $hier_id);
290 $this->ctrl->setParameter($this,
"pc_id", $pc_id);
291 $this->ctrl->setCmd(
$cmd);
296 if ($next_class ==
"")
298 include_once(
"./Services/COPage/classes/class.ilCOPagePCDef.php");
300 if (is_array($pc_def))
302 $this->ctrl->setCmdClass($pc_def[
"pc_gui_class"]);
304 $next_class = $this->ctrl->getNextClass($this);
308 if (
$cmd ==
"displayPage" &&
$_POST[
"editImagemapForward_x"] ==
"" &&
$_POST[
"imagemap_x"] ==
"")
316 case "ilinternallinkgui":
318 $this->page_gui->getPageConfig()->getIntLinkHelpDefaultType(),
319 $this->page_gui->getPageConfig()->getIntLinkHelpDefaultId());
321 $link_gui->setFilterWhiteList(
322 $this->page_gui->getPageConfig()->getIntLinkFilterWhiteList());
323 foreach ($this->page_gui->getPageConfig()->getIntLinkFilters() as $filter)
325 $link_gui->filterLinkType($filter);
329 $link_gui->setReturn($this->int_link_return);
330 if ($ilCtrl->isAsynch())
332 $link_gui->setMode(
"asynch");
335 $ret =& $this->ctrl->forwardCommand($link_gui);
339 case "ilpcmediaobjectgui":
340 include_once (
"./Services/COPage/classes/class.ilPCMediaObjectGUI.php");
342 $this->tabs_gui->clearTargets();
343 $this->tabs_gui->setBackTarget($this->page_gui->page_back_title,
344 $ilCtrl->getLinkTarget($this->page_gui,
"edit"));
346 $pcmob_gui->setStyleId($this->page_gui->getStyleId());
347 $pcmob_gui->setEnabledMapAreas($this->page_gui->getPageConfig()->getEnableInternalLinks());
348 $ret =& $this->ctrl->forwardCommand($pcmob_gui);
349 $ilHelp->setScreenIdComponent(
"copg_media");
353 case "ilobjmediaobjectgui":
354 $this->tabs_gui->clearTargets();
355 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"),
356 $ilCtrl->getParentReturn($this));
358 $mob_gui->getTabs($this->tabs_gui);
359 $mob_gui->setEnabledMapAreas($this->page_gui->getPageConfig()->getEnableInternalLinks());
360 $this->tpl->setTitle($this->lng->txt(
"mob").
": ".
362 $ret =& $this->ctrl->forwardCommand($mob_gui);
366 case "ilpcquestiongui":
367 include_once(
"./Services/COPage/classes/class.ilPCQuestionGUI.php");
368 $pc_question_gui =&
new ilPCQuestionGUI($this->page, $cont_obj, $hier_id, $pc_id);
369 $pc_question_gui->setSelfAssessmentMode($this->page_gui->getPageConfig()->getEnableSelfAssessment());
370 $pc_question_gui->setPageConfig($this->page_gui->getPageConfig());
372 if ($this->page_gui->getPageConfig()->getEnableSelfAssessment())
374 $this->tabs_gui->clearTargets();
375 $ilHelp->setScreenIdComponent(
"copg_pcqst");
376 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"),
377 $ilCtrl->getParentReturn($this));
378 $ret = $this->ctrl->forwardCommand($pc_question_gui);
382 $cmd = $this->ctrl->getCmd();
383 $pc_question_gui->$cmd();
384 $this->ctrl->redirectByClass(array(
"ilobjquestionpoolgui", get_class($cont_obj)),
"editQuestion");
389 case "ilpcpluggedgui":
390 $this->tabs_gui->clearTargets();
391 include_once (
"./Services/COPage/classes/class.ilPCPluggedGUI.php");
392 $plugged_gui =
new ilPCPluggedGUI($this->page, $cont_obj, $hier_id,
394 $ret = $this->ctrl->forwardCommand($plugged_gui);
400 include_once(
"./Services/COPage/classes/class.ilCOPagePCDef.php");
404 $this->tabs_gui->clearTargets();
405 $this->tabs_gui->setBackTarget($this->page_gui->page_back_title,
406 $ilCtrl->getLinkTarget($this->page_gui,
"edit"));
407 $ilHelp->setScreenIdComponent(
"copg_".$pc_def[
"pc_type"]);
409 $gui_class_name = $pc_def[
"pc_gui_class"];
410 $pc_gui =
new $gui_class_name($this->page, $cont_obj, $hier_id, $pc_id);
411 if ($pc_def[
"style_classes"])
413 $pc_gui->setStyleId($this->page_gui->getStyleId());
415 $pc_gui->setPageConfig($this->page_gui->getPageConfig());
416 $ret = $this->ctrl->forwardCommand($pc_gui);
422 if (
$cmd ==
"pasteFromClipboard")
426 else if (
$cmd ==
"paste")
450 if ($ilUser->getPref(
"ilPageEditor_JavaScript") !=
"disable" 465 $version = $ilBrowser->getVersion();
467 if ($ilBrowser->isFirefox() ||
468 ($ilBrowser->isIE() && !$ilBrowser->isMac()) ||
469 ($ilBrowser->isMozilla() && $version[0] >= 5))
478 $this->page_gui->activatePage();
483 $this->page_gui->deactivatePage();
493 $ilUser->writePref(
"ilPageEditor_MediaMode",
$_POST[
"media_mode"]);
494 $ilUser->writePref(
"ilPageEditor_HTMLMode",
$_POST[
"html_mode"]);
495 if ($ilUser->getPref(
"ilPageEditor_JavaScript") !=
$_POST[
"js_mode"])
498 if ($this->page->getParentType() ==
"lm" ||
499 $this->page->getParentType() ==
"dbk")
501 $this->ctrl->setParameterByClass(
"illmpageobjectgui",
"reloadTree",
"y");
504 $ilUser->writePref(
"ilPageEditor_JavaScript",
$_POST[
"js_mode"]);
507 if ($this->page->getParentType() ==
"lm" ||
508 $this->page->getParentType() ==
"dbk")
510 $this->ctrl->redirectByClass(
"illmpageobjectgui",
"edit");
514 $this->ctrl->returnToParent($this);
527 $this->ctrl->returnToParent($this);
537 $this->ctrl->setParameterByClass(
"ilmediapooltargetselector",
"mob_id",
$_POST[
"mob_id"]);
538 $this->ctrl->redirectByClass(
"ilmediapooltargetselector",
"listPools");
546 include_once(
"./Services/History/classes/class.ilHistory.php");
548 "", $this->page->getParentType().
":pg",
551 $this->ctrl->returnToParent($this);
559 if (is_int(strpos(
$_POST[
"target"][0],
";")))
563 if (is_array(
$_POST[
"target"]))
565 $updated = $this->page->deleteContents(
$_POST[
"target"],
true,
566 $this->page_gui->getPageConfig()->getEnableSelfAssessment());
567 if($updated !==
true)
576 $this->ctrl->returnToParent($this);
586 if (is_int(strpos(
$_POST[
"target"][0],
";")))
590 if (is_array(
$_POST[
"target"]))
592 $this->page->copyContents(
$_POST[
"target"]);
595 $this->ctrl->returnToParent($this);
605 if (is_int(strpos(
$_POST[
"target"][0],
";")))
609 if (is_array(
$_POST[
"target"]))
611 $updated = $this->page->cutContents(
$_POST[
"target"]);
612 if($updated !==
true)
622 $this->ctrl->returnToParent($this);
631 $this->page->pasteContents($a_hier_id, $this->page_gui->getPageConfig()->getEnableSelfAssessment());
632 include_once(
"./Modules/LearningModule/classes/class.ilEditClipboard.php");
634 $this->ctrl->returnToParent($this);
642 if (is_int(strpos(
$_POST[
"target"][0],
";")))
646 if (is_array(
$_POST[
"target"]))
648 $updated = $this->page->switchEnableMultiple(
$_POST[
"target"],
true,
649 $this->page_gui->getPageConfig()->getEnableSelfAssessment());
650 if($updated !==
true)
659 $this->ctrl->returnToParent($this);
669 if (is_int(strpos(
$_POST[
"target"][0],
";")))
673 if (is_array(
$_POST[
"target"]))
680 $tarr = explode(
":", $t);
681 $cont_obj =& $this->page->getContentObject($tarr[0], $tarr[1]);
682 if (is_object($cont_obj) && $cont_obj->getType() ==
"par")
684 $types[
"par"] =
"par";
686 if (is_object($cont_obj) && $cont_obj->getType() ==
"sec")
688 $types[
"sec"] =
"sec";
692 if (count($types) == 0)
695 $this->ctrl->returnToParent($this);
700 $tpl->setContent($this->form->getHTML());
705 $this->ctrl->returnToParent($this);
718 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
720 $this->form->setTitle($this->lng->txt(
"cont_choose_characteristic"));
722 if ($a_types[
"par"] ==
"par")
724 $select_prop =
new ilSelectInputGUI($this->lng->txt(
"cont_choose_characteristic_text"),
726 include_once(
"./Services/COPage/classes/class.ilPCParagraphGUI.php");
729 $this->form->addItem($select_prop);
731 if ($a_types[
"sec"] ==
"sec")
733 $select_prop =
new ilSelectInputGUI($this->lng->txt(
"cont_choose_characteristic_section"),
735 include_once(
"./Services/COPage/classes/class.ilPCSectionGUI.php");
738 $this->form->addItem($select_prop);
741 foreach ($a_target as
$t)
744 $hidden->setValue($t);
745 $this->form->addItem($hidden);
748 $this->form->setFormAction($ilCtrl->getFormAction($this));
749 $this->form->addCommandButton(
"assignCharacteristic", $lng->txt(
"save"));
750 $this->form->addCommandButton(
"showPage", $lng->txt(
"cancel"));
761 if (is_array(
$_POST[
"target"]))
765 $tarr = explode(
":", $t);
766 $cont_obj =& $this->page->getContentObject($tarr[0], $tarr[1]);
767 if (is_object($cont_obj) && $cont_obj->getType() ==
"par")
769 $cont_obj->setCharacteristic($char_par);
771 if (is_object($cont_obj) && $cont_obj->getType() ==
"sec")
773 $cont_obj->setCharacteristic($char_sec);
776 $updated = $this->page->update();
777 if($updated !==
true)
786 $this->ctrl->returnToParent($this);
796 $ilCtrl->setParameter($this,
"hier_id", $a_hier_id);
797 $ilCtrl->setParameterByClass(
"ilEditClipboardGUI",
"returnCommand",
798 rawurlencode($ilCtrl->getLinkTarget($this,
799 "insertFromClipboard",
"",
false,
false)));
801 $ilCtrl->redirectByClass(
"ilEditClipboardGUI",
"getObject");
809 include_once(
"./Services/Clipboard/classes/class.ilEditClipboardGUI.php");
811 include_once (
"./Services/COPage/classes/class.ilPCMediaObject.php");
814 foreach ($ids as $id2)
816 $id = explode(
":", $id2);
822 $this->content_obj->readMediaObject($id);
823 $this->content_obj->createAlias($this->page,
$_GET[
"hier_id"]);
824 $this->updated = $this->page->update();
828 include_once(
"./Services/COPage/classes/class.ilPCContentInclude.php");
830 $this->content_obj->create($this->page,
$_GET[
"hier_id"]);
831 $this->content_obj->setContentType(
"mep");
832 $this->content_obj->setContentId($id);
833 $this->updated = $this->page->update();
837 $this->ctrl->returnToParent($this);
845 $this->ctrl->returnToParent($this);
853 if(is_object($this->locator))
855 $this->locator->display();
866 $stpl =
new ilTemplate(
"tpl.snippet_info.html",
true,
true,
"Services/COPage");
868 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
870 foreach ($mep_pools as $mep_id)
874 foreach ($ref_ids as $rid)
876 if (!$edit_link && $ilAccess->checkAccess(
"write",
"", $rid))
878 $stpl->setCurrentBlock(
"edit_link");
879 $stpl->setVariable(
"TXT_EDIT", $lng->txt(
"edit"));
880 $stpl->setVariable(
"HREF_EDIT",
881 "./goto.php?target=mep_".$rid);
882 $stpl->parseCurrentBlock();
885 $stpl->setCurrentBlock(
"pool");
886 $stpl->setVariable(
"TXT_MEDIA_POOL", $lng->txt(
"obj_mep"));
888 $stpl->parseCurrentBlock();
891 include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
892 $stpl->setVariable(
"TXT_TITLE", $lng->txt(
"title"));
894 $stpl->setVariable(
"TXT_BACK", $lng->txt(
"back"));
895 $stpl->setVariable(
"HREF_BACK",
896 $ilCtrl->getLinkTarget($this->page_gui,
"edit"));
897 $tpl->setContent($stpl->get());
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
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.
deleteSelected()
Delete selected items.
assignCharacteristicForm()
Assign characeristic to text blocks/sections.
displayPage()
Default for POST reloads and missing.
static _getCharacteristics($a_style_id)
Get characteristics.
_isBrowserJSEditCapable()
checks wether browser is javascript editing capable
static _lookupTitle($a_id)
lookup object title
ilPageEditorGUI(&$a_page_object, &$a_page_object_gui)
Constructor.
paste($a_hier_id)
paste from clipboard (redirects to clipboard)
setLocator(&$a_locator)
set locator object
static lookupTitle($a_page_id)
Lookup title.
static _getAllReferences($a_id)
get all reference ids of object
setMode($a_mode="text")
Set mode.
copySelected()
Copy selected items.
initCharacteristicForm($a_target, $a_types)
Init map creation/update form.
copyLinkedMediaToClipboard()
copy linked media object to clipboard
Class ilPCContentInclude.
_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.
static _getCharacteristics($a_style_id)
Get characteristics.
if(!is_array($argv)) $options
assignCharacteristic()
Assign characteristic.
insertFromClipboard()
insert object from clipboard
getPCDefinitionByGUIClassName($a_gui_class_name)
Get PC definition by name.
copyLinkedMediaToMediaPool()
copy linked media object to media pool
activateSelected()
(de-)activate selected items
special template class to simplify handling of ITX/PEAR
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
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
getPCDefinitionByType($a_pc_type)
Get PC definition by type.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
_doJSEditing()
checks if current user has activated js editing and if browser is js capable
& executeCommand()
execute command
static requirePCGUIClassByName($a_name)
Get instance.
setPageBackTitle($a_title)
isPCGUIClassName($a_class_name, $a_lower_case=false)
Is given class name a pc gui class?
pasteFromClipboard($a_hier_id)
paste from clipboard (redirects to clipboard)
getHeader()
get header title