ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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

ILIAS COPage PC PCDefinition $pc_definition
 
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 75 of file class.ilPageEditorGUI.php.

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().

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

Member Function Documentation

◆ activate()

ilPageEditorGUI::activate ( )

(de-)activate selected items

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

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

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

◆ activatePage()

ilPageEditorGUI::activatePage ( )

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

457  : void
458  {
459  $this->page_gui->activatePage();
460  }

◆ addChangeComment()

ilPageEditorGUI::addChangeComment ( )

add change comment to history

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

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

521  : void
522  {
524  $this->page->getId(),
525  "update",
526  [],
527  $this->page->getParentType() . ":pg",
528  $this->request->getString("change_comment"),
529  true
530  );
531  $this->tpl->setOnScreenMessage('success', $this->lng->txt("cont_added_comment"), true);
532  $this->ctrl->returnToParent($this);
533  }
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.
+ Here is the call graph for this function:

◆ assignCharacteristic()

ilPageEditorGUI::assignCharacteristic ( )

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

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

733  : void
734  {
735  $char_par = $this->request->getString("char_par");
736  $char_sec = $this->request->getString("char_sec");
737 
738  $updated = $this->page->assignCharacteristic(
739  $this->request->getStringArray("target"),
740  $char_par,
741  $char_sec,
742  ""
743  );
744  if ($updated !== true) {
745  $this->edit_repo->setPageError($updated);
746  } else {
747  $this->edit_repo->clearPageError();
748  }
749  $this->ctrl->returnToParent($this);
750  }
int $updated
Timestamp for when the object was last updated.
Definition: System.php:158
+ Here is the call graph for this function:

◆ cancelDeleteSelected()

ilPageEditorGUI::cancelDeleteSelected ( )

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

References ILIAS\Repository\ctrl().

563  : void
564  {
565  $this->ctrl->returnToParent($this);
566  }
+ Here is the call graph for this function:

◆ characteristic()

ilPageEditorGUI::characteristic ( )

Assign characeristic to text blocks/sections.

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

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

655  : void
656  {
657  $tpl = $this->tpl;
658  $lng = $this->lng;
659 
660  $ids = $this->request->getIds();
661  if (count($ids) > 0) {
662  $types = array();
663 
664  // check what content element types have been selected
665  foreach ($ids as $t) {
666  $tarr = explode(":", $t);
667  $cont_obj = $this->page->getContentObject($tarr[0], $tarr[1]);
668  if (is_object($cont_obj) && $cont_obj->getType() == "par") {
669  $types["par"] = "par";
670  }
671  if (is_object($cont_obj) && $cont_obj->getType() == "sec") {
672  $types["sec"] = "sec";
673  }
674  }
675 
676  if (count($types) == 0) {
677  $this->tpl->setOnScreenMessage('failure', $lng->txt("cont_select_par_or_section"), true);
678  $this->ctrl->returnToParent($this);
679  } else {
680  $this->initCharacteristicForm($ids, $types);
681  $tpl->setContent($this->form->getHTML());
682  }
683  } else {
684  $this->ctrl->returnToParent($this);
685  }
686  }
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.
ilGlobalTemplateInterface $tpl
form( $class_path, string $cmd, string $submit_caption="")
+ Here is the call graph for this function:

◆ confirmedDeleteSelected()

ilPageEditorGUI::confirmedDeleteSelected ( )

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

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

568  : void
569  {
570  $targets = $this->request->getIds();
571  if (count($targets) > 0) {
572  $updated = $this->page->deleteContents(
573  $targets,
574  true,
575  $this->page_gui->getPageConfig()->getEnableSelfAssessment()
576  );
577  if ($updated !== true) {
578  $this->edit_repo->setPageError($updated);
579  } else {
580  $this->edit_repo->clearPageError();
581  }
582  }
583  $this->ctrl->returnToParent($this);
584  }
int $updated
Timestamp for when the object was last updated.
Definition: System.php:158
+ Here is the call graph for this function:

◆ copy()

ilPageEditorGUI::copy ( )

Copy selected items.

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

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

