ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilPageComponentPluginGUI.php
Go to the documentation of this file.
1<?php
2
24{
25 protected string $mode;
26 protected ilLanguage $lng;
29
30 public function __construct()
31 {
32 global $DIC;
33
34 $this->lng = $DIC->language();
35 }
36
37 public function setPCGUI(ilPCPluggedGUI $a_val): void
38 {
39 $this->pc_gui = $a_val;
40 }
41
42 public function getPCGUI(): ilPCPluggedGUI
43 {
44 return $this->pc_gui;
45 }
46
47 public function setPlugin(ilPageComponentPlugin $a_val): void
48 {
49 $this->plugin = $a_val;
50 }
51
53 {
54 return $this->plugin;
55 }
56
57 final public function setMode(string $a_mode): void
58 {
59 $this->mode = $a_mode;
60 }
61
62 final public function getMode(): string
63 {
64 return $this->mode;
65 }
66
70 public function getHTML(): string
71 {
73 $this->insert();
74 } elseif ($this->getMode() == ilPageComponentPlugin::CMD_EDIT) {
75 $this->edit();
76 }
77 return "";
78 }
79
80 abstract public function executeCommand(): void;
81 abstract public function insert(): void;
82 abstract public function edit(): void;
83 abstract public function create(): void;
84 abstract public function getElementHTML(
85 string $a_mode,
86 array $a_properties,
87 string $plugin_version
88 ): string;
89
90 public function create_plug(): void
91 {
92 $this->create();
93 }
94
95 public function createElement(array $a_properties): bool
96 {
97 return $this->getPCGUI()->createElement($a_properties);
98 }
99
100 public function updateElement(array $a_properties): bool
101 {
102 return $this->getPCGUI()->updateElement($a_properties);
103 }
104
105 public function returnToParent(): void
106 {
107 $this->getPCGUI()->returnToParent();
108 }
109
113 public function setProperties(array $a_val): void
114 {
115 $co = $this->getPCGUI()->getContentObject();
116 if (is_object($co)) {
117 $co->setProperties($a_val);
118 }
119 }
120
121 public function getProperties(): array
122 {
123 $co = $this->getPCGUI()->getContentObject();
124 if (is_object($co)) {
125 return $co->getProperties();
126 }
127 return array();
128 }
129
130 final protected function addCreationButton(ilPropertyFormGUI $a_form): void
131 {
133
134 $a_form->addCommandButton("create_plug", $lng->txt("save"));
135 }
136}
language handling
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...
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...
getElementHTML(string $a_mode, array $a_properties, string $plugin_version)
addCreationButton(ilPropertyFormGUI $a_form)
setPlugin(ilPageComponentPlugin $a_val)
setProperties(array $a_val)
Set properties.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a property form user interface.
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
global $DIC
Definition: shib_login.php:26