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 include_once(
"./Services/Object/exceptions/class.ilObjectNotFoundException.php");
211 " (".$this->type.
") not found!");
215 $obj = $ilDB->fetchAssoc($object_set);
218 $this->
id = $obj[
"obj_id"];
221 if ($this->type != $obj[
"type"] && $obj[
"type"] !=
"xxx")
223 $message =
"ilObject::read(): Type mismatch. Object with obj_id: ".$this->id.
" ".
224 "was instantiated by type '".$this->type.
"'. DB type is: ".$obj[
"type"];
227 $log->write($message);
230 $this->ilias->raiseError(
"ilObject::read(): Type mismatch. (".$this->type.
"/".$this->id.
")",$this->ilias->error_obj->WARNING);
233 $this->type = $obj[
"type"];
234 $this->title = $obj[
"title"];
236 $this->untranslatedTitle = $obj[
"title"];
238 $this->desc = $obj[
"description"];
239 $this->owner = $obj[
"owner"];
240 $this->create_date = $obj[
"create_date"];
241 $this->last_update = $obj[
"last_update"];
242 $this->import_id = $obj[
"import_id"];
244 if($objDefinition->isRBACObject($this->getType()))
247 $query =
"SELECT * FROM object_description WHERE obj_id = ".$ilDB->quote($this->
id,
'integer');
251 if(strlen(
$row->description))
259 $ilBench->start(
"Core",
"ilObject_Constructor_getTranslation");
260 $translation_type = $objDefinition->getTranslationType($this->type);
262 if ($translation_type ==
"sys")
264 $this->title = $this->lng->txt(
"obj_".$this->type);
265 $this->desc = $this->lng->txt(
"obj_".$this->type.
"_desc");
267 elseif ($translation_type ==
"db")
269 $q =
"SELECT title,description FROM object_translation ".
270 "WHERE obj_id = ".$ilDB->quote($this->
id,
'integer').
" ".
271 "AND lang_code = ".$ilDB->quote($this->ilias->account->getCurrentLanguage(),
'text').
" ".
272 "AND NOT lang_default = 1";
273 $r = $this->ilias->db->query($q);
278 $this->title =
$row->title;
280 #$this->desc = $row->description;
284 $ilBench->stop(
"Core",
"ilObject_Constructor_getTranslation");
286 $ilBench->stop(
"Core",
"ilObject_read");
316 $this->ref_id = $a_id;
317 $this->referenced =
true;
347 $this->type = $a_type;
422 $this->long_desc = $a_desc;
435 return strlen($this->long_desc) ? $this->long_desc :
$this->desc;
457 $this->import_id = $a_import_id;
464 $query =
"SELECT * FROM object_data ".
465 "WHERE import_id = ".$ilDB->quote($a_import_id,
"text").
" ".
466 "ORDER BY create_date DESC";
468 while(
$row = $ilDB->fetchObject(
$res))
504 if ($a_owner_id != -1)
514 $own_name =
$owner->getFullname();
518 $own_name = $lng->txt(
"unknown");
532 $this->owner = $a_owner;
584 $this->obj_data_record = $a_record;
599 if (!isset($this->type))
601 $message = get_class($this).
"::create(): No object type given!";
602 $this->ilias->raiseError($message,$this->ilias->error_obj->WARNING);
606 $log->write(
"ilObject::create(), start");
616 elseif(is_object($ilUser))
618 $owner = $ilUser->getId();
624 $this->
id = $ilDB->nextId(
"object_data");
625 $q =
"INSERT INTO object_data ".
626 "(obj_id,type,title,description,owner,create_date,last_update,import_id) ".
629 $ilDB->quote($this->
id,
"integer").
",".
630 $ilDB->quote($this->type,
"text").
",".
631 $ilDB->quote($this->
getTitle(),
"text").
",".
633 $ilDB->quote(
$owner,
"integer").
",".
638 $ilDB->manipulate($q);
644 if($objDefinition->isRBACObject($this->getType()))
647 'obj_id' => array(
'integer',$this->
id),
650 $ilDB->insert(
'object_description',$values);
657 $q =
"SELECT last_update, create_date FROM object_data".
658 " WHERE obj_id = ".$ilDB->quote($this->
id,
"integer");
659 $obj_set = $ilDB->query($q);
660 $obj_rec = $ilDB->fetchAssoc($obj_set);
661 $this->last_update = $obj_rec[
"last_update"];
662 $this->create_date = $obj_rec[
"create_date"];
668 $log->write(
"ilObject::create(), finished, obj_id: ".$this->
id.
", type: ".
669 $this->type.
", title: ".$this->getTitle());
671 $GLOBALS[
'ilAppEventHandler']->raise(
674 array(
'obj_id' => $this->
id,
'obj_type' => $this->type));
687 global $objDefinition, $ilDB;
689 $q =
"UPDATE object_data ".
691 "title = ".$ilDB->quote($this->
getTitle(),
"text").
",".
692 "description = ".$ilDB->quote($this->
getDescription(),
"text").
", ".
693 "import_id = ".$ilDB->quote($this->
getImportId(),
"text").
",".
694 "last_update = ".$ilDB->now().
" ".
695 "WHERE obj_id = ".$ilDB->quote($this->
getId(),
"integer");
696 $ilDB->manipulate($q);
701 $q =
"SELECT last_update FROM object_data".
702 " WHERE obj_id = ".$ilDB->quote($this->
getId(),
"integer");
703 $obj_set = $ilDB->query($q);
704 $obj_rec = $ilDB->fetchAssoc($obj_set);
705 $this->last_update = $obj_rec[
"last_update"];
707 if($objDefinition->isRBACObject($this->getType()))
710 $res = $this->ilias->db->query(
"SELECT * FROM object_description WHERE obj_id = ".
711 $ilDB->quote($this->getId(),
'integer'));
717 $ilDB->update(
'object_description',$values,array(
'obj_id' => array(
'integer',$this->
getId())));
723 'obj_id' => array(
'integer',$this->
getId()));
724 $ilDB->insert(
'object_description',$values);
727 $GLOBALS[
'ilAppEventHandler']->raise(
730 array(
'obj_id' => $this->
getId(),
731 'obj_type' => $this->
getType(),
750 include_once
'Services/MetaData/classes/class.ilMD.php';
752 $GLOBALS[
'ilAppEventHandler']->raise(
755 array(
'obj_id' => $this->
getId(),
756 'obj_type' => $this->
getType(),
765 if(!is_object($md_gen = $md->getGeneral()))
769 $this->
setTitle($md_gen->getTitle());
771 foreach($md_gen->getDescriptionIds() as
$id)
773 $md_des = $md_gen->getDescription(
$id);
791 include_once
'Services/MetaData/classes/class.ilMDCreator.php';
796 $md_creator->setTitle($this->
getTitle());
797 $md_creator->setTitleLanguage($ilUser->getPref(
'language'));
799 $md_creator->setDescriptionLanguage($ilUser->getPref(
'language'));
800 $md_creator->setKeywordLanguage($ilUser->getPref(
'language'));
801 $md_creator->setLanguage($ilUser->getPref(
'language'));
802 $md_creator->create();
812 include_once(
"Services/MetaData/classes/class.ilMD.php");
813 include_once(
"Services/MetaData/classes/class.ilMDGeneral.php");
814 include_once(
"Services/MetaData/classes/class.ilMDDescription.php");
817 $md_gen =& $md->getGeneral();
823 $md_gen =& $md->getGeneral();
826 $md_gen->setTitle($this->
getTitle());
829 $md_des_ids =& $md_gen->getDescriptionIds();
830 if (count($md_des_ids) > 0)
832 $md_des =& $md_gen->getDescription($md_des_ids[0]);
846 include_once(
'Services/MetaData/classes/class.ilMD.php');
861 $q =
"UPDATE object_data ".
863 "owner = ".$ilDB->quote($this->
getOwner(),
"integer").
", ".
864 "last_update = ".$ilDB->now().
" ".
865 "WHERE obj_id = ".$ilDB->quote($this->
getId(),
"integer");
866 $ilDB->manipulate($q);
868 $q =
"SELECT last_update FROM object_data".
869 " WHERE obj_id = ".$ilDB->quote($this->
getId(),
"integer");
870 $obj_set = $ilDB->query($q);
871 $obj_rec = $ilDB->fetchAssoc($obj_set);
872 $this->last_update = $obj_rec[
"last_update"];
888 $ilDB->setLimit(1,0);
889 $q =
"SELECT * FROM object_data WHERE import_id = ".$ilDB->quote($a_import_id,
"text").
890 " ORDER BY create_date DESC";
891 $obj_set = $ilDB->query($q);
893 if ($obj_rec = $ilDB->fetchAssoc($obj_set))
895 return $obj_rec[
"obj_id"];
912 $query =
"SELECT * FROM object_reference WHERE obj_id = ".
913 $ilDB->quote($a_id,
'integer');
917 while($obj_rec = $ilDB->fetchAssoc(
$res))
919 $ref[$obj_rec[
"ref_id"]] = $obj_rec[
"ref_id"];
932 global $ilObjDataCache;
934 $tit = $ilObjDataCache->lookupTitle($a_id);
946 global $ilObjDataCache;
948 $owner = $ilObjDataCache->lookupOwner($a_id);
957 ?
"SELECT obj_id FROM object_data WHERE title = ".$ilDB->quote(
$title,
"text")
958 :
"SELECT obj_id FROM object_data WHERE ".$ilDB->like(
"title",
"text",
'%'.
$title.
'%');
961 $query .=
" AND type = ".$ilDB->quote(
$type,
"text");
966 $object_ids = array();
969 $object_ids[] =
$row[
'obj_id'];
972 return is_array($object_ids) ? $object_ids : array();
982 global $ilObjDataCache;
984 return $ilObjDataCache->lookupDescription($a_id);
994 global $ilObjDataCache;
1002 return $ilObjDataCache->lookupLastUpdate($a_id);
1015 if (!is_array($a_objs))
1017 $a_objs = array($a_objs);
1020 $set = $ilDB->query(
"SELECT max(last_update) as last_update FROM object_data ".
1021 "WHERE ".$ilDB->in(
"obj_id", $a_objs,
false,
"integer").
" ");
1022 $rec = $ilDB->fetchAssoc($set);
1024 return ($rec[
"last_update"]);
1029 global $ilObjDataCache;
1031 return (
int) $ilObjDataCache->lookupObjId($a_id);
1041 $query =
"UPDATE object_reference SET deleted= ".$ilDB->now().
' '.
1042 "WHERE ref_id = ".$ilDB->quote($a_ref_id,
'integer');
1053 $query =
"UPDATE object_reference SET deleted = ".$ilDB->quote(null,
'timestamp').
1054 " WHERE ref_id = ".$ilDB->quote($a_ref_id,
'integer');
1065 $query =
"SELECT deleted FROM object_reference".
1066 " WHERE ref_id = ".$ilDB->quote($a_ref_id,
"integer");
1067 $set = $ilDB->query(
$query);
1068 $rec = $ilDB->fetchAssoc($set);
1070 return $rec[
"deleted"];
1085 $q =
"UPDATE object_data ".
1087 "title = ".$ilDB->quote($a_title,
"text").
",".
1088 "last_update = ".$ilDB->now().
" ".
1089 "WHERE obj_id = ".$ilDB->quote($a_obj_id,
"integer");
1091 $ilDB->manipulate($q);
1103 global $ilDB,$objDefinition;
1108 $q =
"UPDATE object_data ".
1110 "description = ".$ilDB->quote(
$desc,
"text").
",".
1111 "last_update = ".$ilDB->now().
" ".
1112 "WHERE obj_id = ".$ilDB->quote($a_obj_id,
"integer");
1114 $ilDB->manipulate($q);
1116 if($objDefinition->isRBACObject($this->getType()))
1119 $res = $ilDB->query(
"SELECT * FROM object_description WHERE obj_id = ".
1120 $ilDB->quote($a_obj_id,
'integer'));
1127 $ilDB->update(
'object_description',$values,array(
'obj_id' => array(
'integer',$this->
getId())));
1133 'obj_id' => array(
'integer',$this->
getId()));
1134 $ilDB->insert(
'object_description',$values);
1150 $q =
"UPDATE object_data ".
1152 "import_id = ".$ilDB->quote($a_import_id,
"text").
",".
1153 "last_update = ".$ilDB->now().
" ".
1154 "WHERE obj_id = ".$ilDB->quote($a_obj_id,
"integer");
1156 $ilDB->manipulate($q);
1166 global $ilObjDataCache;
1170 return $ilObjDataCache->lookupType($ilObjDataCache->lookupObjId($a_id));
1172 return $ilObjDataCache->lookupType($a_id);
1176 if ($a_reference ===
true)
1178 $q =
"SELECT type FROM object_reference obr, object_data obd ".
1179 "WHERE obr.ref_id = ".$ilDB->quote($a_id,
"integer").
" ".
1180 "AND obr.obj_id = obd.obj_id ";
1184 $q =
"SELECT type FROM object_data WHERE obj_id = ".$ilDB->quote($a_id,
"integer");
1187 $obj_set = $ilDB->query($q);
1188 $obj_rec = $ilDB->fetchAssoc($obj_set);
1190 return $obj_rec[
"type"];
1200 return $tree->isSaved($a_ref_id);
1227 global $ilObjDataCache;
1229 return (
int) $ilObjDataCache->lookupObjId($a_ref_id);
1246 $q =
"SELECT * FROM object_data WHERE type = ".$ilDB->quote($a_type,
"text");
1247 $obj_set = $ilDB->query($q);
1250 while ($obj_rec = $ilDB->fetchAssoc($obj_set))
1254 $objects[$obj_rec[
"title"].
".".$obj_rec[
"obj_id"]] = array(
"id" => $obj_rec[
"obj_id"],
1255 "type" => $obj_rec[
"type"],
"title" => $obj_rec[
"title"],
1256 "description" => $obj_rec[
"description"]);
1272 $tree->insertNode($this->
getRefId(), $a_parent_ref);
1275 $log->write(
"ilObject::putInTree(), parent_ref: $a_parent_ref, ref_id: ".
1289 global $rbacadmin, $rbacreview;
1291 $parentRoles = $rbacreview->getParentRoleIds($a_parent_ref);
1293 foreach ($parentRoles as $parRol)
1295 $ops = $rbacreview->getOperationsOfRole($parRol[
"obj_id"], $this->
getType(), $parRol[
"parent"]);
1296 $rbacadmin->grantPermission($parRol[
"obj_id"], $ops, $this->
getRefId());
1312 if (!isset($this->
id))
1314 $message =
"ilObject::createNewReference(): No obj_id given!";
1315 $this->raiseError($message,$this->ilias->error_obj->WARNING);
1318 $next_id = $ilDB->nextId(
'object_reference');
1319 $query =
"INSERT INTO object_reference ".
1320 "(ref_id, obj_id) VALUES (".$ilDB->quote($next_id,
'integer').
','.$ilDB->quote($this->
id ,
'integer').
")";
1321 $this->ilias->db->query(
$query);
1323 $this->ref_id = $next_id;
1324 $this->referenced =
true;
1340 if (!isset($this->
id))
1342 $message =
"ilObject::countReferences(): No obj_id given!";
1343 $this->ilias->raiseError($message,$this->ilias->error_obj->WARNING);
1346 $query =
"SELECT COUNT(ref_id) num FROM object_reference ".
1347 "WHERE obj_id = ".$ilDB->quote($this->
id,
'integer').
" ";
1368 global $rbacadmin,
$log, $ilDB;
1377 if ($this->type != $db_type)
1379 $message =
"ilObject::delete(): Type mismatch. Object with obj_id: ".$this->id.
" ".
1380 "was instantiated by type '".$this->type.
"'. DB type is: ".$db_type;
1383 $log->write($message);
1386 $this->ilias->raiseError(
"ilObject::delete(): Type mismatch. (".$this->type.
"/".$this->id.
")",$this->ilias->error_obj->WARNING);
1390 $q =
"DELETE FROM object_data ".
1391 "WHERE obj_id = ".$ilDB->quote($this->
getId(),
"integer");
1392 $ilDB->manipulate($q);
1395 $query =
"DELETE FROM object_description WHERE obj_id = ".
1396 $ilDB->quote($this->
getId(),
"integer");
1397 $ilDB->manipulate(
$query);
1400 $log->write(
"ilObject::delete(), deleted object, obj_id: ".$this->
getId().
", type: ".
1404 include_once(
"./Services/News/classes/class.ilNewsItem.php");
1406 $news_item->deleteNewsOfContext($this->
getId(), $this->
getType());
1407 include_once(
"./Services/Block/classes/class.ilBlockSetting.php");
1410 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateObjSettings.php';
1426 $query =
"DELETE FROM dav_property ".
1427 "WHERE obj_id = ".$ilDB->quote($this->
getId(),
'integer');
1431 include_once
'./Services/WebServices/ECS/classes/class.ilECSImport.php';
1439 $log->write(
"ilObject::delete(), object not deleted, number of references: ".
1445 if ($this->referenced)
1447 include_once
"Services/Object/classes/class.ilObjectActivation.php";
1451 $query =
"DELETE FROM object_reference ".
1452 "WHERE ref_id = ".$ilDB->quote($this->
getRefId(),
'integer');
1456 $log->write(
"ilObject::delete(), reference deleted, ref_id: ".$this->
getRefId().
1457 ", obj_id: ".$this->
getId().
", type: ".
1464 $rbacadmin->revokePermission($this->
getRefId(),0,
false);
1466 include_once
"Services/AccessControl/classes/class.ilRbacLog.php";
1470 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateObjSettings.php';
1478 if ($this->referenced)
1516 if ($rolf_data = $rbacreview->getRoleFolderofObject($this->getRefId()))
1518 $rfoldObj = $this->ilias->obj_factory->getInstanceByRefId($rolf_data[
"ref_id"]);
1522 include_once (
"./Services/AccessControl/classes/class.ilObjRoleFolder.php");
1524 $rfoldObj->setTitle($this->
getId());
1525 $rfoldObj->setDescription(
" (ref_id ".$this->
getRefId().
")");
1526 $rfoldObj->create();
1527 $rfoldObj->createReference();
1528 $rfoldObj->putInTree($this->
getRefId());
1529 $rfoldObj->setPermissions($this->
getRefId());
1546 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateObjSettings.php';
1549 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateActionFactory.php';
1552 $action->setRefId($this->
getRefId());
1571 $q =
"SELECT * FROM object_data ".
1572 "LEFT JOIN object_reference ON object_reference.obj_id=object_data.obj_id ".
1573 "WHERE object_reference.ref_id= ".$ilDB->quote($a_id,
"integer");
1577 $q =
"SELECT * FROM object_data WHERE obj_id=".$ilDB->quote($a_id,
"integer");
1580 $r = $ilDB->query($q);
1582 return $ilDB->numRows($r) ?
true :
false;
1597 function notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params = 0)
1601 $parent_id = (int) $tree->getParentId($a_node_id);
1603 if ($parent_id != 0)
1605 $obj_data =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
1606 $obj_data->notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$parent_id,$a_params);
1615 $this->
register = (bool) $a_bool;
1647 $order =
" ORDER BY title";
1652 $where_clause =
"WHERE type = ".
1653 $ilDB->quote($a_obj_type,
"text");
1657 $where_clause.=
" AND owner = ".$ilDB->quote($a_owner,
"integer");
1661 $q =
"SELECT * FROM object_data ".$where_clause.$order;
1662 $r = $ilDB->query($q);
1665 if ($ilDB->numRows($r) > 0)
1667 while (
$row = $ilDB->fetchAssoc($r))
1669 $row[
"desc"] =
$row[
"description"];
1687 global $ilDB,
$lng,$objDefinition;
1689 $query =
"SELECT obj_data.title obj_title,path_data.title path_title,child FROM tree ".
1690 "JOIN object_reference obj_ref ON child = obj_ref.ref_id ".
1691 "JOIN object_data obj_data ON obj_ref.obj_id = obj_data.obj_id ".
1692 "JOIN object_reference path_ref ON parent = path_ref.ref_id ".
1693 "JOIN object_data path_data ON path_ref.obj_id = path_data.obj_id ".
1694 "WHERE ".$ilDB->in(
"child", $a_ref_ids,
false,
"integer").
" ".
1695 "ORDER BY obj_data.title ";
1698 if (!$objDefinition->isPlugin($new_type))
1700 $options[0] = $lng->txt(
'obj_'.$new_type.
'_select');
1704 include_once(
"./Services/Component/classes/class.ilPlugin.php");
1708 while(
$row = $ilDB->fetchObject(
$res))
1717 if(strlen(
$path =
$row->path_title) > 40)
1727 return $options ? $options : array();
1739 public function cloneObject($a_target_id,$a_copy_id = 0,$a_omit_tree =
false)
1741 global $objDefinition,
$ilUser,$rbacadmin, $ilDB;
1744 $class_name = (
'ilObj'.$objDefinition->getClassName($this->
getType()));
1756 include_once(
$location.
"/class.".$class_name.
".php");
1757 $new_obj =
new $class_name(0,
false);
1758 $new_obj->setOwner($ilUser->getId());
1759 $new_obj->setTitle(
$title);
1761 $new_obj->setType($this->
getType());
1763 $new_obj->create(
true);
1767 $new_obj->createReference();
1768 $new_obj->putInTree($a_target_id);
1769 $new_obj->setPermissions($a_target_id);
1775 $rbacadmin->copyLocalRoles($this->
getRefId(),$new_obj->getRefId());
1779 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php');
1783 $query =
"INSERT INTO dav_property (obj_id,node_id,ns,name,value) ".
1784 "SELECT ".$ilDB->quote($new_obj->getId(),
'integer').
",node_id,ns,name,value ".
1785 "FROM dav_property ".
1786 "WHERE obj_id = ".$ilDB->quote($this->getId(),
'integer');
1787 $res = $ilDB->manipulate($query);
1804 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
1806 if(!$cp_options->isRootNode($this->getRefId()))
1810 $nodes = $tree->getChilds($a_target_id);
1812 $title_unique =
false;
1813 require_once
'Modules/File/classes/class.ilObjFileAccess.php';
1816 while(!$title_unique)
1819 foreach($nodes as $node)
1821 if((
$title == $node[
'title']) and ($this->
getType() == $node[
'type']))
1852 include_once
'./Services/AccessControl/classes/class.ilConditionHandler.php';
1853 include_once
'./Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
1856 $mappings = $cwo->getMappings();
1859 foreach($conditions as $con)
1861 if($mappings[$con[
'trigger_ref_id']])
1868 $newCondition->setTargetRefId($a_target_id);
1869 $newCondition->setTargetObjId($target_obj);
1870 $newCondition->setTargetType($target_typ);
1872 $trigger_ref = $mappings[$con[
'trigger_ref_id']];
1876 $newCondition->setTriggerRefId($trigger_ref);
1877 $newCondition->setTriggerObjId($trigger_obj);
1878 $newCondition->setTriggerType($trigger_typ);
1879 $newCondition->setOperator($con[
'operator']);
1880 $newCondition->setValue($con[
'value']);
1881 $newCondition->setReferenceHandlingType($con[
'ref_handling']);
1882 $newCondition->setObligatory($con[
'obligatory']);
1883 $newCondition->storeCondition();
1887 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateObjSettings.php';
1891 include_once
'./Services/Object/classes/class.ilObjectFactory.php';
1893 $obj = $factory->getInstanceByRefId($a_target_id, FALSE);
1896 $obj->applyDidacticTemplate($tpl_id);
1911 include_once
"./Services/MetaData/classes/class.ilMD.php";
1913 $md->cloneMD($target_obj->getId(),0,$target_obj->getType());
1925 public static function _getIcon($a_obj_id =
"", $a_size =
"big", $a_type =
"",
1930 if ($a_obj_id ==
"" && $a_type ==
"")
1945 if ($ilSetting->get(
"custom_icons") &&
1946 in_array($a_type, array(
"cat",
"grp",
"crs",
"root")))
1948 require_once(
"./Services/Container/classes/class.ilContainer.php");
1954 $file_name = $cont_dir.
"/icon_".$a_size.
".png";
1955 if (is_file($file_name))
1961 $file_name = $cont_dir.
"/icon_".$a_size.
".gif";
1962 if (is_file($file_name))
1971 case "small": $suff =
"";
break;
1972 case "tiny": $suff =
"_s";
break;
1973 default: $suff =
"_b";
break;
1977 if ($objDefinition->isPluginTypeName($a_type))
1979 include_once(
"./Services/Repository/classes/class.ilRepositoryObjectPlugin.php");
1986 return "./images/icon_".$a_type.$suff.
".png";
1998 global $objDefinition, $tree;
2002 $deps[
"dep"] = array();
2005 $deps[
"del_ids"][$a_obj_id] = $a_obj_id;
2007 if (!$objDefinition->isPlugin(
$type))
2009 $class_name =
"ilObj".$objDefinition->getClassName($a_type);
2010 $location = $objDefinition->getLocation($a_type);
2011 include_once(
$location.
"/class.".$class_name.
".php");
2012 $odeps = call_user_func(array($class_name,
"getDeletionDependencies"), $a_obj_id);
2013 if (is_array($odeps))
2015 foreach ($odeps as
$id => $message)
2017 $deps[
"dep"][
$id][$a_obj_id][] = $message;
2022 foreach ($tree->getChilds($a_ref_id) as $c)
2031 foreach ($deps[
"del_ids"] as $obj_id)
2033 unset($deps[
"dep"][$obj_id]);
2035 $deps = $deps[
"dep"];
2058 $res = $ilDB->query(
"SELECT * FROM object_description".
2059 " WHERE ".$ilDB->in(
"obj_id", $a_obj_ids,
"",
"integer"));
2061 while(
$row = $ilDB->fetchAssoc(
$res))
2063 $all[
$row[
"obj_id"]] = $row[
"description"];
2076 global $ilDB, $objDefinition;
2081 $types = array_keys($objDefinition->getSubObjectsRecursively(
"root"));
2083 $sql =
"SELECT od.obj_id,od.type,od.title FROM object_data od";
2087 $sql .=
" WHERE od.owner = ".$ilDB->quote($a_user_id,
"integer");
2091 $sql .=
" LEFT JOIN usr_data ud ON (ud.usr_id = od.owner)".
2092 " WHERE (od.owner < ".$ilDB->quote(1,
"integer").
2093 " OR od.owner IS NULL OR ud.login IS NULL)".
2094 " AND od.owner <> ".$ilDB->quote(-1,
"integer");
2097 $sql .=
" AND ".$ilDB->in(
"od.type", $types,
"",
"text");
2099 $res = $ilDB->query($sql);
2100 while(
$row = $ilDB->fetchAssoc(
$res))
2102 $all[
$row[
"type"]][
$row[
"obj_id"]] = $row[
"title"];
2118 $set = $ilDB->query(
"SELECT create_date FROM object_data ".
2119 " WHERE obj_id = ".$ilDB->quote($a_id,
"integer"));
2120 $rec = $ilDB->fetchAssoc($set);
2121 return $rec[
"create_date"];