589  : void
590  {
591  $lng = $this->lng;
592 
593  $ids = $this->request->getIds();
594  if (count($ids) > 0) {
595  $this->page->copyContents($ids);
596  $this->tpl->setOnScreenMessage('success', $lng->txt("cont_sel_el_copied_use_paste"), true);
597  }
598  $this->ctrl->returnToParent($this);
599  }
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...
+ Here is the call graph for this function:

◆ copyLinkedMediaToClipboard()

ilPageEditorGUI::copyLinkedMediaToClipboard ( )

copy linked media object to clipboard

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

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

496  : void
497  {
498  $ilUser = $this->user;
499 
500  $this->tpl->setOnScreenMessage('success', $this->lng->txt("copied_to_clipboard"), true);
501  $ilUser->addObjectToClipboard(
502  $this->requested_mob_id,
503  "mob",
504  ilObject::_lookupTitle($this->requested_mob_id)
505  );
506  $this->ctrl->returnToParent($this);
507  }
addObjectToClipboard(int $a_item_id, string $a_type, string $a_title, int $a_parent=0, string $a_time="", int $a_order_nr=0)
add an item to user's personal clipboard
static _lookupTitle(int $obj_id)
+ Here is the call graph for this function:

◆ copyLinkedMediaToMediaPool()

ilPageEditorGUI::copyLinkedMediaToMediaPool ( )

copy linked media object to media pool

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

References ILIAS\Repository\ctrl().

512  : void
513  {
514  $this->ctrl->setParameterByClass("ilmediapooltargetselector", "mob_id", $this->requested_mob_id);
515  $this->ctrl->redirectByClass("ilmediapooltargetselector", "listPools");
516  }
+ Here is the call graph for this function:

◆ cut()

ilPageEditorGUI::cut ( )

Cut selected items.

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

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

604  : void
605  {
606  $lng = $this->lng;
607 
608  $ids = $this->request->getIds();
609  if (count($ids)) {
610  $updated = $this->page->cutContents($ids);
611  if ($updated !== true) {
612  $this->edit_repo->setPageError($updated);
613  } else {
614  $this->edit_repo->clearPageError();
615  }
616  $this->tpl->setOnScreenMessage('success', $lng->txt("cont_sel_el_cut_use_paste"), true);
617  }
618  $this->ctrl->returnToParent($this);
619  }
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...
int $updated
Timestamp for when the object was last updated.
Definition: System.php:158
+ Here is the call graph for this function:

◆ deactivatePage()

ilPageEditorGUI::deactivatePage ( )

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

462  : void
463  {
464  $this->page_gui->deactivatePage();
465  }

◆ delete()

ilPageEditorGUI::delete ( )

Confirm.

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

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

538  : void
539  {
540  $ilCtrl = $this->ctrl;
541  $tpl = $this->tpl;
542  $lng = $this->lng;
543 
544  $targets = $this->request->getIds();
545 
546  if (count($targets) == 0) {
547  $this->tpl->setOnScreenMessage('info', $lng->txt("no_checkbox"), true);
548  $this->ctrl->returnToParent($this);
549  } else {
550  $cgui = new ilConfirmationGUI();
551  $cgui->setFormAction($ilCtrl->getFormAction($this));
552  $cgui->setHeaderText($lng->txt("copg_confirm_el_deletion"));
553  $cgui->setCancel($lng->txt("cancel"), "cancelDeleteSelected");
554  $cgui->setConfirm($lng->txt("confirm"), "confirmedDeleteSelected");
555  foreach ($targets as $t) {
556  $cgui->addHiddenItem("ids[]", $t);
557  }
558 
559  $tpl->setContent($cgui->getHTML());
560  }
561  }
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...
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
+ Here is the call graph for this function:

◆ displayPage()

ilPageEditorGUI::displayPage ( )

Default for POST reloads and missing.

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

References ILIAS\Repository\ctrl().

814  : void
815  {
816  $this->ctrl->returnToParent($this);
817  }
+ Here is the call graph for this function:

◆ executeCommand()

ilPageEditorGUI::executeCommand ( )

execute command

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

References $cont_obj, $ctrl, $help, $requested_ctype, $requested_hier_id, $requested_pc_id, $requested_pl_pc_id, ilObject\_lookupTitle(), ILIAS\Repository\ctrl(), getHeader(), ilPageContent\getType(), ILIAS\Repository\lng(), paste(), pasteFromClipboard(), ilInternalLinkGUI\setFilterWhiteList(), and ILIAS\Repository\ui().

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

