ILIAS  trunk Revision v11.0_alpha-1861-g09f3d197f78
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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...
 
 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: shib_login.php:22
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 620 of file class.ilPageEditorGUI.php.

References ILIAS\Repository\ctrl().

620  : void
621  {
622  $ids = $this->request->getIds();
623  if (count($ids) > 0) {
624  $updated = $this->page->switchEnableMultiple(
625  $ids,
626  true,
627  $this->page_gui->getPageConfig()->getEnableSelfAssessment()
628  );
629  if ($updated !== true) {
630  $this->edit_repo->setPageError($updated);
631  } else {
632  $this->edit_repo->clearPageError();
633  }
634  }
635  $this->ctrl->returnToParent($this);
636  }
+ Here is the call graph for this function:

◆ activatePage()

ilPageEditorGUI::activatePage ( )

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

460  : void
461  {
462  $this->page_gui->activatePage();
463  }

◆ assignCharacteristic()

ilPageEditorGUI::assignCharacteristic ( )

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

References ILIAS\Repository\ctrl().

719  : void
720  {
721  $char_par = $this->request->getString("char_par");
722  $char_sec = $this->request->getString("char_sec");
723 
724  $updated = $this->page->assignCharacteristic(
725  $this->request->getStringArray("target"),
726  $char_par,
727  $char_sec,
728  ""
729  );
730  if ($updated !== true) {
731  $this->edit_repo->setPageError($updated);
732  } else {
733  $this->edit_repo->clearPageError();
734  }
735  $this->ctrl->returnToParent($this);
736  }
+ Here is the call graph for this function:

◆ cancelDeleteSelected()

ilPageEditorGUI::cancelDeleteSelected ( )

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

References ILIAS\Repository\ctrl().

549  : void
550  {
551  $this->ctrl->returnToParent($this);
552  }
+ Here is the call graph for this function:

◆ characteristic()

ilPageEditorGUI::characteristic ( )

Assign characeristic to text blocks/sections.

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

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

641  : void
642  {
643  $tpl = $this->tpl;
644  $lng = $this->lng;
645 
646  $ids = $this->request->getIds();
647  if (count($ids) > 0) {
648  $types = array();
649 
650  // check what content element types have been selected
651  foreach ($ids as $t) {
652  $tarr = explode(":", $t);
653  $cont_obj = $this->page->getContentObject($tarr[0], $tarr[1]);
654  if (is_object($cont_obj) && $cont_obj->getType() == "par") {
655  $types["par"] = "par";
656  }
657  if (is_object($cont_obj) && $cont_obj->getType() == "sec") {
658  $types["sec"] = "sec";
659  }
660  }
661 
662  if (count($types) == 0) {
663  $this->tpl->setOnScreenMessage('failure', $lng->txt("cont_select_par_or_section"), true);
664  $this->ctrl->returnToParent($this);
665  } else {
666  $this->initCharacteristicForm($ids, $types);
667  $tpl->setContent($this->form->getHTML());
668  }
669  } else {
670  $this->ctrl->returnToParent($this);
671  }
672  }
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.
initCharacteristicForm(array $a_target, array $a_types)
Init map creation/update form.
ilGlobalTemplateInterface $tpl
form( $class_path, string $cmd, string $submit_caption="")
+ Here is the call graph for this function:

◆ confirmedDeleteSelected()

ilPageEditorGUI::confirmedDeleteSelected ( )

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

References ILIAS\Repository\ctrl().

554  : void
555  {
556  $targets = $this->request->getIds();
557  if (count($targets) > 0) {
558  $updated = $this->page->deleteContents(
559  $targets,
560  true,
561  $this->page_gui->getPageConfig()->getEnableSelfAssessment()
562  );
563  if ($updated !== true) {
564  $this->edit_repo->setPageError($updated);
565  } else {
566  $this->edit_repo->clearPageError();
567  }
568  }
569  $this->ctrl->returnToParent($this);
570  }
+ Here is the call graph for this function:

◆ copy()

ilPageEditorGUI::copy ( )

Copy selected items.

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

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

