3include_once(
"./Services/Component/classes/class.ilPlugin.php");
42 return "RepositoryObject";
94 $type = $this->
getId();
96 if (substr($type, 0, 1) !=
"x")
98 throw new ilPluginException(
"Object plugin type must start with an x. Current type is ".$type.
".");
102 $set =
$ilDB->query(
"SELECT * FROM object_data ".
103 " WHERE type = ".
$ilDB->quote(
"typ",
"text").
104 " AND title = ".$ilDB->quote($type,
"text")
106 if ($rec =
$ilDB->fetchAssoc($set))
108 $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").
",".
118 $ilDB->quote(
"Plugin ".$this->getPluginName(),
"text").
",".
119 $ilDB->quote(-1,
"integer").
",".
127 $ops = array(1, 2, 3, 4, 6);
132 foreach ($ops as $op)
135 $set =
$ilDB->query(
"SELECT * FROM rbac_ta ".
136 " WHERE typ_id = ".
$ilDB->quote($t_id,
"integer").
137 " AND ops_id = ".$ilDB->quote($op,
"integer")
139 if (!
$ilDB->fetchAssoc($set))
141 $ilDB->manipulate(
"INSERT INTO rbac_ta ".
142 "(typ_id, ops_id) VALUES (".
143 $ilDB->quote($t_id,
"integer").
",".
144 $ilDB->quote($op,
"integer").
150 $set =
$ilDB->query(
"SELECT * FROM rbac_operations ".
151 " WHERE class = ".
$ilDB->quote(
"create",
"text").
152 " AND operation = ".$ilDB->quote(
"create_".$type,
"text")
154 if ($rec =
$ilDB->fetchAssoc($set))
156 $create_ops_id = $rec[
"ops_id"];
160 $create_ops_id =
$ilDB->nextId(rbac_operations);
161 $ilDB->manipulate(
"INSERT INTO rbac_operations ".
162 "(ops_id, operation, description, class) VALUES (".
163 $ilDB->quote($create_ops_id,
"integer").
",".
164 $ilDB->quote(
"create_".$type,
"text").
",".
165 $ilDB->quote(
"create ".$type,
"text").
",".
166 $ilDB->quote(
"create",
"text").
172 foreach ($par_types as $par_type)
174 $set =
$ilDB->query(
"SELECT obj_id FROM object_data ".
175 " WHERE type = ".
$ilDB->quote(
"typ",
"text").
176 " AND title = ".$ilDB->quote($par_type,
"text")
178 if ($rec =
$ilDB->fetchAssoc($set))
180 if ($rec[
"obj_id"] > 0)
182 $set =
$ilDB->query(
"SELECT * FROM rbac_ta ".
183 " WHERE typ_id = ".
$ilDB->quote($rec[
"obj_id"],
"integer").
184 " AND ops_id = ".$ilDB->quote($create_ops_id,
"integer")
186 if (!
$ilDB->fetchAssoc($set))
188 $ilDB->manipulate(
"INSERT INTO rbac_ta ".
189 "(typ_id, ops_id) VALUES (".
190 $ilDB->quote($rec[
"obj_id"],
"integer").
",".
191 $ilDB->quote($create_ops_id,
"integer").
214 include_once
"Services/Repository/classes/class.ilRepUtil.php";
216 $rep_util->deleteObjectType($this->
getId());
230 $par_types = array(
"root",
"cat",
"crs",
"grp",
"fold");
An exception for terminatinating execution or to throw for unit testing.
static _getImagePath($a_ctype, $a_cname, $a_slot_id, $a_pname, $a_img)
Get image path.
static lookupNameForId($a_ctype, $a_cname, $a_slot_id, $a_plugin_id)
Lookup name for id.
static _getOperationIdByName($a_operation)
get operation id by name of operation @access public @access static
Repository Utilities (application layer, put GUI related stuff into ilRepUtilGUI)
Abstract parent class for all repository object plugin classes.
allowCopy()
decides if this repository plugin can be copied
static _getIcon($a_type, $a_size)
Get Icon.
getComponentName()
Get Component Name.
getComponentType()
Get Component Type.
static _getName($a_id)
Get class name.
beforeActivation()
Before activation processing.
slotInit()
Object initialization done by slot.
static now()
Return current timestamp in Y-m-d H:i:s format.