ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilPCResourcesEditorGUI.php
Go to the documentation of this file.
1<?php
2
20
25{
26 protected \ilLanguage $lng;
27 protected \ilCtrl $ctrl;
28
29 public function __construct()
30 {
31 global $DIC;
32
33 $this->lng = $DIC->language();
34 $this->ctrl = $DIC->ctrl();
35 }
36
37 public function getEditorElements(
38 UIWrapper $ui_wrapper,
39 string $page_type,
40 ilPageObjectGUI $page_gui,
41 int $style_id
42 ): array {
43 $form = $this->getCreationForm($page_gui, $ui_wrapper, $style_id);
44 return [
45 "creation_form" => $form,
46 "icon" => $ui_wrapper->getRenderedIcon("perl")
47 ];
48 }
49
50 protected function getCreationForm(
51 ilPageObjectGUI $page_gui,
52 UIWrapper $ui_wrapper,
53 int $style_id
54 ): string {
55 $lng = $this->lng;
56
57 $res_gui = new ilPCResourcesGUI($page_gui->getPageObject(), null, "", "");
58
60 $form = $res_gui->initCreationForm();
61
62 $html = $ui_wrapper->getRenderedForm(
63 $form,
64 [
65 ["Page", "component.save", $lng->txt("insert")],
66 ["Page", "component.cancel", $lng->txt("cancel")]
67 ]
68 );
69
70 return $html;
71 }
72
73 public function getEditComponentForm(
74 UIWrapper $ui_wrapper,
75 string $page_type,
76 \ilPageObjectGUI $page_gui,
77 int $style_id,
78 string $pcid
79 ): string {
80 global $DIC;
81
82 $lng = $DIC->language();
83 $lng->loadLanguageModule("content");
84
86 $pc_res = $page_gui->getPageObject()->getContentObjectForPcId($pcid);
87 $res_gui = new ilPCResourcesGUI($page_gui->getPageObject(), $pc_res, "", $pcid);
88
90 $form = $res_gui->initEditingForm();
91
92 $html = $ui_wrapper->getRenderedForm(
93 $form,
94 [["Page", "component.update", $lng->txt("save")],
95 ["Page", "component.cancel", $lng->txt("cancel")]]
96 );
97
98 return $html;
99 }
100}
getRenderedForm(\ilPropertyFormGUI $form, array $buttons)
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.
global $lng
Definition: privfeed.php:31
global $DIC
Definition: shib_login.php:26