ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilPCTabsEditorGUI.php
Go to the documentation of this file.
1 <?php
2 
21 
26 {
27  protected \ilLanguage $lng;
28 
29  public function __construct()
30  {
31  global $DIC;
32  $this->lng = $DIC->language();
33  }
34 
35  public function getEditorElements(
36  UIWrapper $ui_wrapper,
37  string $page_type,
38  ilPageObjectGUI $page_gui,
39  int $style_id
40  ): array {
41  $form = $this->getCreationForm($page_gui, $ui_wrapper);
42 
43  return [
44  "creation_form" => $form,
45  "icon" => $ui_wrapper->getRenderedIcon("peac")
46  ];
47  }
48 
49  public function getEditComponentForm(
50  UIWrapper $ui_wrapper,
51  string $page_type,
52  \ilPageObjectGUI $page_gui,
53  int $style_id,
54  string $pcid
55  ): string {
56  global $DIC;
57 
58  $lng = $DIC->language();
59  $lng->loadLanguageModule("content");
60 
62  $pc_tabs = $page_gui->getPageObject()->getContentObjectForPcId($pcid);
63  $tabs_gui = new ilPCTabsGUI($page_gui->getPageObject(), $pc_tabs, "", $pcid);
64  $tabs_gui->setStyleId($style_id);
65 
67  $form = $tabs_gui->initEditingForm();
68 
69  $html = $ui_wrapper->getRenderedForm(
70  $form,
71  [["Page", "component.update.back", $lng->txt("save")],
72  ["Page", "component.back", $lng->txt("cancel")]]
73  );
74 
75  return $html;
76  }
77 
78  protected function getCreationForm(
79  ilPageObjectGUI $page_gui,
80  UIWrapper $ui_wrapper
81  ): string {
82  $lng = $this->lng;
83 
84  $tabs_gui = new ilPCTabsGUI($page_gui->getPageObject(), null, "", "");
85 
87  $form = $tabs_gui->initCreationForm();
88 
89  $html = $ui_wrapper->getRenderedForm(
90  $form,
91  [
92  ["Page", "component.save", $lng->txt("insert")],
93  ["Page", "component.cancel", $lng->txt("cancel")]
94  ]
95  );
96 
97  return $html;
98  }
99 }
Class ilPageObjectGUI.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getEditComponentForm(UIWrapper $ui_wrapper, string $page_type, \ilPageObjectGUI $page_gui, int $style_id, string $pcid)
Get rendered editor elements.
getRenderedForm(\ilPropertyFormGUI $form, array $buttons)
global $DIC
Definition: shib_login.php:22
setStyleId(int $a_styleid)
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...