ILIAS  release_8 Revision v8.24
ilPageEditorGUI Class Reference

Page Editor GUI class. More...

+ Collaboration diagram for ilPageEditorGUI:

Public Member Functions

 __construct (ilPageObject $a_page_object, ilPageObjectGUI $a_page_object_gui)
 
 setHeader (string $a_header)
 set header title More...
 
 getHeader ()
 
 returnToContext ()
 
 setIntLinkReturn (string $a_return)
 
 setPageBackTitle (string $a_title)
 
 executeCommand ()
 execute command More...
 
 activatePage ()
 
 deactivatePage ()
 
 setMediaMode ()
 set media and editing mode More...
 
 copyLinkedMediaToClipboard ()
 copy linked media object to clipboard More...
 
 copyLinkedMediaToMediaPool ()
 copy linked media object to media pool More...
 
 addChangeComment ()
 add change comment to history More...
 
 delete ()
 Confirm. More...
 
 cancelDeleteSelected ()
 
 confirmedDeleteSelected ()
 
 copy ()
 Copy selected items. More...
 
 cut ()
 Cut selected items. More...
 
 paste (string $a_hier_id)
 paste from clipboard (redirects to clipboard) More...
 
 activate ()
 (de-)activate selected items More...
 
 characteristic ()
 Assign characeristic to text blocks/sections. More...
 
 initCharacteristicForm (array $a_target, array $a_types)
 Init map creation/update form. More...
 
 assignCharacteristic ()
 
 pasteFromClipboard (string $a_hier_id)
 paste from clipboard (redirects to clipboard) More...
 
 insertFromClipboard ()
 insert object from clipboard More...
 
 displayPage ()
 Default for POST reloads and missing. More...
 
 showSnippetInfo ()
 Show snippet info. More...
 

Data Fields

ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilObjectDefinition $objDefinition
 
ilPageObject $page
 
string $target_script = ""
 
string $return_location = ""
 
string $header = ""
 
ilPageContent $cont_obj = null
 
bool $enable_keywords = false
 
bool $enable_anchors = false
 

Protected Attributes

ServerRequestInterface $http_request
 
EditGUIRequest $request
 
EditSessionRepository $edit_repo
 
ilPageContent $content_obj
 
ilPropertyFormGUI $form
 
string $page_back_title = ""
 
ilPageObjectGUI $page_gui
 
string $int_link_return = ""
 
ilTabsGUI $tabs_gui
 
ilHelpGUI $help
 
ilObjUser $user
 
ilAccessHandler $access
 
ilLogger $log
 
ILIAS DI UIServices $ui
 
ILIAS GlobalScreen ScreenContext ContextServices $tool_context
 
string $requested_hier_id
 
string $requested_pc_id
 
string $requested_pcid
 
string $requested_pl_pc_id
 
string $requested_ctype
 
string $requested_cname
 
int $requested_mob_id
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilPageEditorGUI::__construct ( ilPageObject  $a_page_object,
ilPageObjectGUI  $a_page_object_gui 
)

Definition at line 74 of file class.ilPageEditorGUI.php.

77 {
78 global $DIC;
79
80 $this->help = $DIC["ilHelp"];
81 $this->user = $DIC->user();
82 $this->access = $DIC->access();
83 $tpl = $DIC["tpl"];
84 $lng = $DIC->language();
85 $objDefinition = $DIC["objDefinition"];
86 $ilCtrl = $DIC->ctrl();
87 $ilTabs = $DIC->tabs();
88
89 $this->ui = $DIC->ui();
90
91 $this->request = $DIC->copage()->internal()->gui()->page()->editRequest();
92 $this->requested_hier_id = $this->request->getHierId();
93 $this->requested_pc_id = $this->request->getPCId();
94 $this->requested_pl_pc_id = $this->request->getPlaceholderPCId();
95 $this->requested_ctype = $this->request->getCType();
96 $this->requested_cname = $this->request->getCName();
97 $this->requested_mob_id = $this->request->getMobId();
98
99 $this->log = ilLoggerFactory::getLogger('copg');
100
101 $this->tool_context = $DIC->globalScreen()->tool()->context();
102
103 // initiate variables
104 $this->http_request = $DIC->http()->request();
105 $this->ctrl = $ilCtrl;
106 $this->tpl = $tpl;
107 $this->lng = $lng;
108 $this->objDefinition = $objDefinition;
109 $this->tabs_gui = $ilTabs;
110 $this->page = $a_page_object;
111 $this->page_gui = $a_page_object_gui;
112
113 $this->ctrl->saveParameter($this, array("hier_id", "pc_id"));
114
115 $this->edit_repo = $DIC
116 ->copage()
117 ->internal()
118 ->repo()
119 ->edit();
120 }
static getLogger(string $a_component_id)
Get component logger.
ilGlobalTemplateInterface $tpl
ilObjectDefinition $objDefinition
global $DIC
Definition: feed.php:28