575  : void
576  {
577  $lng = $this->lng;
578 
579  $ids = $this->request->getIds();
580  if (count($ids) > 0) {
581  $this->page->copyContents($ids);
582  $this->tpl->setOnScreenMessage('success', $lng->txt("cont_sel_el_copied_use_paste"), true);
583  }
584  $this->ctrl->returnToParent($this);
585  }
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 499 of file class.ilPageEditorGUI.php.

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

499  : void
500  {
501  $ilUser = $this->user;
502 
503  $this->tpl->setOnScreenMessage('success', $this->lng->txt("copied_to_clipboard"), true);
504  $ilUser->addObjectToClipboard(
505  $this->requested_mob_id,
506  "mob",
507  ilObject::_lookupTitle($this->requested_mob_id)
508  );
509  $this->ctrl->returnToParent($this);
510  }
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 515 of file class.ilPageEditorGUI.php.

References ILIAS\Repository\ctrl().

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

◆ cut()

ilPageEditorGUI::cut ( )

Cut selected items.

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

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

590  : void
591  {
592  $lng = $this->lng;
593 
594  $ids = $this->request->getIds();
595  if (count($ids)) {
596  $updated = $this->page->cutContents($ids);
597  if ($updated !== true) {
598  $this->edit_repo->setPageError($updated);
599  } else {
600  $this->edit_repo->clearPageError();
601  }
602  $this->tpl->setOnScreenMessage('success', $lng->txt("cont_sel_el_cut_use_paste"), true);
603  }
604  $this->ctrl->returnToParent($this);
605  }
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:

◆ deactivatePage()

ilPageEditorGUI::deactivatePage ( )

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

465  : void
466  {
467  $this->page_gui->deactivatePage();
468  }

◆ delete()

ilPageEditorGUI::delete ( )

Confirm.

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

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

524  : void
525  {
526  $ilCtrl = $this->ctrl;
527  $tpl = $this->tpl;
528  $lng = $this->lng;
529 
530  $targets = $this->request->getIds();
531 
532  if (count($targets) == 0) {
533  $this->tpl->setOnScreenMessage('info', $lng->txt("no_checkbox"), true);
534  $this->ctrl->returnToParent($this);
535  } else {
536  $cgui = new ilConfirmationGUI();
537  $cgui->setFormAction($ilCtrl->getFormAction($this));
538  $cgui->setHeaderText($lng->txt("copg_confirm_el_deletion"));
539  $cgui->setCancel($lng->txt("cancel"), "cancelDeleteSelected");
540  $cgui->setConfirm($lng->txt("confirm"), "confirmedDeleteSelected");
541  foreach ($targets as $t) {
542  $cgui->addHiddenItem("ids[]", $t);
543  }
544 
545  $tpl->setContent($cgui->getHTML());
546  }
547  }
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 800 of file class.ilPageEditorGUI.php.

References ILIAS\Repository\ctrl().

