41 public static function _getImagePath(
string $a_ctype,
string $a_cname,
string $a_slot_id,
string $a_pname,
string $a_img): string
46 if (is_int(strpos($img,
"Customizing"))) {
55 $d2 = $component->getId() .
"_" . $a_slot_id .
"_" .
$plugin->getId();
58 if (is_int(strpos($img,
"Customizing"))) {
63 return $d .
"/templates/images/" . $a_img;
68 public static function _getIcon(
string $a_type): string
72 return self::_getImagePath(
77 "icon_" . $a_type .
".svg" 81 public static function _getName(
string $a_id): string
97 $type = $this->
getId();
99 if (strpos($type,
"x") !== 0) {
100 throw new ilPluginException(
"Object plugin type must start with an x. Current type is " . $type .
".");
105 "SELECT * FROM object_data " .
106 " WHERE type = " .
$ilDB->quote(
"typ",
"text") .
107 " AND title = " .
$ilDB->quote($type,
"text")
109 if ($rec =
$ilDB->fetchAssoc($set)) {
110 $t_id = $rec[
"obj_id"];
112 $t_id =
$ilDB->nextId(
"object_data");
113 $ilDB->manipulate(
"INSERT INTO object_data " .
114 "(obj_id, type, title, description, owner, create_date, last_update) VALUES (" .
115 $ilDB->quote($t_id,
"integer") .
"," .
116 $ilDB->quote(
"typ",
"text") .
"," .
117 $ilDB->quote($type,
"text") .
"," .
119 $ilDB->quote(-1,
"integer") .
"," .
127 $ops = [1, 2, 3, 4, 6];
131 foreach ($ops as $op) {
134 "SELECT * FROM rbac_ta " .
135 " WHERE typ_id = " .
$ilDB->quote($t_id,
"integer") .
136 " AND ops_id = " .
$ilDB->quote($op,
"integer")
138 if (!
$ilDB->fetchAssoc($set)) {
139 $ilDB->manipulate(
"INSERT INTO rbac_ta " .
140 "(typ_id, ops_id) VALUES (" .
141 $ilDB->quote($t_id,
"integer") .
"," .
142 $ilDB->quote($op,
"integer") .
149 "SELECT * FROM rbac_operations " .
150 " WHERE class = " .
$ilDB->quote(
"create",
"text") .
151 " AND operation = " .
$ilDB->quote(
"create_" . $type,
"text")
153 if ($rec =
$ilDB->fetchAssoc($set)) {
154 $create_ops_id = $rec[
"ops_id"];
156 $create_ops_id =
$ilDB->nextId(
"rbac_operations");
157 $ilDB->manipulate(
"INSERT INTO rbac_operations " .
158 "(ops_id, operation, description, class) VALUES (" .
159 $ilDB->quote($create_ops_id,
"integer") .
"," .
160 $ilDB->quote(
"create_" . $type,
"text") .
"," .
161 $ilDB->quote(
"create " . $type,
"text") .
"," .
162 $ilDB->quote(
"create",
"text") .
168 foreach ($par_types as $par_type) {
170 "SELECT obj_id FROM object_data " .
171 " WHERE type = " .
$ilDB->quote(
"typ",
"text") .
172 " AND title = " .
$ilDB->quote($par_type,
"text")
174 if (($rec =
$ilDB->fetchAssoc($set)) && $rec[
"obj_id"] > 0) {
176 "SELECT * FROM rbac_ta " .
177 " WHERE typ_id = " .
$ilDB->quote($rec[
"obj_id"],
"integer") .
178 " AND ops_id = " .
$ilDB->quote($create_ops_id,
"integer")
180 if (!
$ilDB->fetchAssoc($set)) {
181 $ilDB->manipulate(
"INSERT INTO rbac_ta " .
182 "(typ_id, ops_id) VALUES (" .
183 $ilDB->quote($rec[
"obj_id"],
"integer") .
"," .
184 $ilDB->quote($create_ops_id,
"integer") .
206 $rep_util->deleteObjectType($this->
getId());
221 $par_types = [
"root",
"cat",
"crs",
"grp",
"fold"];
244 return $lh->getPrefix();
hasPluginId(string $id)
Check if a plugin exists.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getName(string $a_id)
useOrguPermissions()
Decide if this repository plugin uses OrgUnit Permissions.
static now()
Return current timestamp in Y-m-d H:i:s format.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getPluginByName(string $name)
Get a plugin by name.
ilComponentRepositoryWrite $component_repository
static _getIcon(string $a_type)
allowCopy()
decides if this repository plugin can be copied
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
getPluginById(string $id)
Get a plugin by id.
static _getOperationIdByName(string $a_operation)
get operation id by name of operation
getComponentByTypeAndName(string $type, string $name)
Get a component by type and name.
static _getImagePath(string $a_ctype, string $a_cname, string $a_slot_id, string $a_pname, string $a_img)
Only very little classes seem to care about this: