ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilPageComponentPluginGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
14 {
18  protected $lng;
19 
20 
24  public function __construct()
25  {
26  global $DIC;
27 
28  $this->lng = $DIC->language();
29  }
30 
31  protected $plugin;
32  protected $pc_gui;
33  protected $pc;
34 
40  public function setPCGUI($a_val)
41  {
42  $this->pc_gui = $a_val;
43  }
44 
50  public function getPCGUI()
51  {
52  return $this->pc_gui;
53  }
54 
60  public function setPlugin($a_val)
61  {
62  $this->plugin = $a_val;
63  }
64 
70  public function getPlugin()
71  {
72  return $this->plugin;
73  }
74 
80  final public function setMode($a_mode)
81  {
82  $this->mode = $a_mode;
83  }
84 
90  final public function getMode()
91  {
92  return $this->mode;
93  }
94 
101  public function getHTML()
102  {
103  if ($this->getMode() == ilPageComponentPlugin::CMD_INSERT) {
104  $this->insert();
105  } elseif ($this->getMode() == ilPageComponentPlugin::CMD_EDIT) {
106  $this->edit();
107  }
108  }
109 
110  abstract public function executeCommand();
111  abstract public function insert();
112  abstract public function edit();
113  abstract public function create();
114  abstract public function getElementHTML($a_mode, array $a_properties, $plugin_version);
115 
116  public function createElement(array $a_properties)
117  {
118  return $this->getPCGUI()->createElement($a_properties);
119  }
120 
121  public function updateElement(array $a_properties)
122  {
123  return $this->getPCGUI()->updateElement($a_properties);
124  }
125 
129  public function returnToParent()
130  {
131  $this->getPCGUI()->returnToParent();
132  }
133 
139  public function setProperties(array $a_val)
140  {
141  $co = $this->getPCGUI()->getContentObject();
142  if (is_object($co)) {
143  $co->setProperties($a_val);
144  }
145  }
146 
152  public function getProperties()
153  {
154  $co = $this->getPCGUI()->getContentObject();
155  if (is_object($co)) {
156  return $co->getProperties($a_val);
157  }
158  return array();
159  }
160 
167  final protected function addCreationButton($a_form)
168  {
169  $lng = $this->lng;
170 
171  $a_form->addCommandButton("create_plug", $lng->txt("save"));
172  }
173 }
addCreationButton($a_form)
Add creation button.
global $DIC
Definition: saml.php:7
setPCGUI($a_val)
Set pc gui object.
setPlugin($a_val)
Set plugin object.
Create styles array
The data for the language used.
Abstract parent class for all page component plugin gui classes.
setProperties(array $a_val)
Set properties.
getElementHTML($a_mode, array $a_properties, $plugin_version)