References $DIC, $lng, $objDefinition, $tpl, ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ilLoggerFactory\getLogger(), ILIAS\Repository\help(), ILIAS\Repository\lng(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ activate()

ilPageEditorGUI::activate ( )

(de-)activate selected items

Definition at line 636 of file class.ilPageEditorGUI.php.

636 : void
637 {
638 $ids = $this->request->getIds();
639 if (count($ids) > 0) {
640 $updated = $this->page->switchEnableMultiple(
641 $ids,
642 true,
643 $this->page_gui->getPageConfig()->getEnableSelfAssessment()
644 );
645 if ($updated !== true) {
646 $this->edit_repo->setPageError($updated);
647 } else {
648 $this->edit_repo->clearPageError();
649 }
650 }
651 $this->ctrl->returnToParent($this);
652 }
int $updated
Timestamp for when the object was last updated.
Definition: System.php:158

References ILIAS\LTI\ToolProvider\$updated, and ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ activatePage()

ilPageEditorGUI::activatePage ( )

Definition at line 453 of file class.ilPageEditorGUI.php.

453 : void
454 {
455 $this->page_gui->activatePage();
456 }

◆ addChangeComment()

ilPageEditorGUI::addChangeComment ( )

add change comment to history

Definition at line 523 of file class.ilPageEditorGUI.php.

523 : void
524 {
526 $this->page->getId(),
527 "update",
528 [],
529 $this->page->getParentType() . ":pg",
530 $this->request->getString("change_comment"),
531 true
532 );
533 $this->tpl->setOnScreenMessage('success', $this->lng->txt("cont_added_comment"), true);
534 $this->ctrl->returnToParent($this);
535 }
static _createEntry(int $a_obj_id, string $a_action, array $a_info_params=[], string $a_obj_type="", string $a_user_comment="", bool $a_update_last=false)
Creates a new history entry for an object.