◆ getHeader()

ilPageEditorGUI::getHeader ( )

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

References $header.

Referenced by executeCommand().

137  : string
138  {
139  return $this->header;
140  }
+ 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 691 of file class.ilPageEditorGUI.php.

References $ctrl, $lng, ilPCParagraphGUI\_getCharacteristics(), ilPCSectionGUI\_getCharacteristics(), ILIAS\Repository\form(), ILIAS\Repository\lng(), and ilLanguage\txt().

Referenced by characteristic().

694  : void {
695  $ilCtrl = $this->ctrl;
696  $lng = $this->lng;
697 
698 
699  // edit form
700  $this->form = new ilPropertyFormGUI();
701  $this->form->setTitle($this->lng->txt("cont_choose_characteristic"));
702 
703  if ($a_types["par"] == "par") {
704  $select_prop = new ilSelectInputGUI(
705  $this->lng->txt("cont_choose_characteristic_text"),
706  "char_par"
707  );
708  $options = ilPCParagraphGUI::_getCharacteristics($this->page_gui->getStyleId());
709  $select_prop->setOptions($options);
710  $this->form->addItem($select_prop);
711  }
712  if ($a_types["sec"] == "sec") {
713  $select_prop = new ilSelectInputGUI(
714  $this->lng->txt("cont_choose_characteristic_section"),
715  "char_sec"
716  );
717  $options = ilPCSectionGUI::_getCharacteristics($this->page_gui->getStyleId());
718  $select_prop->setOptions($options);
719  $this->form->addItem($select_prop);
720  }
721 
722  foreach ($a_target as $t) {
723  $hidden = new ilHiddenInputGUI("target[]");
724  $hidden->setValue($t);
725  $this->form->addItem($hidden);
726  }
727 
728  $this->form->setFormAction($ilCtrl->getFormAction($this));
729  $this->form->addCommandButton("assignCharacteristic", $lng->txt("save"));
730  $this->form->addCommandButton("showPage", $lng->txt("cancel"));
731  }
This class represents a selection list property in a property form.
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...
static _getCharacteristics(int $a_style_id)
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.
form( $class_path, string $cmd, string $submit_caption="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertFromClipboard()

ilPageEditorGUI::insertFromClipboard ( )

insert object from clipboard

Exceptions
ilDateTimeException

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

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

779  : void
780  {
782 
783  $hier_id = $this->page->getHierIdForPcId($this->requested_pc_id);
784  if ($hier_id == "") {
785  $hier_id = "pg";
786  }
787 
788  if ($ids != "") {
789  foreach ($ids as $id2) {
790  $id = explode(":", $id2);
791  $type = $id[0];
792  $id = $id[1];
793  if ($type == "mob") {
794  $this->content_obj = new ilPCMediaObject($this->page);
795  $this->content_obj->readMediaObject($id);
796  $this->content_obj->createAlias($this->page, $hier_id);
797  $this->page->update();
798  }
799  if ($type == "incl") {
800  $this->content_obj = new ilPCContentInclude($this->page);
801  $this->content_obj->create($this->page, $hier_id);
802  $this->content_obj->setContentType("mep");
803  $this->content_obj->setContentId($id);
804  $this->page->update();
805  }
806  }
807  }
808  $this->ctrl->returnToParent($this);
809  }
Class ilPCContentInclude.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
Class ilPCMediaObject Media content object (see ILIAS DTD)
+ Here is the call graph for this function:

◆ paste()

ilPageEditorGUI::paste ( string  $a_hier_id)

paste from clipboard (redirects to clipboard)

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

References ILIAS\Repository\ctrl().

Referenced by executeCommand().

624  : void
625  {
626  $this->page->pasteContents($a_hier_id, $this->page_gui->getPageConfig()->getEnableSelfAssessment());
627  //ilEditClipboard::setAction("");
628  $this->ctrl->returnToParent($this);
629  }
+ 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 755 of file class.ilPageEditorGUI.php.

References $ctrl, and ilCtrl\setParameter().

Referenced by executeCommand().

755  : void
756  {
757  $ilCtrl = $this->ctrl;
758  //var_dump($a_hier_id);
759  $ilCtrl->setParameter($this, "hier_id", $a_hier_id);
760  $ilCtrl->setParameterByClass(
761  "ilEditClipboardGUI",
762  "returnCommand",
763  rawurlencode($ilCtrl->getLinkTarget(
764  $this,
765  "insertFromClipboard",
766  "",
767  false,
768  false
769  ))
770  );
771  //echo ":".$ilCtrl->getLinkTarget($this, "insertFromClipboard").":";
772  $ilCtrl->redirectByClass("ilEditClipboardGUI", "getObject");
773  }
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ returnToContext()

ilPageEditorGUI::returnToContext ( )

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

References ILIAS\Repository\ctrl().

142  : void
143  {
144  $this->ctrl->returnToParent($this);
145  }
+ Here is the call graph for this function:

◆ setHeader()

ilPageEditorGUI::setHeader ( string  $a_header)

set header title

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

References ILIAS\UI\examples\Symbol\Glyph\Header\header().

132  : void
133  {
134  $this->header = $a_header;
135  }
+ Here is the call graph for this function:

◆ setIntLinkReturn()

ilPageEditorGUI::setIntLinkReturn ( string  $a_return)

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

147  : void
148  {
149  $this->int_link_return = $a_return;
150  }

◆ setMediaMode()

ilPageEditorGUI::setMediaMode ( )

set media and editing mode

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

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

470  : void
471  {
472  $ilUser = $this->user;
473 
474  $ilUser->writePref(
475  "ilPageEditor_MediaMode",
476  $this->request->getString("media_mode")
477  );
478  $ilUser->writePref(
479  "ilPageEditor_HTMLMode",
480  $this->request->getString("html_mode")
481  );
482  $js_mode = $this->request->getString("js_mode");
483  $ilUser->writePref("ilPageEditor_JavaScript", $js_mode);
484 
485  // again not so nice...
486  if ($this->page->getParentType() == "lm") {
487  $this->ctrl->redirectByClass("illmpageobjectgui", "edit");
488  } else {
489  $this->ctrl->returnToParent($this);
490  }
491  }
writePref(string $a_keyword, string $a_value)
+ Here is the call graph for this function:

◆ setPageBackTitle()

ilPageEditorGUI::setPageBackTitle ( string  $a_title)

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

152  : void
153  {
154  $this->page_back_title = $a_title;
155  }

◆ showSnippetInfo()

ilPageEditorGUI::showSnippetInfo ( )

Show snippet info.

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

References $access, $ctrl, $lng, $tpl, ilObject\_getAllReferences(), ilObject\_lookupTitle(), ilMediaPoolItem\getPoolForItemId(), ilMediaPoolPage\lookupTitle(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

822  : void
823  {
824  $tpl = $this->tpl;
825  $lng = $this->lng;
826  $ilAccess = $this->access;
827  $ilCtrl = $this->ctrl;
828 
829  $stpl = new ilTemplate("tpl.snippet_info.html", true, true, "Services/COPage");
830 
832  $this->request->getString("ci_id")
833  );
834  foreach ($mep_pools as $mep_id) {
835  $ref_ids = ilObject::_getAllReferences($mep_id);
836  $edit_link = false;
837  foreach ($ref_ids as $rid) {
838  if (!$edit_link && $ilAccess->checkAccess("write", "", $rid)) {
839  $stpl->setCurrentBlock("edit_link");
840  $stpl->setVariable("TXT_EDIT", $lng->txt("edit"));
841  $stpl->setVariable(
842  "HREF_EDIT",
843  "./goto.php?target=mep_" . $rid
844  );
845  $stpl->parseCurrentBlock();
846  }
847  }
848  $stpl->setCurrentBlock("pool");
849  $stpl->setVariable("TXT_MEDIA_POOL", $lng->txt("obj_mep"));
850  $stpl->setVariable("VAL_MEDIA_POOL", ilObject::_lookupTitle($mep_id));
851  $stpl->parseCurrentBlock();
852  }
853 
854  $stpl->setVariable("TXT_TITLE", $lng->txt("title"));
855  $stpl->setVariable(
856  "VAL_TITLE",
857  ilMediaPoolPage::lookupTitle($this->request->getString("ci_id"))
858  );
859  $stpl->setVariable("TXT_BACK", $lng->txt("back"));
860  $stpl->setVariable(
861  "HREF_BACK",
862  $ilCtrl->getLinkTarget($this->page_gui, "edit")
863  );
864  $tpl->setContent($stpl->get());
865  }
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...
static getPoolForItemId(int $a_id)
static _getAllReferences(int $id)
get all reference ids for object ID
static lookupTitle(int $a_page_id)
static _lookupTitle(int $obj_id)
setContent(string $a_html)
Sets content for standard template.
ilAccessHandler $access
ilGlobalTemplateInterface $tpl
+ Here is the call graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilPageEditorGUI::$access
protected

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

Referenced by showSnippetInfo().

◆ $cont_obj

ilPageContent ilPageEditorGUI::$cont_obj = null

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

Referenced by executeCommand().

◆ $content_obj

ilPageContent ilPageEditorGUI::$content_obj
protected

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

◆ $ctrl

ilCtrl ilPageEditorGUI::$ctrl

◆ $edit_repo

EditSessionRepository ilPageEditorGUI::$edit_repo
protected

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

◆ $enable_anchors

bool ilPageEditorGUI::$enable_anchors = false

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

◆ $enable_keywords

bool ilPageEditorGUI::$enable_keywords = false

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

◆ $form

ilPropertyFormGUI ilPageEditorGUI::$form
protected

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

◆ $header

string ilPageEditorGUI::$header = ""

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

Referenced by getHeader().

◆ $help

ilHelpGUI ilPageEditorGUI::$help
protected

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

Referenced by executeCommand().

◆ $http_request

ServerRequestInterface ilPageEditorGUI::$http_request
protected

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

◆ $int_link_return

string ilPageEditorGUI::$int_link_return = ""
protected

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

◆ $lng

ilLanguage ilPageEditorGUI::$lng

◆ $log

ilLogger ilPageEditorGUI::$log
protected

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

◆ $objDefinition

ilObjectDefinition ilPageEditorGUI::$objDefinition

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

Referenced by __construct().

◆ $page

ilPageObject ilPageEditorGUI::$page

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

◆ $page_back_title

string ilPageEditorGUI::$page_back_title = ""
protected

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

◆ $page_gui

ilPageObjectGUI ilPageEditorGUI::$page_gui
protected

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

◆ $pc_definition

ILIAS COPage PC PCDefinition ilPageEditorGUI::$pc_definition
protected

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

◆ $request

EditGUIRequest ilPageEditorGUI::$request
protected

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

◆ $requested_cname

string ilPageEditorGUI::$requested_cname
protected

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

◆ $requested_ctype

string ilPageEditorGUI::$requested_ctype
protected

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

Referenced by executeCommand().

◆ $requested_hier_id

string ilPageEditorGUI::$requested_hier_id
protected

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

Referenced by executeCommand().

◆ $requested_mob_id

int ilPageEditorGUI::$requested_mob_id
protected

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

◆ $requested_pc_id

string ilPageEditorGUI::$requested_pc_id
protected

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

Referenced by executeCommand().

◆ $requested_pcid

string ilPageEditorGUI::$requested_pcid
protected

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

◆ $requested_pl_pc_id

string ilPageEditorGUI::$requested_pl_pc_id
protected

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

Referenced by executeCommand().

◆ $return_location

string ilPageEditorGUI::$return_location = ""

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

◆ $tabs_gui

ilTabsGUI ilPageEditorGUI::$tabs_gui
protected

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

◆ $target_script

string ilPageEditorGUI::$target_script = ""

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

◆ $tool_context

ILIAS GlobalScreen ScreenContext ContextServices ilPageEditorGUI::$tool_context
protected

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

◆ $tpl

ilGlobalTemplateInterface ilPageEditorGUI::$tpl

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

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

◆ $ui

ILIAS DI UIServices ilPageEditorGUI::$ui
protected

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

◆ $user

ilObjUser ilPageEditorGUI::$user
protected

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

Referenced by copyLinkedMediaToClipboard(), and setMediaMode().


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