ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilPageComponentPlugin.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 
5 include_once("./Services/Component/classes/class.ilPlugin.php");
6 
15 abstract class ilPageComponentPlugin extends ilPlugin
16 {
17  const TXT_CMD_INSERT = "cmd_insert";
18  const CMD_INSERT = "insert";
19  const CMD_EDIT = "edit";
20 
25  private $page_obj = null;
26 
32  final public function getComponentType()
33  {
34  return IL_COMP_SERVICE;
35  }
36 
42  final public function getComponentName()
43  {
44  return "COPage";
45  }
46 
52  final public function getSlot()
53  {
54  return "PageComponent";
55  }
56 
62  final public function getSlotId()
63  {
64  return "pgcp";
65  }
66 
70  final protected function slotInit()
71  {
72  // nothing to do here
73  }
74 
83  abstract public function isValidParentType($a_type);
84 
88  public function getJavascriptFiles($a_mode)
89  {
90  return array();
91  }
92 
96  public function getCssFiles($a_mode)
97  {
98  return array();
99  }
100 
106  final public function setMode($a_mode)
107  {
108  $this->mode = $a_mode;
109  }
110 
116  final public function getMode()
117  {
118  return $this->mode;
119  }
120 
124  public function getUIClassInstance()
125  {
126  $class = "il" . $this->getPluginName() . "PluginGUI";
127  $this->includeClass("class." . $class . ".php");
128  $obj = new $class();
129  $obj->setPlugin($this);
130  return $obj;
131  }
132 
139  public function setPageObj($a_page_obj)
140  {
141  $this->page_obj = $a_page_obj;
142  }
143 
148  public function getPageId()
149  {
150  if (isset($this->page_obj)) {
151  return $this->page_obj->getId();
152  }
153  return 0;
154  }
155 
160  public function getParentId()
161  {
162  if (isset($this->page_obj)) {
163  return $this->page_obj->getParentId();
164  }
165  return 0;
166  }
167 
172  public function getParentType()
173  {
174  if (isset($this->page_obj)) {
175  return $this->page_obj->getParentType();
176  }
177  return '';
178  }
179 
185  public function onClone(&$a_properties, $a_plugin_version)
186  {
187  }
188 
194  public function onDelete($a_properties, $a_plugin_version)
195  {
196  }
197 }
getPageId()
Get the id of the page.
onDelete($a_properties, $a_plugin_version)
This function is called before the page content is deleted.
getComponentName()
Get Component Name.
includeClass($a_class_file_name)
Include (once) a class file.
getComponentType()
Get Component Type.
onClone(&$a_properties, $a_plugin_version)
This function is called when the page content is cloned.
slotInit()
Object initialization done by slot.
$a_type
Definition: workflow.php:92
getJavascriptFiles($a_mode)
Get Javascript files.
getParentId()
Get the object id of the parent object.
getUIClassInstance()
Get UI plugin class.
Abstract parent class for all page component plugin classes.
setPageObj($a_page_obj)
Inject the page object This must be public to be called by ilPCPlugged But the page object should not...
Create styles array
The data for the language used.
getCssFiles($a_mode)
Get css files.
getParentType()
Get the object type og the parent object.
getPluginName()
Get Plugin Name.
const IL_COMP_SERVICE
isValidParentType($a_type)
Determines the resources that allow to include the new content component.