References ilHistory\_createEntry(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ assignCharacteristic()

ilPageEditorGUI::assignCharacteristic ( )

Definition at line 735 of file class.ilPageEditorGUI.php.

735 : void
736 {
737 $char_par = $this->request->getString("char_par");
738 $char_sec = $this->request->getString("char_sec");
739
740 $updated = $this->page->assignCharacteristic(
741 $this->request->getStringArray("target"),
742 $char_par,
743 $char_sec,
744 ""
745 );
746 if ($updated !== true) {
747 $this->edit_repo->setPageError($updated);
748 } else {
749 $this->edit_repo->clearPageError();
750 }
751 $this->ctrl->returnToParent($this);
752 }

References ILIAS\LTI\ToolProvider\$updated, and ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ cancelDeleteSelected()

ilPageEditorGUI::cancelDeleteSelected ( )

Definition at line 565 of file class.ilPageEditorGUI.php.

565 : void
566 {
567 $this->ctrl->returnToParent($this);
568 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ characteristic()

ilPageEditorGUI::characteristic ( )

Assign characeristic to text blocks/sections.

Definition at line 657 of file class.ilPageEditorGUI.php.

657 : void
658 {
661
662 $ids = $this->request->getIds();
663 if (count($ids) > 0) {
664 $types = array();
665
666 // check what content element types have been selected
667 foreach ($ids as $t) {
668 $tarr = explode(":", $t);
669 $cont_obj = $this->page->getContentObject($tarr[0], $tarr[1]);
670 if (is_object($cont_obj) && $cont_obj->getType() == "par") {
671 $types["par"] = "par";
672 }
673 if (is_object($cont_obj) && $cont_obj->getType() == "sec") {
674 $types["sec"] = "sec";
675 }
676 }
677
678 if (count($types) == 0) {
679 $this->tpl->setOnScreenMessage('failure', $lng->txt("cont_select_par_or_section"), true);
680 $this->ctrl->returnToParent($this);
681 } else {
682 $this->initCharacteristicForm($ids, $types);
683 $tpl->setContent($this->form->getHTML());
684 }
685 } else {
686 $this->ctrl->returnToParent($this);
687 }
688 }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
initCharacteristicForm(array $a_target, array $a_types)
Init map creation/update form.
setContent(string $a_html)
Sets content for standard template.
form( $class_path, string $cmd)

References $cont_obj, $lng, $tpl, ILIAS\Repository\ctrl(), ILIAS\Repository\form(), ilPageContent\getType(), initCharacteristicForm(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ confirmedDeleteSelected()

ilPageEditorGUI::confirmedDeleteSelected ( )

Definition at line 570 of file class.ilPageEditorGUI.php.

570 : void
571 {
572 $targets = $this->request->getIds();
573 if (count($targets) > 0) {
574 $updated = $this->page->deleteContents(
575 $targets,
576 true,
577 $this->page_gui->getPageConfig()->getEnableSelfAssessment()
578 );
579 if ($updated !== true) {
580 $this->edit_repo->setPageError($updated);
581 } else {
582 $this->edit_repo->clearPageError();
583 }
584 }
585 $this->ctrl->returnToParent($this);
586 }

References ILIAS\LTI\ToolProvider\$updated, and ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ copy()

ilPageEditorGUI::copy ( )

Copy selected items.

Definition at line 591 of file class.ilPageEditorGUI.php.

591 : void
592 {
594
595 $ids = $this->request->getIds();
596 if (count($ids) > 0) {
597 $this->page->copyContents($ids);
598 $this->tpl->setOnScreenMessage('success', $lng->txt("cont_sel_el_copied_use_paste"), true);
599 }
600 $this->ctrl->returnToParent($this);
601 }

References $lng, ILIAS\Repository\ctrl(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ copyLinkedMediaToClipboard()

ilPageEditorGUI::copyLinkedMediaToClipboard ( )

copy linked media object to clipboard

Definition at line 498 of file class.ilPageEditorGUI.php.

498 : void
499 {
501
502 $this->tpl->setOnScreenMessage('success', $this->lng->txt("copied_to_clipboard"), true);
503 $ilUser->addObjectToClipboard(
504 $this->requested_mob_id,
505 "mob",
506 ilObject::_lookupTitle($this->requested_mob_id)
507 );
508 $this->ctrl->returnToParent($this);
509 }
static _lookupTitle(int $obj_id)
$ilUser
Definition: imgupload.php:34

References $ilUser, $user, ilObject\_lookupTitle(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ copyLinkedMediaToMediaPool()

ilPageEditorGUI::copyLinkedMediaToMediaPool ( )

copy linked media object to media pool

Definition at line 514 of file class.ilPageEditorGUI.php.

514 : void
515 {
516 $this->ctrl->setParameterByClass("ilmediapooltargetselector", "mob_id", $this->requested_mob_id);
517 $this->ctrl->redirectByClass("ilmediapooltargetselector", "listPools");
518 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ cut()

ilPageEditorGUI::cut ( )

Cut selected items.

Definition at line 606 of file class.ilPageEditorGUI.php.

606 : void
607 {
609
610 $ids = $this->request->getIds();
611 if (count($ids)) {
612 $updated = $this->page->cutContents($ids);
613 if ($updated !== true) {
614 $this->edit_repo->setPageError($updated);
615 } else {
616 $this->edit_repo->clearPageError();
617 }
618 $this->tpl->setOnScreenMessage('success', $lng->txt("cont_sel_el_cut_use_paste"), true);
619 }
620 $this->ctrl->returnToParent($this);
621 }

References $lng, ILIAS\LTI\ToolProvider\$updated, ILIAS\Repository\ctrl(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ deactivatePage()

ilPageEditorGUI::deactivatePage ( )

Definition at line 458 of file class.ilPageEditorGUI.php.

458 : void
459 {
460 $this->page_gui->deactivatePage();
461 }

◆ delete()

ilPageEditorGUI::delete ( )

Confirm.

Definition at line 540 of file class.ilPageEditorGUI.php.

540 : void
541 {
542 $ilCtrl = $this->ctrl;
545
546 $targets = $this->request->getIds();
547
548 if (count($targets) == 0) {
549 $this->tpl->setOnScreenMessage('info', $lng->txt("no_checkbox"), true);
550 $this->ctrl->returnToParent($this);
551 } else {
552 $cgui = new ilConfirmationGUI();
553 $cgui->setFormAction($ilCtrl->getFormAction($this));
554 $cgui->setHeaderText($lng->txt("copg_confirm_el_deletion"));
555 $cgui->setCancel($lng->txt("cancel"), "cancelDeleteSelected");
556 $cgui->setConfirm($lng->txt("confirm"), "confirmedDeleteSelected");
557 foreach ($targets as $t) {
558 $cgui->addHiddenItem("ids[]", $t);
559 }
560
561 $tpl->setContent($cgui->getHTML());
562 }
563 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $ctrl, $lng, $tpl, ILIAS\Repository\ctrl(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ displayPage()

ilPageEditorGUI::displayPage ( )

Default for POST reloads and missing.

Definition at line 816 of file class.ilPageEditorGUI.php.

816 : void
817 {
818 $this->ctrl->returnToParent($this);
819 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ executeCommand()

ilPageEditorGUI::executeCommand ( )

execute command

Definition at line 153 of file class.ilPageEditorGUI.php.

153 : string
154 {
155 $ilCtrl = $this->ctrl;
156 $ilHelp = $this->help;
157 $this->log->debug("begin =========================");
158 $ctype = "";
159 $cont_obj = null;
160
161 $ret = "";
162 $add_type = "";
163
164 // Step BC (basic command determination)
165 // determine cmd, cmdClass, hier_id and pc_id
166 $cmd = $this->ctrl->getCmd("displayPage");
167 $cmdClass = strtolower($this->ctrl->getCmdClass());
168
169 $hier_id = $this->requested_hier_id;
170 $pc_id = $this->requested_pc_id;
171 $new_hier_id = $this->request->getString("new_hier_id");
172 if ($new_hier_id != "") {
173 $hier_id = $new_hier_id;
174 }
175
176 $this->log->debug("step BC: cmd:$cmd, cmdClass:$cmdClass, hier_id: $hier_id, pc_id: $pc_id");
177
178 // Step EC (exec_ command handling)
179 // handle special exec_ commands, modify pc, hier_id
180 if (substr($cmd, 0, 5) == "exec_") {
181 // check whether pc id is given
182 $pca = explode(":", $this->ctrl->getCmd());
183 $pc_id = $pca[1];
184 $cmd = explode("_", $pca[0]);
185 unset($cmd[0]);
186 $hier_id = implode("_", $cmd);
187 $cmd = $this->request->getString("command" . $hier_id);
188 }
189 $this->log->debug("step EC: cmd:$cmd, hier_id: $hier_id, pc_id: $pc_id");
190
191 // Step CC (handle table container (and similar) commands
192 // ... strip "c" "r" of table ids from hierarchical id
193 $first_hier_character = substr($hier_id, 0, 1);
194 if ($first_hier_character == "c" ||
195 $first_hier_character == "r" ||
196 $first_hier_character == "g" ||
197 $first_hier_character == "i") {
198 $hier_id = substr($hier_id, 1);
199 }
200 $this->log->debug("step CC: cmd:$cmd, hier_id: $hier_id, pc_id: $pc_id");
201
202 // Step B (build dom, and ids in XML)
203 $this->page->buildDom();
204 $this->page->addHierIDs();
205
206
207 // Step CS (strip base command)
208 $com = null;
209 if ($cmdClass != "ilfilesystemgui") {
210 $com = explode("_", $cmd);
211 $cmd = $com[0];
212 }
213 $this->log->debug("step CS: cmd:$cmd");
214
215
216 // Step NC (determine next class)
217 $next_class = $this->ctrl->getNextClass($this);
218 $this->log->debug("step NC: next class: " . $next_class);
219
220
221 // Step PH (placeholder handling, placeholders from preview mode come without hier_id)
222 if ($next_class == "ilpcplaceholdergui" && $hier_id == "" && $this->requested_pl_pc_id != "") {
223 $hid = $this->page->getHierIdsForPCIds(array($this->requested_pl_pc_id));
224 $hier_id = $hid[$this->requested_pl_pc_id];
225 }
226 $this->log->debug("step PH: next class: " . $next_class);
227
228 if (!is_null($com) && ($com[0] == "insert" || $com[0] == "create")) {
229 // Step CM (creation mode handling)
230 $cmd = $com[0];
231 $ctype = $com[1] ?? ""; // note ctype holds type if cmdclass is empty, but also subcommands if not (e.g. applyFilter in ilpcmediaobjectgui)
232 $add_type = $this->request->getString("pluginName");
233 if ($ctype == "mob") {
234 $ctype = "media";
235 }
236
237 $this->log->debug("step CM: cmd: " . $cmd . ", ctype: " . $ctype . ", add_type: " . $add_type);
238 } else {
239 $this->log->debug("step LM: cmd: " . $cmd . ", cmdClass: " . $cmdClass);
240
241 // Step PR (get content object and return to parent)
242 $this->log->debug("before PR: cmdClass: $cmdClass, nextClass: $next_class" .
243 ", hier_id: " . $hier_id . ", pc_id: " . $pc_id . ")");
244 // note: ilinternallinkgui for page: no cont_obj is received
245 // ilinternallinkgui for mob: cont_obj is received
246 if ($this->requested_ctype == "" && $this->requested_cname == "" &&
247 $cmd != "insertFromClipboard" && $cmd != "pasteFromClipboard" &&
248 $cmd != "setMediaMode" && $cmd != "copyLinkedMediaToClipboard" &&
249 $cmd != "activatePage" && $cmd != "deactivatePage" &&
250 $cmd != "copyLinkedMediaToMediaPool" && $cmd != "showSnippetInfo" &&
251 $cmd != "delete" && $cmd != "paste" &&
252 $cmd != "cancelDeleteSelected" && $cmd != "confirmedDeleteSelected" &&
253 $cmd != "copy" && $cmd != "cut" &&
254 ($cmd != "displayPage" || $this->request->getString("editImagemapForward_x") != "") &&
255 $cmd != "activate" && $cmd != "characteristic" &&
256 $cmd != "assignCharacteristic" &&
257 $cmdClass != "ilrepositoryselector2inputgui" &&
258 $cmdClass != "ilpageeditorserveradaptergui" &&
259 $cmd != "cancelCreate" && $cmd != "popup" &&
260 $cmdClass != "ileditclipboardgui" && $cmd != "addChangeComment" &&
261 ($cmdClass != "ilinternallinkgui" || ($next_class == "ilpcmediaobjectgui"))) {
262 $cont_obj = $this->page->getContentObject($hier_id, $pc_id);
263 if (!is_object($cont_obj)) {
264 $this->log->debug("returnToParent");
265 $ilCtrl->returnToParent($this);
266 }
267 $ctype = $cont_obj->getType();
268 }
269 }
270
271 // Step NC (handle empty next class)
272 if ($this->requested_ctype != "" || $this->requested_cname != "") {
273 $ctype = $this->requested_ctype;
274 if ($this->requested_cname != "") {
275 $pc_def = ilCOPagePCDef::getPCDefinitionByName($this->requested_cname);
276 $ctype = $pc_def["pc_type"];
277 }
278 $pc_id = $this->requested_pc_id;
279 $hier_id = $this->requested_hier_id;
280 if (!in_array($cmd, ["insert", "create"])) {
281 $cont_obj = $this->page->getContentObject($hier_id, $pc_id);
282 }
283 }
284 // this fixes e.g. #31214
285 if ($pc_id != "" && $hier_id == "") {
286 $hier_id = $this->page->getHierIdForPcId($pc_id);
287 }
288 if ($ctype != "media" || !is_object($cont_obj)) {
289 if ($this->getHeader() != "") {
290 $this->tpl->setTitle($this->getHeader());
291 }
292 }
293
294 $this->cont_obj = $cont_obj;
295
296
297 $this->ctrl->setParameter($this, "hier_id", $hier_id);
298 $this->ctrl->setParameter($this, "pc_id", $pc_id);
299 $this->ctrl->setCmd($cmd);
300 if ($next_class == "") {
301 $pc_def = ilCOPagePCDef::getPCDefinitionByType($ctype);
302 if (is_array($pc_def)) {
303 $this->ctrl->setCmdClass($pc_def["pc_gui_class"]);
304 }
305 $next_class = $this->ctrl->getNextClass($this);
306 }
307 $this->log->debug("step NC2: next_class: $next_class");
308
309 // ... do not do this while imagemap editing is ongoing
310 // Step IM (handle image map editing)
311 if ($cmd == "displayPage" &&
312 $this->request->getString("editImagemapForward_x") == ""
313 && $this->request->getString("imagemap_x") == "") {
314 $next_class = "";
315 }
316
317
318 switch ($next_class) {
319 case "ilinternallinkgui":
320 $link_gui = new ilInternalLinkGUI(
321 $this->page_gui->getPageConfig()->getIntLinkHelpDefaultType(),
322 $this->page_gui->getPageConfig()->getIntLinkHelpDefaultId(),
323 $this->page_gui->getPageConfig()->getIntLinkHelpDefaultIdIsRef()
324 );
325 $link_gui->setFilterWhiteList(
326 $this->page_gui->getPageConfig()->getIntLinkFilterWhiteList()
327 );
328 foreach ($this->page_gui->getPageConfig()->getIntLinkFilters() as $filter) {
329 $link_gui->filterLinkType($filter);
330 }
331 $link_gui->setReturn($this->int_link_return);
332
333 $ret = $this->ctrl->forwardCommand($link_gui);
334 break;
335
336 // PC Media Object
337 case "ilpcmediaobjectgui":
338 $this->tabs_gui->clearTargets();
339 $this->tabs_gui->setBackTarget(
340 $this->page_gui->page_back_title,
341 $ilCtrl->getLinkTarget($this->page_gui, "edit")
342 );
343 $pcmob_gui = new ilPCMediaObjectGUI($this->page, $cont_obj, $hier_id, $pc_id);
344 $pcmob_gui->setStyleId($this->page_gui->getStyleId());
345 $pcmob_gui->setSubCmd($ctype);
346 $pcmob_gui->setEnabledMapAreas($this->page_gui->getPageConfig()->getEnableInternalLinks());
347 $ret = $this->ctrl->forwardCommand($pcmob_gui);
348 $ilHelp->setScreenIdComponent("copg_media");
349 break;
350
351 // only for "linked" media
352 case "ilobjmediaobjectgui":
353 $this->tabs_gui->clearTargets();
354 $this->tabs_gui->setBackTarget(
355 $this->lng->txt("back"),
356 (string) $ilCtrl->getParentReturn($this)
357 );
358 $mob_gui = new ilObjMediaObjectGUI("", $this->requested_mob_id, false, false);
359 $mob_gui->getTabs();
360 $mob_gui->setEnabledMapAreas($this->page_gui->getPageConfig()->getEnableInternalLinks());
361 $this->tpl->setTitle($this->lng->txt("mob") . ": " .
362 ilObject::_lookupTitle($this->requested_mob_id));
363 $ret = $this->ctrl->forwardCommand($mob_gui);
364 break;
365
366 // Question
367 case "ilpcquestiongui":
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());
371
372 if ($this->page_gui->getPageConfig()->getEnableSelfAssessment()) {
373 $this->tabs_gui->clearTargets();
374 $ilHelp->setScreenIdComponent("copg_pcqst");
375 $this->tabs_gui->setBackTarget(
376 $this->lng->txt("back"),
377 (string) $ilCtrl->getParentReturn($this)
378 );
379 $ret = $this->ctrl->forwardCommand($pc_question_gui);
380 } else {
381 $cmd = $this->ctrl->getCmd();
382 $pc_question_gui->$cmd();
383 $this->ctrl->redirectByClass(array("ilobjquestionpoolgui", get_class($cont_obj)), "editQuestion");
384 }
385 break;
386
387 // Plugged Component
388 case "ilpcpluggedgui":
389 $this->tabs_gui->clearTargets();
390 $plugged_gui = new ilPCPluggedGUI(
391 $this->page,
392 $cont_obj,
393 $hier_id,
394 $add_type,
395 $pc_id
396 );
397 $ret = $this->ctrl->forwardCommand($plugged_gui);
398 break;
399
400 case "ilpageeditorserveradaptergui":
401 $adapter = new ilPageEditorServerAdapterGUI(
402 $this->page_gui,
403 $this->ctrl,
404 $this->ui,
405 $this->http_request
406 );
407 $this->ctrl->forwardCommand($adapter);
408 break;
409
410 default:
411
412 // generic calls to gui classes
413 if (ilCOPagePCDef::isPCGUIClassName($next_class, true)) {
414 $this->log->debug("Generic Call");
416 $this->tabs_gui->clearTargets();
417 $this->tabs_gui->setBackTarget(
418 $this->page_gui->page_back_title,
419 $ilCtrl->getLinkTarget($this->page_gui, "edit")
420 );
421 $ilHelp->setScreenIdComponent("copg_" . $pc_def["pc_type"]);
422 //ilCOPagePCDef::requirePCGUIClassByName($pc_def["name"]);
423 $gui_class_name = $pc_def["pc_gui_class"];
424 $pc_gui = new $gui_class_name($this->page, $cont_obj, $hier_id, $pc_id);
425 if ($pc_def["style_classes"]) {
426 $pc_gui->setStyleId($this->page_gui->getStyleId());
427 }
428 $pc_gui->setPageConfig($this->page_gui->getPageConfig());
429 $ret = $this->ctrl->forwardCommand($pc_gui);
430 } else {
431 $this->log->debug("Call ilPageEditorGUI command.");
432 // cmd belongs to ilPageEditorGUI
433
434 if ($cmd == "pasteFromClipboard") {
435 //$ret = $this->pasteFromClipboard($hier_id);
436 $this->pasteFromClipboard($hier_id);
437 } elseif ($cmd == "paste") {
438 //$ret = $this->paste($hier_id);
439 $this->paste($hier_id);
440 } else {
441 $ret = $this->$cmd();
442 }
443 }
444 break;
445
446 }
447
448 $this->log->debug("end --------------------");
449
450 return (string) $ret;
451 }
static getPCDefinitionByName(string $a_pc_name)
Get PC definition by name.
static getPCDefinitionByType(string $a_pc_type)
Get PC definition by type.
static isPCGUIClassName(string $a_class_name, bool $a_lower_case=false)
static getPCDefinitionByGUIClassName(string $a_gui_class_name)
Get PC definition by name.
Internal link selector.
Editing User Interface for MediaObjects within LMs (see ILIAS DTD)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
paste(string $a_hier_id)
paste from clipboard (redirects to clipboard)
pasteFromClipboard(string $a_hier_id)
paste from clipboard (redirects to clipboard)

References $cont_obj, $ctrl, $help, $requested_ctype, $requested_hier_id, $requested_pc_id, $requested_pl_pc_id, ilObject\_lookupTitle(), ILIAS\Repository\ctrl(), getHeader(), ilCOPagePCDef\getPCDefinitionByGUIClassName(), ilCOPagePCDef\getPCDefinitionByName(), ilCOPagePCDef\getPCDefinitionByType(), ilPageContent\getType(), ilCOPagePCDef\isPCGUIClassName(), ILIAS\Repository\lng(), paste(), pasteFromClipboard(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ getHeader()

ilPageEditorGUI::getHeader ( )

Definition at line 130 of file class.ilPageEditorGUI.php.

130 : string
131 {
132 return $this->header;
133 }

References $header.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ initCharacteristicForm()

ilPageEditorGUI::initCharacteristicForm ( array  $a_target,
array  $a_types 
)

Init map creation/update form.

Definition at line 693 of file class.ilPageEditorGUI.php.

696 : void {
697 $ilCtrl = $this->ctrl;
699
700
701 // edit form
702 $this->form = new ilPropertyFormGUI();
703 $this->form->setTitle($this->lng->txt("cont_choose_characteristic"));
704
705 if ($a_types["par"] == "par") {
706 $select_prop = new ilSelectInputGUI(
707 $this->lng->txt("cont_choose_characteristic_text"),
708 "char_par"
709 );
710 $options = ilPCParagraphGUI::_getCharacteristics($this->page_gui->getStyleId());
711 $select_prop->setOptions($options);
712 $this->form->addItem($select_prop);
713 }
714 if ($a_types["sec"] == "sec") {
715 $select_prop = new ilSelectInputGUI(
716 $this->lng->txt("cont_choose_characteristic_section"),
717 "char_sec"
718 );
719 $options = ilPCSectionGUI::_getCharacteristics($this->page_gui->getStyleId());
720 $select_prop->setOptions($options);
721 $this->form->addItem($select_prop);
722 }
723
724 foreach ($a_target as $t) {
725 $hidden = new ilHiddenInputGUI("target[]");
726 $hidden->setValue($t);
727 $this->form->addItem($hidden);
728 }
729
730 $this->form->setFormAction($ilCtrl->getFormAction($this));
731 $this->form->addCommandButton("assignCharacteristic", $lng->txt("save"));
732 $this->form->addCommandButton("showPage", $lng->txt("cancel"));
733 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getCharacteristics(int $a_style_id)
Get characteristics.
static _getCharacteristics(string $a_style_id)
This class represents a property form user interface.
This class represents a selection list property in a property form.

Referenced by characteristic().

+ Here is the caller graph for this function:

◆ insertFromClipboard()

ilPageEditorGUI::insertFromClipboard ( )

insert object from clipboard

Exceptions
ilDateTimeException

Definition at line 781 of file class.ilPageEditorGUI.php.

781 : void
782 {
784
785 $hier_id = $this->page->getHierIdForPcId($this->requested_pc_id);
786 if ($hier_id == "") {
787 $hier_id = "pg";
788 }
789
790 if ($ids != "") {
791 foreach ($ids as $id2) {
792 $id = explode(":", $id2);
793 $type = $id[0];
794 $id = $id[1];
795 if ($type == "mob") {
796 $this->content_obj = new ilPCMediaObject($this->page);
797 $this->content_obj->readMediaObject($id);
798 $this->content_obj->createAlias($this->page, $hier_id);
799 $this->page->update();
800 }
801 if ($type == "incl") {
802 $this->content_obj = new ilPCContentInclude($this->page);
803 $this->content_obj->create($this->page, $hier_id);
804 $this->content_obj->setContentType("mep");
805 $this->content_obj->setContentId($id);
806 $this->page->update();
807 }
808 }
809 }
810 $this->ctrl->returnToParent($this);
811 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilPCMediaObject Media content object (see ILIAS DTD)
$type

References $id, $type, ilEditClipboardGUI\_getSelectedIDs(), and ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ paste()

ilPageEditorGUI::paste ( string  $a_hier_id)

paste from clipboard (redirects to clipboard)

Definition at line 626 of file class.ilPageEditorGUI.php.

626 : void
627 {
628 $this->page->pasteContents($a_hier_id, $this->page_gui->getPageConfig()->getEnableSelfAssessment());
629 //ilEditClipboard::setAction("");
630 $this->ctrl->returnToParent($this);
631 }

References ILIAS\Repository\ctrl().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pasteFromClipboard()

ilPageEditorGUI::pasteFromClipboard ( string  $a_hier_id)

paste from clipboard (redirects to clipboard)

Definition at line 757 of file class.ilPageEditorGUI.php.

757 : void
758 {
759 $ilCtrl = $this->ctrl;
760 //var_dump($a_hier_id);
761 $ilCtrl->setParameter($this, "hier_id", $a_hier_id);
762 $ilCtrl->setParameterByClass(
763 "ilEditClipboardGUI",
764 "returnCommand",
765 rawurlencode($ilCtrl->getLinkTarget(
766 $this,
767 "insertFromClipboard",
768 "",
769 false,
770 false
771 ))
772 );
773 //echo ":".$ilCtrl->getLinkTarget($this, "insertFromClipboard").":";
774 $ilCtrl->redirectByClass("ilEditClipboardGUI", "getObject");
775 }
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ returnToContext()

ilPageEditorGUI::returnToContext ( )

Definition at line 135 of file class.ilPageEditorGUI.php.

135 : void
136 {
137 $this->ctrl->returnToParent($this);
138 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ setHeader()

ilPageEditorGUI::setHeader ( string  $a_header)

set header title

Definition at line 125 of file class.ilPageEditorGUI.php.

125 : void
126 {
127 $this->header = $a_header;
128 }

◆ setIntLinkReturn()

ilPageEditorGUI::setIntLinkReturn ( string  $a_return)

Definition at line 140 of file class.ilPageEditorGUI.php.

140 : void
141 {
142 $this->int_link_return = $a_return;
143 }

◆ setMediaMode()

ilPageEditorGUI::setMediaMode ( )

set media and editing mode

Definition at line 466 of file class.ilPageEditorGUI.php.

466 : void
467 {
469
470 $ilUser->writePref(
471 "ilPageEditor_MediaMode",
472 $this->request->getString("media_mode")
473 );
474 $ilUser->writePref(
475 "ilPageEditor_HTMLMode",
476 $this->request->getString("html_mode")
477 );
478 $js_mode = $this->request->getString("js_mode");
479 if ($ilUser->getPref("ilPageEditor_JavaScript") != $js_mode) {
480 // not nice, should be solved differently in the future
481 if ($this->page->getParentType() == "lm") {
482 $this->ctrl->setParameterByClass("illmpageobjectgui", "reloadTree", "y");
483 }
484 }
485 $ilUser->writePref("ilPageEditor_JavaScript", $js_mode);
486
487 // again not so nice...
488 if ($this->page->getParentType() == "lm") {
489 $this->ctrl->redirectByClass("illmpageobjectgui", "edit");
490 } else {
491 $this->ctrl->returnToParent($this);
492 }
493 }

References $ilUser, $user, and ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ setPageBackTitle()

ilPageEditorGUI::setPageBackTitle ( string  $a_title)

Definition at line 145 of file class.ilPageEditorGUI.php.

145 : void
146 {
147 $this->page_back_title = $a_title;
148 }

◆ showSnippetInfo()

ilPageEditorGUI::showSnippetInfo ( )

Show snippet info.

Definition at line 824 of file class.ilPageEditorGUI.php.

824 : void
825 {
828 $ilAccess = $this->access;
829 $ilCtrl = $this->ctrl;
830
831 $stpl = new ilTemplate("tpl.snippet_info.html", true, true, "Services/COPage");
832
834 $this->request->getString("ci_id")
835 );
836 foreach ($mep_pools as $mep_id) {
837 $ref_ids = ilObject::_getAllReferences($mep_id);
838 $edit_link = false;
839 foreach ($ref_ids as $rid) {
840 if (!$edit_link && $ilAccess->checkAccess("write", "", $rid)) {
841 $stpl->setCurrentBlock("edit_link");
842 $stpl->setVariable("TXT_EDIT", $lng->txt("edit"));
843 $stpl->setVariable(
844 "HREF_EDIT",
845 "./goto.php?target=mep_" . $rid
846 );
847 $stpl->parseCurrentBlock();
848 }
849 }
850 $stpl->setCurrentBlock("pool");
851 $stpl->setVariable("TXT_MEDIA_POOL", $lng->txt("obj_mep"));
852 $stpl->setVariable("VAL_MEDIA_POOL", ilObject::_lookupTitle($mep_id));
853 $stpl->parseCurrentBlock();
854 }
855
856 $stpl->setVariable("TXT_TITLE", $lng->txt("title"));
857 $stpl->setVariable(
858 "VAL_TITLE",
859 ilMediaPoolPage::lookupTitle($this->request->getString("ci_id"))
860 );
861 $stpl->setVariable("TXT_BACK", $lng->txt("back"));
862 $stpl->setVariable(
863 "HREF_BACK",
864 $ilCtrl->getLinkTarget($this->page_gui, "edit")
865 );
866 $tpl->setContent($stpl->get());
867 }
static getPoolForItemId(int $a_id)
static lookupTitle(int $a_page_id)
static _getAllReferences(int $id)
get all reference ids for object ID
ilAccessHandler $access
special template class to simplify handling of ITX/PEAR

References $lng, $tpl, ilObject\_getAllReferences(), ilObject\_lookupTitle(), ilMediaPoolItem\getPoolForItemId(), and ilMediaPoolPage\lookupTitle().

+ Here is the call graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilPageEditorGUI::$access
protected

Definition at line 51 of file class.ilPageEditorGUI.php.

◆ $cont_obj

ilPageContent ilPageEditorGUI::$cont_obj = null

Definition at line 60 of file class.ilPageEditorGUI.php.

Referenced by characteristic(), and executeCommand().

◆ $content_obj

ilPageContent ilPageEditorGUI::$content_obj
protected

Definition at line 43 of file class.ilPageEditorGUI.php.

◆ $ctrl

ilCtrl ilPageEditorGUI::$ctrl

Definition at line 54 of file class.ilPageEditorGUI.php.

Referenced by delete(), and executeCommand().

◆ $edit_repo

EditSessionRepository ilPageEditorGUI::$edit_repo
protected

Definition at line 42 of file class.ilPageEditorGUI.php.

◆ $enable_anchors

bool ilPageEditorGUI::$enable_anchors = false

Definition at line 62 of file class.ilPageEditorGUI.php.

◆ $enable_keywords

bool ilPageEditorGUI::$enable_keywords = false

Definition at line 61 of file class.ilPageEditorGUI.php.

◆ $form

ilPropertyFormGUI ilPageEditorGUI::$form
protected

Definition at line 44 of file class.ilPageEditorGUI.php.

◆ $header

string ilPageEditorGUI::$header = ""

Definition at line 59 of file class.ilPageEditorGUI.php.

Referenced by getHeader().

◆ $help

ilHelpGUI ilPageEditorGUI::$help
protected

Definition at line 49 of file class.ilPageEditorGUI.php.

Referenced by executeCommand().

◆ $http_request

ServerRequestInterface ilPageEditorGUI::$http_request
protected

Definition at line 40 of file class.ilPageEditorGUI.php.

◆ $int_link_return

string ilPageEditorGUI::$int_link_return = ""
protected

Definition at line 47 of file class.ilPageEditorGUI.php.

◆ $lng

ilLanguage ilPageEditorGUI::$lng

Definition at line 53 of file class.ilPageEditorGUI.php.

Referenced by __construct(), characteristic(), copy(), cut(), and delete().

◆ $log

ilLogger ilPageEditorGUI::$log
protected

Definition at line 63 of file class.ilPageEditorGUI.php.

◆ $objDefinition

ilObjectDefinition ilPageEditorGUI::$objDefinition

Definition at line 55 of file class.ilPageEditorGUI.php.

Referenced by __construct().

◆ $page

ilPageObject ilPageEditorGUI::$page

Definition at line 56 of file class.ilPageEditorGUI.php.

◆ $page_back_title

string ilPageEditorGUI::$page_back_title = ""
protected

Definition at line 45 of file class.ilPageEditorGUI.php.

◆ $page_gui

ilPageObjectGUI ilPageEditorGUI::$page_gui
protected

Definition at line 46 of file class.ilPageEditorGUI.php.

◆ $request

EditGUIRequest ilPageEditorGUI::$request
protected

Definition at line 41 of file class.ilPageEditorGUI.php.

◆ $requested_cname

string ilPageEditorGUI::$requested_cname
protected

Definition at line 71 of file class.ilPageEditorGUI.php.

◆ $requested_ctype

string ilPageEditorGUI::$requested_ctype
protected

Definition at line 70 of file class.ilPageEditorGUI.php.

Referenced by executeCommand().

◆ $requested_hier_id

string ilPageEditorGUI::$requested_hier_id
protected

Definition at line 66 of file class.ilPageEditorGUI.php.

Referenced by executeCommand().

◆ $requested_mob_id

int ilPageEditorGUI::$requested_mob_id
protected

Definition at line 72 of file class.ilPageEditorGUI.php.

◆ $requested_pc_id

string ilPageEditorGUI::$requested_pc_id
protected

Definition at line 67 of file class.ilPageEditorGUI.php.

Referenced by executeCommand().

◆ $requested_pcid

string ilPageEditorGUI::$requested_pcid
protected

Definition at line 68 of file class.ilPageEditorGUI.php.

◆ $requested_pl_pc_id

string ilPageEditorGUI::$requested_pl_pc_id
protected

Definition at line 69 of file class.ilPageEditorGUI.php.

Referenced by executeCommand().

◆ $return_location

string ilPageEditorGUI::$return_location = ""

Definition at line 58 of file class.ilPageEditorGUI.php.

◆ $tabs_gui

ilTabsGUI ilPageEditorGUI::$tabs_gui
protected

Definition at line 48 of file class.ilPageEditorGUI.php.

◆ $target_script

string ilPageEditorGUI::$target_script = ""

Definition at line 57 of file class.ilPageEditorGUI.php.

◆ $tool_context

ILIAS GlobalScreen ScreenContext ContextServices ilPageEditorGUI::$tool_context
protected

Definition at line 65 of file class.ilPageEditorGUI.php.

◆ $tpl

ilGlobalTemplateInterface ilPageEditorGUI::$tpl

Definition at line 52 of file class.ilPageEditorGUI.php.

Referenced by __construct(), characteristic(), and delete().

◆ $ui

ILIAS DI UIServices ilPageEditorGUI::$ui
protected

Definition at line 64 of file class.ilPageEditorGUI.php.

◆ $user

ilObjUser ilPageEditorGUI::$user
protected

Definition at line 50 of file class.ilPageEditorGUI.php.

Referenced by copyLinkedMediaToClipboard(), and setMediaMode().


The documentation for this class was generated from the following file: