ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilPageComponentPlugin.php
Go to the documentation of this file.
1<?php
2
24abstract class ilPageComponentPlugin extends ilPlugin
25{
26 public const TXT_CMD_INSERT = "cmd_insert";
27 public const CMD_INSERT = "insert";
28 public const CMD_EDIT = "edit";
29
30 private ?ilPageObject $page_obj = null;
31 protected string $mode;
32
39 abstract public function isValidParentType(string $a_type): bool;
40
41 public function getJavascriptFiles(string $a_mode): array
42 {
43 return array();
44 }
45
46 public function getCssFiles(string $a_mode): array
47 {
48 return array();
49 }
50
51 final public function setMode(string $a_mode): void
52 {
53 $this->mode = $a_mode;
54 }
55
56 final public function getMode(): string
57 {
58 return $this->mode;
59 }
60
65 {
66 $class = "il" . $this->getPluginName() . "PluginGUI";
67 $obj = new $class();
68 $obj->setPlugin($this);
69 return $obj;
70 }
71
77 public function setPageObj(ilPageObject $a_page_obj): void
78 {
79 $this->page_obj = $a_page_obj;
80 }
81
85 public function getPageId(): int
86 {
87 if (isset($this->page_obj)) {
88 return $this->page_obj->getId();
89 }
90 return 0;
91 }
92
96 public function getParentId(): int
97 {
98 if (isset($this->page_obj)) {
99 return $this->page_obj->getParentId();
100 }
101 return 0;
102 }
103
107 public function getParentType(): string
108 {
109 if (isset($this->page_obj)) {
110 return $this->page_obj->getParentType();
111 }
112 return '';
113 }
114
120 public function onClone(
121 array &$a_properties,
122 string $a_plugin_version
123 ): void {
124 }
125
134 public function afterRepositoryCopy(
135 array &$a_properties,
136 array $mapping,
137 int $source_ref_id,
138 string $a_plugin_version
139 ): void {
140 }
141
148 public function onDelete(
149 array $a_properties,
150 string $a_plugin_version,
151 bool $move_operation = false
152 ): void {
153 }
154}
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...
getParentId()
Get the object id of the parent object.
onDelete(array $a_properties, string $a_plugin_version, bool $move_operation=false)
This function is called before the page content is deleted.
afterRepositoryCopy(array &$a_properties, array $mapping, int $source_ref_id, string $a_plugin_version)
This function is called after repository (container) objects have been copied.
isValidParentType(string $a_type)
Determines the parent types that allow to include the new content component.
getUIClassInstance()
Get UI plugin class.
getParentType()
Get the object type og the parent object.
onClone(array &$a_properties, string $a_plugin_version)
This function is called when the page content is cloned.
setPageObj(ilPageObject $a_page_obj)
Inject the page object This must be public to be called by ilPCPlugged But the page object should not...
getPageId()
Get the id of the page.
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)