800  : void
801  {
802  $this->ctrl->returnToParent($this);
803  }
+ 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(), null, 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 != "ilcontainerresourcegui") {
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  // Step PH (placeholder handling, placeholders from preview mode come without hier_id)
228  if ($next_class == "ilpcplaceholdergui" && $hier_id == "" && $this->requested_pl_pc_id != "") {
229  $hid = $this->page->getHierIdsForPCIds(array($this->requested_pl_pc_id));
230  $hier_id = $hid[$this->requested_pl_pc_id];
231  }
232  $this->log->debug("step PH: next class: " . $next_class);
233  if (!is_null($com) && ($com[0] == "insert" || $com[0] == "create")) {
234  // Step CM (creation mode handling)
235  $cmd = $com[0];
236  $ctype = $com[1] ?? ""; // note ctype holds type if cmdclass is empty, but also subcommands if not (e.g. applyFilter in ilpcmediaobjectgui)
237  $add_type = $this->request->getString("pluginName");
238  if ($ctype == "mob") {
239  $ctype = "media";
240  }
241 
242  $this->log->debug("step CM: cmd: " . $cmd . ", ctype: " . $ctype . ", add_type: " . $add_type);
243  } else {
244  $this->log->debug("step LM: cmd: " . $cmd . ", cmdClass: " . $cmdClass);
245 
246  // Step PR (get content object and return to parent)
247  $this->log->debug("before PR: cmdClass: $cmdClass, nextClass: $next_class" .
248  ", hier_id: " . $hier_id . ", pc_id: " . $pc_id . ")");
249  // note: ilinternallinkgui for page: no cont_obj is received
250  // ilinternallinkgui for mob: cont_obj is received
251  if ($this->requested_ctype == "" && $this->requested_cname == "" &&
252  $cmd != "insertFromClipboard" && $cmd != "pasteFromClipboard" &&
253  $cmd != "setMediaMode" && $cmd != "copyLinkedMediaToClipboard" &&
254  $cmd != "activatePage" && $cmd != "deactivatePage" &&
255  $cmd != "copyLinkedMediaToMediaPool" && $cmd != "showSnippetInfo" &&
256  $cmd != "delete" && $cmd != "paste" &&
257  $cmd != "cancelDeleteSelected" && $cmd != "confirmedDeleteSelected" &&
258  $cmd != "copy" && $cmd != "cut" &&
259  ($cmd != "displayPage" || $this->request->getString("editImagemapForward_x") != "" || $cmdClass == "ilcontainerresourcegui") &&
260  $cmd != "activate" && $cmd != "characteristic" &&
261  $cmd != "assignCharacteristic" &&
262  $cmdClass != "ilrepositoryselector2inputgui" &&
263  $cmdClass != "ilpageeditorserveradaptergui" &&
264  $cmd != "cancelCreate" && $cmd != "popup" &&
265  $cmdClass != "ileditclipboardgui" && $cmd != "addChangeComment" &&
266  ($cmdClass != "ilinternallinkgui" || ($next_class == "ilpcmediaobjectgui"))) {
267  $cont_obj = $this->page->getContentObject($hier_id, $pc_id);
268  if (!is_object($cont_obj)) {
269  $this->log->debug("returnToParent");
270  $ilCtrl->returnToParent($this);
271  }
272  $ctype = $cont_obj->getType();
273  }
274  }
275  // Step NC (handle empty next class)
276  if ($this->requested_ctype != "" || $this->requested_cname != "") {
277  $ctype = $this->requested_ctype;
278  if ($this->requested_cname != "") {
279  $pc_def = $this->pc_definition->getPCDefinitionByName($this->requested_cname);
280  $ctype = $pc_def["pc_type"];
281  }
282  $pc_id = $this->requested_pc_id;
283  $hier_id = $this->requested_hier_id;
284  if (!in_array($cmd, ["insert", "create", "upload"])) {
285  $cont_obj = $this->page->getContentObject($hier_id, $pc_id);
286  }
287  }
288  // this fixes e.g. #31214
289  if ($pc_id != "" && $hier_id == "") {
290  $hier_id = $this->page->getHierIdForPcId($pc_id);
291  }
292  if ($ctype != "media" || !is_object($cont_obj)) {
293  if ($this->getHeader() != "") {
294  $this->tpl->setTitle($this->getHeader());
295  }
296  }
297 
298  $this->cont_obj = $cont_obj;
299 
300  $this->ctrl->setParameter($this, "hier_id", $hier_id);
301  $this->ctrl->setParameter($this, "pc_id", $pc_id);
302 
303  if ($next_class == "") {
304  $pc_def = $this->pc_definition->getPCDefinitionByType($ctype);
305  if (is_array($pc_def)) {
306  if ($ctype === "plug") {
307  $this->ctrl->setParameterByClass(
308  $pc_def["pc_gui_class"],
309  "pluginName",
310  $this->request->getString("pluginName")
311  );
312  }
313  $this->ctrl->redirectByClass($pc_def["pc_gui_class"], $this->ctrl->getCmd());
314  }
315  $next_class = $this->ctrl->getNextClass($this);
316  }
317  $this->log->debug("step NC2: next_class: $next_class");
318 
319  // ... do not do this while imagemap editing is ongoing
320  // Step IM (handle image map editing)
321  if ($cmd == "displayPage" && $next_class !== "ilpcmediaobjectgui" &&
322  $this->request->getString("editImagemapForward_x") == ""
323  && $this->request->getString("imagemap_x") == "") {
324  $next_class = "";
325  }
326 
327  switch ($next_class) {
328  case "ilinternallinkgui":
329  $link_gui = new ilInternalLinkGUI(
330  $this->page_gui->getPageConfig()->getIntLinkHelpDefaultType(),
331  $this->page_gui->getPageConfig()->getIntLinkHelpDefaultId(),
332  $this->page_gui->getPageConfig()->getIntLinkHelpDefaultIdIsRef()
333  );
334  $link_gui->setFilterWhiteList(
335  $this->page_gui->getPageConfig()->getIntLinkFilterWhiteList()
336  );
337  foreach ($this->page_gui->getPageConfig()->getIntLinkFilters() as $filter) {
338  $link_gui->filterLinkType($filter);
339  }
340  $link_gui->setReturn($this->int_link_return);
341 
342  $ret = $this->ctrl->forwardCommand($link_gui);
343  break;
344 
345  // PC Media Object
346  case "ilpcmediaobjectgui":
347  $this->tabs_gui->clearTargets();
348  $this->tabs_gui->setBackTarget(
349  $this->page_gui->page_back_title,
350  $ilCtrl->getLinkTarget($this->page_gui, "edit")
351  );
352  $pcmob_gui = new ilPCMediaObjectGUI($this->page, $cont_obj, $hier_id, $pc_id);
353  $pcmob_gui->setStyleId($this->page_gui->getStyleId());
354  $pcmob_gui->setSubCmd($ctype);
355  $pcmob_gui->setEnabledMapAreas($this->page_gui->getPageConfig()->getEnableInternalLinks());
356  $ret = $this->ctrl->forwardCommand($pcmob_gui);
357  $ilHelp->setScreenIdComponent("copg_media");
358  break;
359 
360  // only for "linked" media
361  case "ilobjmediaobjectgui":
362  $this->tabs_gui->clearTargets();
363  $this->tabs_gui->setBackTarget(
364  $this->lng->txt("back"),
365  (string) $ilCtrl->getParentReturn($this)
366  );
367  $mob_gui = new ilObjMediaObjectGUI("", $this->requested_mob_id, false, false);
368  $mob_gui->getTabs();
369  $mob_gui->setEnabledMapAreas($this->page_gui->getPageConfig()->getEnableInternalLinks());
370  $this->tpl->setTitle($this->lng->txt("mob") . ": " .
371  ilObject::_lookupTitle($this->requested_mob_id));
372  $ret = $this->ctrl->forwardCommand($mob_gui);
373  break;
374 
375  // Question
376  case "ilpcquestiongui":
377  $pc_question_gui = new ilPCQuestionGUI($this->page, $cont_obj, $hier_id, $pc_id);
378  $pc_question_gui->setSelfAssessmentMode($this->page_gui->getPageConfig()->getEnableSelfAssessment());
379  $pc_question_gui->setPageConfig($this->page_gui->getPageConfig());
380 
381  if ($this->page_gui->getPageConfig()->getEnableSelfAssessment()) {
382  $this->tabs_gui->clearTargets();
383  $ilHelp->setScreenIdComponent("copg_pcqst");
384  $this->tabs_gui->setBackTarget(
385  $this->lng->txt("back"),
386  (string) $ilCtrl->getParentReturn($this)
387  );
388  $ret = $this->ctrl->forwardCommand($pc_question_gui);
389  } else {
390  $cmd = $this->ctrl->getCmd();
391  $pc_question_gui->$cmd();
392  $this->ctrl->redirectByClass(array("ilobjquestionpoolgui", get_class($cont_obj)), "editQuestion");
393  }
394  break;
395 
396  // Plugged Component
397  case "ilpcpluggedgui":
398  $this->tabs_gui->clearTargets();
399  $plugged_gui = new ilPCPluggedGUI(
400  $this->page,
401  $cont_obj,
402  $hier_id,
403  $add_type,
404  $pc_id
405  );
406  $ret = $this->ctrl->forwardCommand($plugged_gui);
407  break;
408 
409  case "ilpageeditorserveradaptergui":
410  $adapter = new ilPageEditorServerAdapterGUI(
411  $this->page_gui,
412  $this->ctrl,
413  $this->ui,
414  $this->http_request
415  );
416  $this->ctrl->forwardCommand($adapter);
417  break;
418 
419  default:
420 
421  // generic calls to gui classes
422  if ($this->pc_definition->isPCGUIClassName($next_class, true)) {
423  $this->log->debug("Generic Call");
424  $pc_def = $this->pc_definition->getPCDefinitionByGUIClassName($next_class);
425  $this->tabs_gui->clearTargets();
426  $this->tabs_gui->setBackTarget(
427  $this->page_gui->page_back_title,
428  $ilCtrl->getLinkTarget($this->page_gui, "edit")
429  );
430  $ilHelp->setScreenIdComponent("copg_" . $pc_def["pc_type"]);
431  $gui_class_name = $pc_def["pc_gui_class"];
432  $pc_gui = new $gui_class_name($this->page, $cont_obj, $hier_id, $pc_id);
433  if ($pc_def["style_classes"]) {
434  $pc_gui->setStyleId($this->page_gui->getStyleId());
435  }
436  $pc_gui->setPageConfig($this->page_gui->getPageConfig());
437  $ret = $this->ctrl->forwardCommand($pc_gui);
438  } else {
439  $this->log->debug("Call ilPageEditorGUI command.");
440  // cmd belongs to ilPageEditorGUI
441 
442  if ($cmd == "pasteFromClipboard") {
443  //$ret = $this->pasteFromClipboard($hier_id);
444  $this->pasteFromClipboard($hier_id);
445  } elseif ($cmd == "paste") {
446  //$ret = $this->paste($hier_id);
447  $this->paste($hier_id);
448  } else {
449  $ret = $this->$cmd();
450  }
451  }
452  break;
453  }
454 
455  $this->log->debug("end --------------------");
456 
457  return (string) $ret;
458  }
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...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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 677 of file class.ilPageEditorGUI.php.

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

