ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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
5include_once("./Services/Component/classes/class.ilPlugin.php");
6
15abstract 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}
An exception for terminatinating execution or to throw for unit testing.
const IL_COMP_SERVICE
Abstract parent class for all page component plugin classes.
getParentId()
Get the object id of the parent object.
slotInit()
Object initialization done by slot.
onClone(&$a_properties, $a_plugin_version)
This function is called when the page content is cloned.
onDelete($a_properties, $a_plugin_version)
This function is called before the page content is deleted.
setPageObj($a_page_obj)
Inject the page object This must be public to be called by ilPCPlugged But the page object should not...
getCssFiles($a_mode)
Get css files.
getJavascriptFiles($a_mode)
Get Javascript files.
getComponentType()
Get Component Type.
isValidParentType($a_type)
Determines the resources that allow to include the new content component.
getComponentName()
Get Component Name.
getUIClassInstance()
Get UI plugin class.
getParentType()
Get the object type og the parent object.
getPageId()
Get the id of the page.
includeClass($a_class_file_name)
Include (once) a class file.
getPluginName()
Get Plugin Name.
$a_type
Definition: workflow.php:92