98 function ilObject($a_id = 0, $a_reference =
true)
102 $ilBench->start(
"Core",
"ilObject_Constructor");
106 echo
"<br/><font color=\"red\">type(".$this->type.
") id(".$a_id.
") referenced(".$a_reference.
")</font>";
112 $this->max_title = MAXLENGTH_OBJ_TITLE;
113 $this->max_desc = MAXLENGTH_OBJ_DESC;
114 $this->add_dots =
true;
116 $this->referenced = $a_reference;
117 $this->call_by_reference = $a_reference;
121 $this->referenced =
false;
124 if ($this->referenced)
126 $this->ref_id = $a_id;
138 $ilBench->stop(
"Core",
"ilObject_Constructor");
156 function read($a_force_db =
false)
160 $ilBench->start(
"Core",
"ilObject_read");
162 if (isset($this->obj_data_record) && !$a_force_db)
166 else if ($this->referenced)
169 if (!isset($this->ref_id))
171 $message =
"ilObject::read(): No ref_id given! (".$this->type.
")";
172 $this->ilias->raiseError($message,$this->ilias->error_obj->WARNING);
176 $ilBench->start(
"Core",
"ilObject_read_readData");
178 $q =
"SELECT * FROM object_data, object_reference WHERE object_data.obj_id=object_reference.obj_id ".
179 "AND object_reference.ref_id= ".$ilDB->quote($this->ref_id,
"integer");
180 $object_set = $ilDB->query($q);
181 $ilBench->stop(
"Core",
"ilObject_read_readData");
184 if ($ilDB->numRows($object_set) == 0)
186 $message =
"ilObject::read(): Object with ref_id ".$this->ref_id.
" not found! (".$this->type.
")";
187 $this->ilias->raiseError($message,$this->ilias->error_obj->WARNING);
190 $obj = $ilDB->fetchAssoc($object_set);
195 if (!isset($this->
id))
197 $message =
"ilObject::read(): No obj_id given! (".$this->type.
")";
198 $this->ilias->raiseError($message,$this->ilias->error_obj->WARNING);
202 $q =
"SELECT * FROM object_data ".
203 "WHERE obj_id = ".$ilDB->quote($this->
id,
"integer");
204 $object_set = $ilDB->query($q);
207 if ($ilDB->numRows($object_set) == 0)
209 $message =
"ilObject::read(): Object with obj_id: ".$this->id.
" (".$this->type.
") not found!";
210 $this->ilias->raiseError($message,$this->ilias->error_obj->WARNING);
213 $obj = $ilDB->fetchAssoc($object_set);
216 $this->
id = $obj[
"obj_id"];
219 if ($this->type != $obj[
"type"] && $obj[
"type"] !=
"xxx")
221 $message =
"ilObject::read(): Type mismatch. Object with obj_id: ".$this->id.
" ".
222 "was instantiated by type '".$this->type.
"'. DB type is: ".$obj[
"type"];
225 $log->write($message);
228 $this->ilias->raiseError(
"ilObject::read(): Type mismatch. (".$this->type.
"/".$this->id.
")",$this->ilias->error_obj->WARNING);
231 $this->type = $obj[
"type"];
232 $this->title = $obj[
"title"];
234 $this->untranslatedTitle = $obj[
"title"];
236 $this->desc = $obj[
"description"];
237 $this->owner = $obj[
"owner"];
238 $this->create_date = $obj[
"create_date"];
239 $this->last_update = $obj[
"last_update"];
240 $this->import_id = $obj[
"import_id"];
242 if($objDefinition->isRBACObject($this->getType()))
245 $query =
"SELECT * FROM object_description WHERE obj_id = ".$ilDB->quote($this->
id,
'integer');
249 if(strlen(
$row->description))
257 $ilBench->start(
"Core",
"ilObject_Constructor_getTranslation");
258 $translation_type = $objDefinition->getTranslationType($this->type);
260 if ($translation_type ==
"sys")
262 $this->title = $this->lng->txt(
"obj_".$this->type);
263 $this->desc = $this->lng->txt(
"obj_".$this->type.
"_desc");
265 elseif ($translation_type ==
"db")
267 $q =
"SELECT title,description FROM object_translation ".
268 "WHERE obj_id = ".$ilDB->quote($this->
id,
'integer').
" ".
269 "AND lang_code = ".$ilDB->quote($this->ilias->account->getCurrentLanguage(),
'text').
" ".
270 "AND NOT lang_default = 1";
271 $r = $this->ilias->db->query($q);
276 $this->title =
$row->title;
278 #$this->desc = $row->description;
282 $ilBench->stop(
"Core",
"ilObject_Constructor_getTranslation");
284 $ilBench->stop(
"Core",
"ilObject_read");
314 $this->ref_id = $a_id;
315 $this->referenced =
true;
345 $this->type = $a_type;
420 $this->long_desc = $a_desc;
433 return strlen($this->long_desc) ? $this->long_desc :
$this->desc;
455 $this->import_id = $a_import_id;
462 $query =
"SELECT * FROM object_data ".
463 "WHERE import_id = ".$ilDB->quote($a_import_id,
"text").
" ".
464 "ORDER BY create_date DESC";
466 while(
$row = $ilDB->fetchObject(
$res))
502 if ($a_owner_id != -1)
512 $own_name =
$owner->getFullname();
516 $own_name = $lng->txt(
"unknown");
530 $this->owner = $a_owner;
582 $this->obj_data_record = $a_record;
595 global
$ilDB,
$log,$ilUser,$objDefinition;
597 if (!isset($this->type))
599 $message = get_class($this).
"::create(): No object type given!";
600 $this->ilias->raiseError($message,$this->ilias->error_obj->WARNING);
604 $log->write(
"ilObject::create(), start");
614 elseif(is_object($ilUser))
616 $owner = $ilUser->getId();
622 $this->
id = $ilDB->nextId(
"object_data");
623 $q =
"INSERT INTO object_data ".
624 "(obj_id,type,title,description,owner,create_date,last_update,import_id) ".
627 $ilDB->quote($this->
id,
"integer").
",".
628 $ilDB->quote($this->type,
"text").
",".
629 $ilDB->quote($this->
getTitle(),
"text").
",".
631 $ilDB->quote(
$owner,
"integer").
",".
636 $ilDB->manipulate($q);
642 if($objDefinition->isRBACObject($this->getType()))
645 'obj_id' => array(
'integer',$this->
id),
648 $ilDB->insert(
'object_description',$values);
655 $q =
"SELECT last_update, create_date FROM object_data".
656 " WHERE obj_id = ".$ilDB->quote($this->
id,
"integer");
657 $obj_set = $ilDB->query($q);
658 $obj_rec = $ilDB->fetchAssoc($obj_set);
659 $this->last_update = $obj_rec[
"last_update"];
660 $this->create_date = $obj_rec[
"create_date"];
666 $log->write(
"ilObject::create(), finished, obj_id: ".$this->
id.
", type: ".
667 $this->type.
", title: ".$this->getTitle());
669 $GLOBALS[
'ilAppEventHandler']->raise(
672 array(
'obj_id' => $this->
id,
'obj_type' => $this->type));
685 global $objDefinition,
$ilDB;
687 $q =
"UPDATE object_data ".
689 "title = ".$ilDB->quote($this->
getTitle(),
"text").
",".
690 "description = ".$ilDB->quote($this->
getDescription(),
"text").
", ".
691 "import_id = ".$ilDB->quote($this->
getImportId(),
"text").
",".
692 "last_update = ".$ilDB->now().
" ".
693 "WHERE obj_id = ".$ilDB->quote($this->
getId(),
"integer");
694 $ilDB->manipulate($q);
699 $q =
"SELECT last_update FROM object_data".
700 " WHERE obj_id = ".$ilDB->quote($this->
getId(),
"integer");
701 $obj_set = $ilDB->query($q);
702 $obj_rec = $ilDB->fetchAssoc($obj_set);
703 $this->last_update = $obj_rec[
"last_update"];
705 if($objDefinition->isRBACObject($this->getType()))
708 $res = $this->ilias->db->query(
"SELECT * FROM object_description WHERE obj_id = ".
709 $ilDB->quote($this->getId(),
'integer'));
715 $ilDB->update(
'object_description',$values,array(
'obj_id' => array(
'integer',$this->
getId())));
721 'obj_id' => array(
'integer',$this->
getId()));
722 $ilDB->insert(
'object_description',$values);
725 $GLOBALS[
'ilAppEventHandler']->raise(
728 array(
'obj_id' => $this->
getId(),
729 'obj_type' => $this->
getType(),
748 include_once
'Services/MetaData/classes/class.ilMD.php';
750 $GLOBALS[
'ilAppEventHandler']->raise(
753 array(
'obj_id' => $this->
getId(),
754 'obj_type' => $this->
getType(),
763 if(!is_object($md_gen = $md->getGeneral()))
767 $this->
setTitle($md_gen->getTitle());
769 foreach($md_gen->getDescriptionIds() as
$id)
771 $md_des = $md_gen->getDescription(
$id);
789 include_once
'Services/MetaData/classes/class.ilMDCreator.php';
794 $md_creator->setTitle($this->
getTitle());
795 $md_creator->setTitleLanguage($ilUser->getPref(
'language'));
797 $md_creator->setDescriptionLanguage($ilUser->getPref(
'language'));
798 $md_creator->setKeywordLanguage($ilUser->getPref(
'language'));
799 $md_creator->setLanguage($ilUser->getPref(
'language'));
800 $md_creator->create();
810 include_once(
"Services/MetaData/classes/class.ilMD.php");
811 include_once(
"Services/MetaData/classes/class.ilMDGeneral.php");
812 include_once(
"Services/MetaData/classes/class.ilMDDescription.php");
815 $md_gen =& $md->getGeneral();
821 $md_gen =& $md->getGeneral();
824 $md_gen->setTitle($this->
getTitle());
827 $md_des_ids =& $md_gen->getDescriptionIds();
828 if (count($md_des_ids) > 0)
830 $md_des =& $md_gen->getDescription($md_des_ids[0]);
844 include_once(
'Services/MetaData/classes/class.ilMD.php');
859 $q =
"UPDATE object_data ".
861 "owner = ".$ilDB->quote($this->
getOwner(),
"integer").
", ".
862 "last_update = ".$ilDB->now().
" ".
863 "WHERE obj_id = ".$ilDB->quote($this->
getId(),
"integer");
864 $ilDB->manipulate($q);
866 $q =
"SELECT last_update FROM object_data".
867 " WHERE obj_id = ".$ilDB->quote($this->
getId(),
"integer");
868 $obj_set = $ilDB->query($q);
869 $obj_rec = $ilDB->fetchAssoc($obj_set);
870 $this->last_update = $obj_rec[
"last_update"];
886 $ilDB->setLimit(1,0);
887 $q =
"SELECT * FROM object_data WHERE import_id = ".$ilDB->quote($a_import_id,
"text").
888 " ORDER BY create_date DESC";
889 $obj_set = $ilDB->query($q);
891 if ($obj_rec = $ilDB->fetchAssoc($obj_set))
893 return $obj_rec[
"obj_id"];
910 $query =
"SELECT * FROM object_reference WHERE obj_id = ".
911 $ilDB->quote($a_id,
'integer');
915 while($obj_rec = $ilDB->fetchAssoc(
$res))
917 $ref[$obj_rec[
"ref_id"]] = $obj_rec[
"ref_id"];
930 global $ilObjDataCache;
932 $tit = $ilObjDataCache->lookupTitle($a_id);
943 global $ilObjDataCache;
945 $owner = $ilObjDataCache->lookupOwner($a_id);
954 ?
"SELECT obj_id FROM object_data WHERE title = ".$ilDB->quote(
$title,
"text")
955 :
"SELECT obj_id FROM object_data WHERE ".$ilDB->like(
"title",
"text",
'%'.
$title.
'%');
958 $query .=
" AND type = ".$ilDB->quote(
$type,
"text");
963 $object_ids = array();
966 $object_ids[] =
$row[
'obj_id'];
969 return is_array($object_ids) ? $object_ids : array();
979 global $ilObjDataCache;
981 return $ilObjDataCache->lookupDescription($a_id);
991 global $ilObjDataCache;
999 return $ilObjDataCache->lookupLastUpdate($a_id);
1012 if (!is_array($a_objs))
1014 $a_objs = array($a_objs);
1017 $set = $ilDB->query(
"SELECT max(last_update) as last_update FROM object_data ".
1018 "WHERE ".$ilDB->in(
"obj_id", $a_objs,
false,
"integer").
" ");
1019 $rec = $ilDB->fetchAssoc($set);
1021 return ($rec[
"last_update"]);
1026 global $ilObjDataCache;
1028 return (
int) $ilObjDataCache->lookupObjId($a_id);
1038 $query =
"UPDATE object_reference SET deleted= ".$ilDB->now().
' '.
1039 "WHERE ref_id = ".$ilDB->quote($a_ref_id,
'integer');
1050 $query =
"UPDATE object_reference SET deleted = ".$ilDB->quote(null,
'timestamp').
1051 " WHERE ref_id = ".$ilDB->quote($a_ref_id,
'integer');
1062 $query =
"SELECT deleted FROM object_reference".
1063 " WHERE ref_id = ".$ilDB->quote($a_ref_id,
"integer");
1064 $set = $ilDB->query(
$query);
1065 $rec = $ilDB->fetchAssoc($set);
1067 return $rec[
"deleted"];
1082 $q =
"UPDATE object_data ".
1084 "title = ".$ilDB->quote($a_title,
"text").
",".
1085 "last_update = ".$ilDB->now().
" ".
1086 "WHERE obj_id = ".$ilDB->quote($a_obj_id,
"integer");
1088 $ilDB->manipulate($q);
1100 global
$ilDB,$objDefinition;
1105 $q =
"UPDATE object_data ".
1107 "description = ".$ilDB->quote(
$desc,
"text").
",".
1108 "last_update = ".$ilDB->now().
" ".
1109 "WHERE obj_id = ".$ilDB->quote($a_obj_id,
"integer");
1111 $ilDB->manipulate($q);
1113 if($objDefinition->isRBACObject($this->getType()))
1116 $res = $ilDB->query(
"SELECT * FROM object_description WHERE obj_id = ".
1117 $ilDB->quote($a_obj_id,
'integer'));
1124 $ilDB->update(
'object_description',$values,array(
'obj_id' => array(
'integer',$this->
getId())));
1130 'obj_id' => array(
'integer',$this->
getId()));
1131 $ilDB->insert(
'object_description',$values);
1147 $q =
"UPDATE object_data ".
1149 "import_id = ".$ilDB->quote($a_import_id,
"text").
",".
1150 "last_update = ".$ilDB->now().
" ".
1151 "WHERE obj_id = ".$ilDB->quote($a_obj_id,
"integer");
1153 $ilDB->manipulate($q);
1163 global $ilObjDataCache;
1167 return $ilObjDataCache->lookupType($ilObjDataCache->lookupObjId($a_id));
1169 return $ilObjDataCache->lookupType($a_id);
1173 if ($a_reference ===
true)
1175 $q =
"SELECT type FROM object_reference obr, object_data obd ".
1176 "WHERE obr.ref_id = ".$ilDB->quote($a_id,
"integer").
" ".
1177 "AND obr.obj_id = obd.obj_id ";
1181 $q =
"SELECT type FROM object_data WHERE obj_id = ".$ilDB->quote($a_id,
"integer");
1184 $obj_set = $ilDB->query($q);
1185 $obj_rec = $ilDB->fetchAssoc($obj_set);
1187 return $obj_rec[
"type"];
1197 return $tree->isSaved($a_ref_id);
1224 global $ilObjDataCache;
1226 return (
int) $ilObjDataCache->lookupObjId($a_ref_id);
1243 $q =
"SELECT * FROM object_data WHERE type = ".$ilDB->quote($a_type,
"text");
1244 $obj_set = $ilDB->query($q);
1247 while ($obj_rec = $ilDB->fetchAssoc($obj_set))
1251 $objects[$obj_rec[
"title"].
".".$obj_rec[
"obj_id"]] = array(
"id" => $obj_rec[
"obj_id"],
1252 "type" => $obj_rec[
"type"],
"title" => $obj_rec[
"title"],
1253 "description" => $obj_rec[
"description"]);
1269 $tree->insertNode($this->
getRefId(), $a_parent_ref);
1272 $log->write(
"ilObject::putInTree(), parent_ref: $a_parent_ref, ref_id: ".
1286 global $rbacadmin, $rbacreview;
1288 $parentRoles = $rbacreview->getParentRoleIds($a_parent_ref);
1290 foreach ($parentRoles as $parRol)
1292 $ops = $rbacreview->getOperationsOfRole($parRol[
"obj_id"], $this->
getType(), $parRol[
"parent"]);
1293 $rbacadmin->grantPermission($parRol[
"obj_id"], $ops, $this->
getRefId());
1309 if (!isset($this->
id))
1311 $message =
"ilObject::createNewReference(): No obj_id given!";
1312 $this->raiseError($message,$this->ilias->error_obj->WARNING);
1315 $next_id = $ilDB->nextId(
'object_reference');
1316 $query =
"INSERT INTO object_reference ".
1317 "(ref_id, obj_id) VALUES (".$ilDB->quote($next_id,
'integer').
','.$ilDB->quote($this->
id ,
'integer').
")";
1318 $this->ilias->db->query(
$query);
1320 $this->ref_id = $next_id;
1321 $this->referenced =
true;
1337 if (!isset($this->
id))
1339 $message =
"ilObject::countReferences(): No obj_id given!";
1340 $this->ilias->raiseError($message,$this->ilias->error_obj->WARNING);
1343 $query =
"SELECT COUNT(ref_id) num FROM object_reference ".
1344 "WHERE obj_id = ".$ilDB->quote($this->
id,
'integer').
" ";
1374 if ($this->type != $db_type)
1376 $message =
"ilObject::delete(): Type mismatch. Object with obj_id: ".$this->id.
" ".
1377 "was instantiated by type '".$this->type.
"'. DB type is: ".$db_type;
1380 $log->write($message);
1383 $this->ilias->raiseError(
"ilObject::delete(): Type mismatch. (".$this->type.
"/".$this->id.
")",$this->ilias->error_obj->WARNING);
1387 $q =
"DELETE FROM object_data ".
1388 "WHERE obj_id = ".$ilDB->quote($this->
getId(),
"integer");
1389 $ilDB->manipulate($q);
1392 $query =
"DELETE FROM object_description WHERE obj_id = ".
1393 $ilDB->quote($this->
getId(),
"integer");
1394 $ilDB->manipulate(
$query);
1397 $log->write(
"ilObject::delete(), deleted object, obj_id: ".$this->
getId().
", type: ".
1401 include_once(
"./Services/News/classes/class.ilNewsItem.php");
1403 $news_item->deleteNewsOfContext($this->
getId(), $this->
getType());
1404 include_once(
"./Services/Block/classes/class.ilBlockSetting.php");
1407 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateObjSettings.php';
1423 $query =
"DELETE FROM dav_property ".
1424 "WHERE obj_id = ".$ilDB->quote($this->
getId(),
'integer');
1433 $log->write(
"ilObject::delete(), object not deleted, number of references: ".
1439 if ($this->referenced)
1442 $query =
"DELETE FROM object_reference ".
1443 "WHERE ref_id = ".$ilDB->quote($this->
getRefId(),
'integer');
1447 $log->write(
"ilObject::delete(), reference deleted, ref_id: ".$this->
getRefId().
1448 ", obj_id: ".$this->
getId().
", type: ".
1455 $rbacadmin->revokePermission($this->
getRefId(),0,
false);
1457 include_once
"Services/AccessControl/classes/class.ilRbacLog.php";
1461 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateObjSettings.php';
1469 if ($this->referenced)
1507 if ($rolf_data = $rbacreview->getRoleFolderofObject($this->getRefId()))
1509 $rfoldObj = $this->ilias->obj_factory->getInstanceByRefId($rolf_data[
"ref_id"]);
1513 include_once (
"./Services/AccessControl/classes/class.ilObjRoleFolder.php");
1515 $rfoldObj->setTitle($this->
getId());
1516 $rfoldObj->setDescription(
" (ref_id ".$this->
getRefId().
")");
1517 $rfoldObj->create();
1518 $rfoldObj->createReference();
1519 $rfoldObj->putInTree($this->
getRefId());
1520 $rfoldObj->setPermissions($this->
getRefId());
1537 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateObjSettings.php';
1540 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateActionFactory.php';
1543 $action->setRefId($this->
getRefId());
1562 $q =
"SELECT * FROM object_data ".
1563 "LEFT JOIN object_reference ON object_reference.obj_id=object_data.obj_id ".
1564 "WHERE object_reference.ref_id= ".$ilDB->quote($a_id,
"integer");
1568 $q =
"SELECT * FROM object_data WHERE obj_id=".$ilDB->quote($a_id,
"integer");
1571 $r = $ilDB->query($q);
1573 return $ilDB->numRows($r) ?
true :
false;
1588 function notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params = 0)
1592 $parent_id = (int) $tree->getParentId($a_node_id);
1594 if ($parent_id != 0)
1596 $obj_data =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
1597 $obj_data->notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$parent_id,$a_params);
1606 $this->
register = (bool) $a_bool;
1638 $order =
" ORDER BY title";
1643 $where_clause =
"WHERE type = ".
1644 $ilDB->quote($a_obj_type,
"text");
1648 $where_clause.=
" AND owner = ".$ilDB->quote($a_owner,
"integer");
1652 $q =
"SELECT * FROM object_data ".$where_clause.$order;
1653 $r = $ilDB->query($q);
1656 if ($ilDB->numRows($r) > 0)
1658 while (
$row = $ilDB->fetchAssoc($r))
1660 $row[
"desc"] =
$row[
"description"];
1680 $query =
"SELECT obj_data.title obj_title,path_data.title path_title,child FROM tree ".
1681 "JOIN object_reference obj_ref ON child = obj_ref.ref_id ".
1682 "JOIN object_data obj_data ON obj_ref.obj_id = obj_data.obj_id ".
1683 "JOIN object_reference path_ref ON parent = path_ref.ref_id ".
1684 "JOIN object_data path_data ON path_ref.obj_id = path_data.obj_id ".
1685 "WHERE ".$ilDB->in(
"child", $a_ref_ids,
false,
"integer").
" ".
1686 "ORDER BY obj_data.title ";
1689 if (!$objDefinition->isPlugin($new_type))
1691 $options[0] = $lng->txt(
'obj_'.$new_type.
'_select');
1695 include_once(
"./Services/Component/classes/class.ilPlugin.php");
1699 while(
$row = $ilDB->fetchObject(
$res))
1708 if(strlen(
$path =
$row->path_title) > 40)
1718 return $options ? $options : array();
1730 public function cloneObject($a_target_id,$a_copy_id = 0,$a_omit_tree =
false)
1732 global $objDefinition,$ilUser,$rbacadmin,
$ilDB;
1735 $class_name = (
'ilObj'.$objDefinition->getClassName($this->
getType()));
1747 include_once(
$location.
"/class.".$class_name.
".php");
1748 $new_obj =
new $class_name(0,
false);
1749 $new_obj->setOwner($ilUser->getId());
1750 $new_obj->setTitle(
$title);
1752 $new_obj->setType($this->
getType());
1754 $new_obj->create(
true);
1758 $new_obj->createReference();
1759 $new_obj->putInTree($a_target_id);
1760 $new_obj->setPermissions($a_target_id);
1766 $rbacadmin->copyLocalRoles($this->
getRefId(),$new_obj->getRefId());
1770 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php');
1774 $query =
"INSERT INTO dav_property (obj_id,node_id,ns,name,value) ".
1775 "SELECT ".$ilDB->quote($new_obj->getId(),
'integer').
",node_id,ns,name,value ".
1776 "FROM dav_property ".
1777 "WHERE obj_id = ".$ilDB->quote($this->getId(),
'integer');
1778 $res = $ilDB->manipulate($query);
1795 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
1797 if(!$cp_options->isRootNode($this->getRefId()))
1801 $nodes = $tree->getChilds($a_target_id);
1803 $title_unique =
false;
1804 require_once
'Modules/File/classes/class.ilObjFileAccess.php';
1807 while(!$title_unique)
1810 foreach($nodes as $node)
1812 if((
$title == $node[
'title']) and ($this->
getType() == $node[
'type']))
1843 include_once
'./Services/AccessControl/classes/class.ilConditionHandler.php';
1844 include_once
'./Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
1847 $mappings = $cwo->getMappings();
1850 foreach($conditions as $con)
1852 if($mappings[$con[
'trigger_ref_id']])
1859 $newCondition->setTargetRefId($a_target_id);
1860 $newCondition->setTargetObjId($target_obj);
1861 $newCondition->setTargetType($target_typ);
1863 $trigger_ref = $mappings[$con[
'trigger_ref_id']];
1867 $newCondition->setTriggerRefId($trigger_ref);
1868 $newCondition->setTriggerObjId($trigger_obj);
1869 $newCondition->setTriggerType($trigger_typ);
1870 $newCondition->setOperator($con[
'operator']);
1871 $newCondition->setValue($con[
'value']);
1872 $newCondition->setReferenceHandlingType($con[
'ref_handling']);
1873 $newCondition->setObligatory($con[
'obligatory']);
1874 $newCondition->storeCondition();
1889 include_once
"./Services/MetaData/classes/class.ilMD.php";
1891 $md->cloneMD($target_obj->getId(),0,$target_obj->getType());
1903 public static function _getIcon($a_obj_id =
"", $a_size =
"big", $a_type =
"",
1908 if ($a_obj_id ==
"" && $a_type ==
"")
1923 if ($ilSetting->get(
"custom_icons") &&
1924 in_array($a_type, array(
"cat",
"grp",
"crs",
"root")))
1926 require_once(
"./Services/Container/classes/class.ilContainer.php");
1930 $file_name = $cont_dir.
"/icon_".$a_size.
".gif";
1941 case "small": $suff =
"";
break;
1942 case "tiny": $suff =
"_s";
break;
1943 default: $suff =
"_b";
break;
1947 if ($objDefinition->isRBACObject($a_type))
1949 if (!$objDefinition->isPlugin($a_type))
1955 include_once(
"./Services/Repository/classes/class.ilRepositoryObjectPlugin.php");
1963 return "./images/icon_".$a_type.$suff.
".gif";
1975 global $objDefinition, $tree;
1979 $deps[
"dep"] = array();
1982 $deps[
"del_ids"][$a_obj_id] = $a_obj_id;
1984 if (!$objDefinition->isPlugin(
$type))
1986 $class_name =
"ilObj".$objDefinition->getClassName($a_type);
1987 $location = $objDefinition->getLocation($a_type);
1988 include_once(
$location.
"/class.".$class_name.
".php");
1989 $odeps = call_user_func(array($class_name,
"getDeletionDependencies"), $a_obj_id);
1990 if (is_array($odeps))
1992 foreach ($odeps as
$id => $message)
1994 $deps[
"dep"][
$id][$a_obj_id][] = $message;
1999 foreach ($tree->getChilds($a_ref_id) as $c)
2008 foreach ($deps[
"del_ids"] as $obj_id)
2010 unset($deps[
"dep"][$obj_id]);
2012 $deps = $deps[
"dep"];