Referenced by characteristic().

680  : void {
681  $ilCtrl = $this->ctrl;
682  $lng = $this->lng;
683 
684 
685  // edit form
686  $this->form = new ilPropertyFormGUI();
687  $this->form->setTitle($this->lng->txt("cont_choose_characteristic"));
688 
689  if ($a_types["par"] == "par") {
690  $select_prop = new ilSelectInputGUI(
691  $this->lng->txt("cont_choose_characteristic_text"),
692  "char_par"
693  );
694  $options = ilPCParagraphGUI::_getCharacteristics($this->page_gui->getStyleId());
695  $select_prop->setOptions($options);
696  $this->form->addItem($select_prop);
697  }
698  if ($a_types["sec"] == "sec") {
699  $select_prop = new ilSelectInputGUI(
700  $this->lng->txt("cont_choose_characteristic_section"),
701  "char_sec"
702  );
703  $options = ilPCSectionGUI::_getCharacteristics($this->page_gui->getStyleId());
704  $select_prop->setOptions($options);
705  $this->form->addItem($select_prop);
706  }
707 
708  foreach ($a_target as $t) {
709  $hidden = new ilHiddenInputGUI("target[]");
710  $hidden->setValue($t);
711  $this->form->addItem($hidden);
712  }
713 
714  $this->form->setFormAction($ilCtrl->getFormAction($this));
715  $this->form->addCommandButton("assignCharacteristic", $lng->txt("save"));
716  $this->form->addCommandButton("showPage", $lng->txt("cancel"));
717  }
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 class represents a hidden form property in a property form.
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 765 of file class.ilPageEditorGUI.php.

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

