ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilPCPlaceHolderEditorGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
23
25{
27 protected \ilLanguage $lng;
28
29 public function __construct()
30 {
31 global $DIC;
32 $this->lng = $DIC->language();
33 $this->ctrl = $DIC->ctrl();
34 }
35
36 public function getEditorElements(
37 UIWrapper $ui_wrapper,
38 string $page_type,
39 ilPageObjectGUI $page_gui,
40 int $style_id
41 ): array {
42 $form = $this->getCreationForm($page_gui, $ui_wrapper);
43
44 return [
45 "creation_form" => $form,
46 "icon" => $ui_wrapper->getRenderedIcon("peplh")
47 ];
48 }
49
50 public function getEditComponentForm(
51 UIWrapper $ui_wrapper,
52 string $page_type,
53 \ilPageObjectGUI $page_gui,
54 int $style_id,
55 string $pcid
56 ): string {
57 $ctrl = $this->ctrl;
59
60 $page = $page_gui->getPageObject();
61 $page->addHierIDs();
62 $hier_id = $page->getHierIdForPcId($pcid);
63 $ph = $page->getContentObjectForPcId($pcid);
64
65
66 $ph_gui = new ilPCPlaceHolderGUI($page_gui->getPageObject(), $ph, $hier_id, $pcid);
67 $ph_gui->setPageConfig($page_gui->getPageConfig());
68 $form = $ph_gui->initCreationForm();
69
70 $html = $ui_wrapper->getRenderedForm(
71 $form,
72 [
73 ["Page", "component.update", $lng->txt("save")],
74 ["Page", "component.cancel", $lng->txt("cancel")]
75 ]
76 );
77
78 return $html;
79 }
80
81 protected function getCreationForm(
82 ilPageObjectGUI $page_gui,
83 UIWrapper $ui_wrapper
84 ): string {
85 $lng = $this->lng;
86
87 $plach_gui = new ilPCPlaceHolderGUI($page_gui->getPageObject(), null, "", "");
88
90 $form = $plach_gui->initCreationForm();
91
92 $html = $ui_wrapper->getRenderedForm(
93 $form,
94 [
95 ["Page", "component.save", $lng->txt("insert")],
96 ["Page", "component.cancel", $lng->txt("cancel")]
97 ]
98 );
99
100 return $html;
101 }
102}
getRenderedForm(\ilPropertyFormGUI $form, array $buttons)
getEditComponentForm(UIWrapper $ui_wrapper, string $page_type, \ilPageObjectGUI $page_gui, int $style_id, string $pcid)
Get rendered editor elements.
getEditorElements(UIWrapper $ui_wrapper, string $page_type, ilPageObjectGUI $page_gui, int $style_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilPageObjectGUI.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $lng
Definition: privfeed.php:31
global $DIC
Definition: shib_login.php:26