765  : void
766  {
768 
769  $hier_id = $this->page->getHierIdForPcId($this->requested_pc_id);
770  if ($hier_id == "") {
771  $hier_id = "pg";
772  }
773 
774  if ($ids != "") {
775  foreach ($ids as $id2) {
776  $id = explode(":", $id2);
777  $type = $id[0];
778  $id = $id[1];
779  if ($type == "mob") {
780  $this->content_obj = new ilPCMediaObject($this->page);
781  $this->content_obj->readMediaObject($id);
782  $this->content_obj->createAlias($this->page, $hier_id);
783  $this->page->update();
784  }
785  if ($type == "incl") {
786  $this->content_obj = new ilPCContentInclude($this->page);
787  $this->content_obj->create($this->page, $hier_id);
788  $this->content_obj->setContentType("mep");
789  $this->content_obj->setContentId($id);
790  $this->page->update();
791  }
792  }
793  }
794  $this->ctrl->returnToParent($this);
795  }
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 610 of file class.ilPageEditorGUI.php.

References ILIAS\Repository\ctrl().

Referenced by executeCommand().

610  : void
611  {
612  $this->page->pasteContents($a_hier_id, $this->page_gui->getPageConfig()->getEnableSelfAssessment());
613  //ilEditClipboard::setAction("");
614  $this->ctrl->returnToParent($this);
615  }
+ 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 741 of file class.ilPageEditorGUI.php.

References $ctrl, and ilCtrl\setParameter().

Referenced by executeCommand().

741  : void
742  {
743  $ilCtrl = $this->ctrl;
744  //var_dump($a_hier_id);
745  $ilCtrl->setParameter($this, "hier_id", $a_hier_id);
746  $ilCtrl->setParameterByClass(
747  "ilEditClipboardGUI",
748  "returnCommand",
749  rawurlencode($ilCtrl->getLinkTarget(
750  $this,
751  "insertFromClipboard",
752  "",
753  false,
754  false
755  ))
756  );
757  //echo ":".$ilCtrl->getLinkTarget($this, "insertFromClipboard").":";
758  $ilCtrl->redirectByClass("ilEditClipboardGUI", "getObject");
759  }
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  }
header()
expected output: > ILIAS shows the rendered Component.
Definition: header.php:29
+ 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 473 of file class.ilPageEditorGUI.php.

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

473  : void
474  {
475  $ilUser = $this->user;
476 
477  $ilUser->writePref(
478  "ilPageEditor_MediaMode",
479  $this->request->getString("media_mode")
480  );
481  $ilUser->writePref(
482  "ilPageEditor_HTMLMode",
483  $this->request->getString("html_mode")
484  );
485  $js_mode = $this->request->getString("js_mode");
486  $ilUser->writePref("ilPageEditor_JavaScript", $js_mode);
487 
488  // again not so nice...
489  if ($this->page->getParentType() == "lm") {
490  $this->ctrl->redirectByClass("illmpageobjectgui", "edit");
491  } else {
492  $this->ctrl->returnToParent($this);
493  }
494  }
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 808 of file class.ilPageEditorGUI.php.

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

808  : void
809  {
810  $tpl = $this->tpl;
811  $lng = $this->lng;
812  $ilAccess = $this->access;
813  $ilCtrl = $this->ctrl;
814 
815  $stpl = new ilTemplate("tpl.snippet_info.html", true, true, "components/ILIAS/COPage");
816 
818  $this->request->getString("ci_id")
819  );
820  foreach ($mep_pools as $mep_id) {
821  $ref_ids = ilObject::_getAllReferences($mep_id);
822  $edit_link = false;
823  foreach ($ref_ids as $rid) {
824  if (!$edit_link && $ilAccess->checkAccess("write", "", $rid)) {
825  $stpl->setCurrentBlock("edit_link");
826  $stpl->setVariable("TXT_EDIT", $lng->txt("edit"));
827  $stpl->setVariable(
828  "HREF_EDIT",
829  "./goto.php?target=mep_" . $rid
830  );
831  $stpl->parseCurrentBlock();
832  }
833  }
834  $stpl->setCurrentBlock("pool");
835  $stpl->setVariable("TXT_MEDIA_POOL", $lng->txt("obj_mep"));
836  $stpl->setVariable("VAL_MEDIA_POOL", ilObject::_lookupTitle($mep_id));
837  $stpl->parseCurrentBlock();
838  }
839 
840  $stpl->setVariable("TXT_TITLE", $lng->txt("title"));
841  $stpl->setVariable(
842  "VAL_TITLE",
843  ilMediaPoolPage::lookupTitle($this->request->getString("ci_id"))
844  );
845  $stpl->setVariable("TXT_BACK", $lng->txt("back"));
846  $stpl->setVariable(
847  "HREF_BACK",
848  $ilCtrl->getLinkTarget($this->page_gui, "edit")
849  );
850  $tpl->setContent($stpl->get());
851  }
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
setContent(string $a_html)
Sets content for standard template.
static lookupTitle(int $a_page_id)
static _lookupTitle(int $obj_id)
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: