133 $this->
ilias = $DIC[
"ilias"];
135 $this->db = $DIC->database();
136 $this->log = $DIC[
"ilLog"];
137 $this->error = $DIC[
"ilErr"];
138 $this->tree = $DIC->repositoryTree();
139 $this->app_event_handler = $DIC[
"ilAppEventHandler"];
143 echo
"<br/><font color=\"red\">type(" . $this->type .
") id(" . $a_id .
") referenced(" . $a_reference .
")</font>";
146 if (isset($DIC[
"lng"])) {
147 $this->lng = $DIC[
"lng"];
151 $this->max_title = self::TITLE_LENGTH;
152 $this->max_desc = self::DESC_LENGTH;
153 $this->add_dots =
true;
155 $this->referenced = $a_reference;
156 $this->call_by_reference = $a_reference;
159 $this->referenced =
false;
162 if ($this->referenced) {
163 $this->ref_id = $a_id;
201 if ($this->referenced) {
203 if (!isset($this->ref_id)) {
204 $message =
"ilObject::read(): No ref_id given! (" . $this->type .
")";
210 $q =
"SELECT * FROM object_data, object_reference WHERE object_data.obj_id=object_reference.obj_id " .
211 "AND object_reference.ref_id= " .
$ilDB->quote($this->ref_id,
"integer");
212 $object_set =
$ilDB->query($q);
215 if (
$ilDB->numRows($object_set) == 0) {
216 $message =
"ilObject::read(): Object with ref_id " . $this->ref_id .
" not found! (" . $this->type .
")";
220 $obj =
$ilDB->fetchAssoc($object_set);
223 if (!isset($this->
id)) {
224 $message =
"ilObject::read(): No obj_id given! (" . $this->type .
")";
229 $q =
"SELECT * FROM object_data " .
230 "WHERE obj_id = " .
$ilDB->quote($this->
id,
"integer");
231 $object_set =
$ilDB->query($q);
234 if (
$ilDB->numRows($object_set) == 0) {
235 include_once(
"./Services/Object/exceptions/class.ilObjectNotFoundException.php");
237 " (" . $this->type .
") not found!");
241 $obj =
$ilDB->fetchAssoc($object_set);
244 $this->
id = $obj[
"obj_id"];
247 if ($this->type != $obj[
"type"] && $obj[
"type"] !=
"xxx") {
248 $message =
"ilObject::read(): Type mismatch. Object with obj_id: " . $this->
id .
" " .
249 "was instantiated by type '" . $this->type .
"'. DB type is: " . $obj[
"type"];
255 include_once(
"./Services/Object/exceptions/class.ilObjectTypeMismatchException.php");
260 $this->type = $obj[
"type"];
261 $this->title = $obj[
"title"];
263 $this->untranslatedTitle = $obj[
"title"];
265 $this->desc = $obj[
"description"];
266 $this->owner = $obj[
"owner"];
267 $this->create_date = $obj[
"create_date"];
268 $this->last_update = $obj[
"last_update"];
269 $this->import_id = $obj[
"import_id"];
273 $query =
"SELECT * FROM object_description WHERE obj_id = " .
$ilDB->quote($this->
id,
'integer');
276 if (strlen(
$row->description)) {
283 $translation_type =
$objDefinition->getTranslationType($this->type);
285 if ($translation_type ==
"sys") {
286 $this->title = $this->lng->txt(
"obj_" . $this->type);
287 $this->
setDescription($this->lng->txt(
"obj_" . $this->type .
"_desc"));
288 } elseif ($translation_type ==
"db") {
289 $q =
"SELECT title,description FROM object_translation " .
290 "WHERE obj_id = " .
$ilDB->quote($this->
id,
'integer') .
" " .
291 "AND lang_code = " .
$ilDB->quote(
$ilUser->getCurrentLanguage(),
'text') .
" " .
292 "AND NOT lang_default = 1";
296 $this->title =
$row->title;
298 #$this->desc = $row->description; 330 $this->ref_id = $a_id;
331 $this->referenced =
true;
436 $this->long_desc = $a_desc;
449 return strlen($this->long_desc) ? $this->long_desc :
$this->desc;
471 $this->import_id = $a_import_id;
478 $ilDB = $DIC->database();
480 $query =
"SELECT * FROM object_data " .
481 "WHERE import_id = " .
$ilDB->quote($a_import_id,
"text") .
" " .
482 "ORDER BY create_date DESC";
494 $ilDB = $DIC->database();
496 $query =
"SELECT import_id FROM object_data " .
497 "WHERE obj_id = " .
$ilDB->quote($a_obj_id,
"integer");
500 return $row->import_id;
532 $lng = $DIC->language();
534 if ($a_owner_id != -1) {
541 $own_name =
$owner->getFullname();
543 $own_name =
$lng->txt(
"unknown");
557 $this->owner = $a_owner;
617 if (!isset($this->type)) {
618 $message = get_class($this) .
"::create(): No object type given!";
623 $ilLog->write(
"ilObject::create(), start");
631 } elseif (is_object(
$ilUser)) {
636 $this->
id =
$ilDB->nextId(
"object_data");
637 $q =
"INSERT INTO object_data " .
638 "(obj_id,type,title,description,owner,create_date,last_update,import_id) " .
641 $ilDB->quote($this->
id,
"integer") .
"," .
642 $ilDB->quote($this->type,
"text") .
"," .
650 $ilDB->manipulate($q);
656 'obj_id' =>
array(
'integer',$this->
id),
658 $ilDB->insert(
'object_description', $values);
661 if (
$GLOBALS[
'DIC'][
'objDefinition']->isOrgUnitPermissionType($this->type)) {
668 $q =
"SELECT last_update, create_date FROM object_data" .
669 " WHERE obj_id = " .
$ilDB->quote($this->
id,
"integer");
670 $obj_set =
$ilDB->query($q);
671 $obj_rec =
$ilDB->fetchAssoc($obj_set);
672 $this->last_update = $obj_rec[
"last_update"];
673 $this->create_date = $obj_rec[
"create_date"];
679 $ilLog->write(
"ilObject::create(), finished, obj_id: " . $this->
id .
", type: " .
680 $this->type .
", title: " . $this->
getTitle());
682 $GLOBALS[
'ilAppEventHandler']->raise(
685 array(
'obj_id' => $this->
id,
'obj_type' => $this->type)
702 $q =
"UPDATE object_data " .
707 "last_update = " .
$ilDB->now() .
" " .
708 "WHERE obj_id = " .
$ilDB->quote($this->
getId(),
"integer");
709 $ilDB->manipulate($q);
714 $q =
"SELECT last_update FROM object_data" .
715 " WHERE obj_id = " .
$ilDB->quote($this->
getId(),
"integer");
716 $obj_set =
$ilDB->query($q);
717 $obj_rec =
$ilDB->fetchAssoc($obj_set);
718 $this->last_update = $obj_rec[
"last_update"];
722 $res =
$ilDB->query(
"SELECT * FROM object_description WHERE obj_id = " .
723 $ilDB->quote($this->getId(),
'integer'));
724 if (
$res->numRows()) {
728 $ilDB->update(
'object_description', $values,
array(
'obj_id' =>
array(
'integer',$this->
getId())));
733 $ilDB->insert(
'object_description', $values);
736 $GLOBALS[
'ilAppEventHandler']->raise(
740 'obj_type' => $this->
getType(),
760 include_once
'Services/MetaData/classes/class.ilMD.php';
762 $GLOBALS[
'ilAppEventHandler']->raise(
766 'obj_type' => $this->
getType(),
770 switch ($a_element) {
775 if (!is_object($md_gen = $md->getGeneral())) {
778 $this->
setTitle($md_gen->getTitle());
780 foreach ($md_gen->getDescriptionIds() as
$id) {
781 $md_des = $md_gen->getDescription(
$id);
801 include_once
'Services/MetaData/classes/class.ilMDCreator.php';
806 $md_creator->setTitle($this->
getTitle());
807 $md_creator->setTitleLanguage(
$ilUser->getPref(
'language'));
809 $md_creator->setDescriptionLanguage(
$ilUser->getPref(
'language'));
810 $md_creator->setKeywordLanguage(
$ilUser->getPref(
'language'));
811 $md_creator->setLanguage(
$ilUser->getPref(
'language'));
812 $md_creator->create();
823 $md_gen = $md->getGeneral();
828 $md_gen = $md->getGeneral();
831 $md_gen->setTitle($this->
getTitle());
834 $md_des_ids = $md_gen->getDescriptionIds();
835 if (count($md_des_ids) > 0) {
836 $md_des = $md_gen->getDescription($md_des_ids[0]);
849 include_once(
'Services/MetaData/classes/class.ilMD.php');
864 $q =
"UPDATE object_data " .
866 "owner = " .
$ilDB->quote($this->
getOwner(),
"integer") .
", " .
867 "last_update = " .
$ilDB->now() .
" " .
868 "WHERE obj_id = " .
$ilDB->quote($this->
getId(),
"integer");
869 $ilDB->manipulate($q);
871 $q =
"SELECT last_update FROM object_data" .
872 " WHERE obj_id = " .
$ilDB->quote($this->
getId(),
"integer");
873 $obj_set =
$ilDB->query($q);
874 $obj_rec =
$ilDB->fetchAssoc($obj_set);
875 $this->last_update = $obj_rec[
"last_update"];
891 $ilDB = $DIC->database();
893 $ilDB->setLimit(1, 0);
894 $q =
"SELECT * FROM object_data WHERE import_id = " .
$ilDB->quote($a_import_id,
"text") .
895 " ORDER BY create_date DESC";
896 $obj_set =
$ilDB->query($q);
898 if ($obj_rec =
$ilDB->fetchAssoc($obj_set)) {
899 return $obj_rec[
"obj_id"];
914 $ilDB = $DIC->database();
916 $query =
"SELECT * FROM object_reference WHERE obj_id = " .
917 $ilDB->quote($a_id,
'integer');
921 while ($obj_rec =
$ilDB->fetchAssoc(
$res)) {
922 $ref[$obj_rec[
"ref_id"]] = $obj_rec[
"ref_id"];
937 $ilObjDataCache = $DIC[
"ilObjDataCache"];
939 $tit = $ilObjDataCache->lookupTitle($a_id);
953 $ilObjDataCache = $DIC[
"ilObjDataCache"];
955 $owner = $ilObjDataCache->lookupOwner($a_id);
963 $ilDB = $DIC->database();
966 ?
"SELECT obj_id FROM object_data WHERE title = " .
$ilDB->quote(
$title,
"text")
967 :
"SELECT obj_id FROM object_data WHERE " .
$ilDB->like(
"title",
"text",
'%' .
$title .
'%');
974 $object_ids =
array();
976 $object_ids[] =
$row[
'obj_id'];
979 return is_array($object_ids) ? $object_ids :
array();
991 $ilObjDataCache = $DIC[
"ilObjDataCache"];
993 return $ilObjDataCache->lookupDescription($a_id);
1005 $ilObjDataCache = $DIC[
"ilObjDataCache"];
1010 return $ilObjDataCache->lookupLastUpdate($a_id);
1023 $ilDB = $DIC->database();
1025 if (!is_array($a_objs)) {
1026 $a_objs =
array($a_objs);
1029 $set =
$ilDB->query(
"SELECT max(last_update) as last_update FROM object_data " .
1030 "WHERE " .
$ilDB->in(
"obj_id", $a_objs,
false,
"integer") .
" ");
1031 $rec =
$ilDB->fetchAssoc($set);
1033 return ($rec[
"last_update"]);
1040 $ilObjDataCache = $DIC[
"ilObjDataCache"];
1042 return (
int) $ilObjDataCache->lookupObjId($a_id);
1052 $ilDB = $DIC->database();
1054 $query =
"UPDATE object_reference SET deleted= " .
$ilDB->now() .
' ' .
1055 "WHERE ref_id = " .
$ilDB->quote($a_ref_id,
'integer');
1069 $ilDB = $DIC->database();
1071 $query =
'UPDATE object_reference SET deleted = ' .
$ilDB->now() .
' ' .
1072 'WHERE ' .
$ilDB->in(
'ref_id', (
array) $a_ref_ids,
false,
'integer');
1075 $ilDB->manipulate($query);
1086 $ilDB = $DIC->database();
1088 $query =
"UPDATE object_reference SET deleted = " .
$ilDB->quote(null,
'timestamp') .
1089 " WHERE ref_id = " .
$ilDB->quote($a_ref_id,
'integer');
1100 $ilDB = $DIC->database();
1102 $query =
"SELECT deleted FROM object_reference" .
1103 " WHERE ref_id = " .
$ilDB->quote($a_ref_id,
"integer");
1105 $rec =
$ilDB->fetchAssoc($set);
1107 return $rec[
"deleted"];
1122 $ilDB = $DIC->database();
1124 $q =
"UPDATE object_data " .
1126 "title = " .
$ilDB->quote($a_title,
"text") .
"," .
1127 "last_update = " .
$ilDB->now() .
" " .
1128 "WHERE obj_id = " .
$ilDB->quote($a_obj_id,
"integer");
1130 $ilDB->manipulate($q);
1144 $ilDB = $DIC->database();
1150 $q =
"UPDATE object_data " .
1152 "description = " .
$ilDB->quote(
$desc,
"text") .
"," .
1153 "last_update = " .
$ilDB->now() .
" " .
1154 "WHERE obj_id = " .
$ilDB->quote($a_obj_id,
"integer");
1156 $ilDB->manipulate($q);
1160 $res =
$ilDB->query(
"SELECT * FROM object_description WHERE obj_id = " .
1161 $ilDB->quote($a_obj_id,
'integer'));
1163 if (
$res->numRows()) {
1165 'description' =>
array(
'clob',$a_desc)
1167 $ilDB->update(
'object_description', $values,
array(
'obj_id' =>
array(
'integer',$a_obj_id)));
1170 'description' =>
array(
'clob',$a_desc),
1171 'obj_id' =>
array(
'integer',$a_obj_id));
1172 $ilDB->insert(
'object_description', $values);
1188 $ilDB = $DIC->database();
1190 $q =
"UPDATE object_data " .
1192 "import_id = " .
$ilDB->quote($a_import_id,
"text") .
"," .
1193 "last_update = " .
$ilDB->now() .
" " .
1194 "WHERE obj_id = " .
$ilDB->quote($a_obj_id,
"integer");
1196 $ilDB->manipulate($q);
1208 $ilObjDataCache = $DIC[
"ilObjDataCache"];
1211 return $ilObjDataCache->lookupType($ilObjDataCache->lookupObjId($a_id));
1213 return $ilObjDataCache->lookupType($a_id);
1223 $tree = $DIC->repositoryTree();
1225 return $tree->isSaved($a_ref_id);
1234 foreach ($ref_ids as
$ref_id) {
1252 $ilObjDataCache = $DIC[
"ilObjDataCache"];
1254 return (
int) $ilObjDataCache->lookupObjId($a_ref_id);
1271 $ilDB = $DIC->database();
1273 $q =
"SELECT * FROM object_data WHERE type = " .
$ilDB->quote(
$a_type,
"text");
1274 $obj_set =
$ilDB->query($q);
1277 while ($obj_rec =
$ilDB->fetchAssoc($obj_set)) {
1279 $objects[$obj_rec[
"title"] .
"." . $obj_rec[
"obj_id"]] =
array(
"id" => $obj_rec[
"obj_id"],
1280 "type" => $obj_rec[
"type"],
"title" => $obj_rec[
"title"],
1281 "description" => $obj_rec[
"description"]);
1305 $ilLog->write(
"ilObject::putInTree(), parent_ref: $a_parent_ref, ref_id: " .
1306 $this->
getRefId() .
", obj_id: " . $this->
getId() .
", type: " .
1309 $ilAppEventHandler->raise(
1314 'obj_type' => $this->
getType(),
1315 'obj_id' => $this->
getId(),
1316 'parent_ref_id' => $a_parent_ref,
1344 $parent_roles =
$rbacreview->getParentRoleIds($a_parent_ref);
1345 foreach ((
array) $parent_roles as $parent_role) {
1347 $parent_role[
'obj_id'],
1349 $parent_role[
'parent']
1352 $parent_role[
'obj_id'],
1371 if (!isset($this->
id)) {
1372 $message =
"ilObject::createNewReference(): No obj_id given!";
1376 $next_id =
$ilDB->nextId(
'object_reference');
1377 $query =
"INSERT INTO object_reference " .
1378 "(ref_id, obj_id) VALUES (" .
$ilDB->quote($next_id,
'integer') .
',' .
$ilDB->quote($this->
id,
'integer') .
")";
1381 $this->ref_id = $next_id;
1382 $this->referenced =
true;
1399 if (!isset($this->
id)) {
1400 $message =
"ilObject::countReferences(): No obj_id given!";
1404 $query =
"SELECT COUNT(ref_id) num FROM object_reference " .
1405 "WHERE obj_id = " .
$ilDB->quote($this->
id,
'integer') .
" ";
1423 public function delete()
1442 if ($this->type != $db_type) {
1443 $message =
"ilObject::delete(): Type mismatch. Object with obj_id: " . $this->
id .
" " .
1444 "was instantiated by type '" . $this->type .
"'. DB type is: " . $db_type;
1450 $ilErr->raiseError(
"ilObject::delete(): Type mismatch. (" . $this->type .
"/" . $this->
id .
")",
$ilErr->WARNING);
1453 $ilAppEventHandler->raise(
'Services/Object',
'beforeDeletion',
array(
'object' => $this ));
1456 $q =
"DELETE FROM object_data " .
1457 "WHERE obj_id = " .
$ilDB->quote($this->
getId(),
"integer");
1458 $ilDB->manipulate($q);
1461 $query =
"DELETE FROM object_description WHERE obj_id = " .
1466 $ilLog->write(
"ilObject::delete(), deleted object, obj_id: " . $this->
getId() .
", type: " .
1470 include_once
"Services/Object/classes/class.ilObjectDataDeletionLog.php";
1474 include_once(
"./Services/News/classes/class.ilNewsItem.php");
1476 $news_item->deleteNewsOfContext($this->
getId(), $this->
getType());
1477 include_once(
"./Services/Block/classes/class.ilBlockSetting.php");
1480 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateObjSettings.php';
1496 $query =
"DELETE FROM dav_property " .
1497 "WHERE obj_id = " .
$ilDB->quote($this->
getId(),
'integer');
1501 include_once
'./Services/WebServices/ECS/classes/class.ilECSImport.php';
1504 include_once(
"Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php");
1507 include_once(
"Services/Tracking/classes/class.ilLPObjSettings.php");
1513 $ilLog->write(
"ilObject::delete(), object not deleted, number of references: " .
1519 if ($this->referenced) {
1520 include_once
"Services/Object/classes/class.ilObjectActivation.php";
1524 $query =
"DELETE FROM object_reference " .
1525 "WHERE ref_id = " .
$ilDB->quote($this->
getRefId(),
'integer');
1529 $ilLog->write(
"ilObject::delete(), reference deleted, ref_id: " . $this->
getRefId() .
1530 ", obj_id: " . $this->
getId() .
", type: " .
1539 include_once
"Services/AccessControl/classes/class.ilRbacLog.php";
1543 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateObjSettings.php';
1551 if ($this->referenced) {
1581 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateActionFactory.php';
1583 $action->setRefId($this->
getRefId());
1588 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateObjSettings.php';
1590 return $a_tpl_id ? true :
false;
1606 $ilDB = $DIC->database();
1609 $q =
"SELECT * FROM object_data " .
1610 "LEFT JOIN object_reference ON object_reference.obj_id=object_data.obj_id " .
1611 "WHERE object_reference.ref_id= " .
$ilDB->quote($a_id,
"integer");
1613 $q =
"SELECT * FROM object_data WHERE obj_id=" .
$ilDB->quote($a_id,
"integer");
1617 $q .=
" AND object_data.type = " .
$ilDB->quote(
$a_type,
"text");
1622 return $ilDB->numRows(
$r) ? true :
false;
1628 $this->
register = (bool) $a_bool;
1660 $ilDB = $DIC->database();
1662 $order =
" ORDER BY title";
1666 $where_clause =
"WHERE type = " .
1667 $ilDB->quote($a_obj_type,
"text");
1669 if ($a_owner !=
"") {
1670 $where_clause.=
" AND owner = " .
$ilDB->quote($a_owner,
"integer");
1674 $q =
"SELECT * FROM object_data " . $where_clause . $order;
1680 $row[
"desc"] =
$row[
"description"];
1707 $ilDB = $DIC->database();
1708 $lng = $DIC->language();
1711 $query =
"SELECT obj_data.title obj_title,path_data.title path_title,child FROM tree " .
1712 "JOIN object_reference obj_ref ON child = obj_ref.ref_id " .
1713 "JOIN object_data obj_data ON obj_ref.obj_id = obj_data.obj_id " .
1714 "JOIN object_reference path_ref ON parent = path_ref.ref_id " .
1715 "JOIN object_data path_data ON path_ref.obj_id = path_data.obj_id " .
1716 "WHERE " .
$ilDB->in(
"child", $a_ref_ids,
false,
"integer") .
" " .
1717 "ORDER BY obj_data.title ";
1721 $options[0] =
$lng->txt(
'obj_' . $new_type .
'_select');
1723 require_once(
"Services/Repository/classes/class.ilObjectPlugin.php");
1733 if (strlen(
$path =
$row->path_title) > 40) {
1754 public function cloneObject($a_target_id, $a_copy_id = 0, $a_omit_tree =
false)
1770 include_once
'./Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
1773 if (!
$options->isTreeCopyDisabled() && !$a_omit_tree) {
1780 include_once(
$location .
"/class." . $class_name .
".php");
1781 $new_obj =
new $class_name(0,
false);
1782 $new_obj->setOwner(
$ilUser->getId());
1783 $new_obj->setTitle(
$title);
1785 $new_obj->setType($this->
getType());
1787 $new_obj->create(
true);
1789 if (!
$options->isTreeCopyDisabled() && !$a_omit_tree) {
1791 $new_obj->createReference();
1792 $new_obj->putInTree($a_target_id);
1793 $new_obj->setPermissions($a_target_id);
1804 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php');
1808 $query =
"INSERT INTO dav_property (obj_id,node_id,ns,name,value) " .
1809 "SELECT " .
$ilDB->quote($new_obj->getId(),
'integer') .
",node_id,ns,name,value " .
1810 "FROM dav_property " .
1811 "WHERE obj_id = " .
$ilDB->quote($this->getId(),
'integer');
1815 $ilAppEventHandler->raise(
'Services/Object',
'cloneObject',
array(
1816 'object' => $new_obj,
1817 'cloned_from_object' => $this,
1834 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
1836 if (!$cp_options->isRootNode($this->getRefId())) {
1839 $nodes =
$tree->getChilds($a_target_id);
1841 $title_unique =
false;
1842 require_once
'Modules/File/classes/class.ilObjFileAccess.php';
1844 $handleExtension = ($this->
getType() ==
"file");
1846 while (!$title_unique) {
1848 foreach ($nodes as $node) {
1849 if ((
$title == $node[
'title']) and ($this->
getType() == $node[
'type'])) {
1876 include_once
'./Services/AccessControl/classes/class.ilConditionHandler.php' ;
1879 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateObjSettings.php';
1882 include_once
'./Services/Object/classes/class.ilObjectFactory.php';
1884 $obj =
$factory->getInstanceByRefId($a_target_id,
false);
1886 $obj->applyDidacticTemplate($tpl_id);
1902 $md->cloneMD($target_obj->getId(), 0, $target_obj->getType());
1925 if ($a_obj_id ==
"" &&
$a_type ==
"") {
1933 if ($a_size ==
"") {
1938 in_array(
$a_type,
array(
"cat",
"grp",
"crs",
"root",
"fold",
"prg"))) {
1939 require_once(
"./Services/Container/classes/class.ilContainer.php");
1943 $file_name = $cont_dir .
"/icon_custom.svg";
1944 if (is_file($file_name)) {
1946 return $file_name .
"?tmp=" . filemtime($file_name);
1956 if (is_file(
$location .
"/class." . $class_name .
".php")) {
1957 include_once(
$location .
"/class." . $class_name .
".php");
1958 return call_user_func(
array($class_name,
"_getIcon"),
$a_type, $a_size, $a_obj_id);
1966 return "./images/icon_" .
$a_type .
".svg";
1981 $tree = $DIC->repositoryTree();
1983 if ($a_depth == 0) {
1984 $deps[
"dep"] =
array();
1987 $deps[
"del_ids"][$a_obj_id] = $a_obj_id;
1992 include_once(
$location .
"/class." . $class_name .
".php");
1993 $odeps = call_user_func(
array($class_name,
"getDeletionDependencies"), $a_obj_id);
1994 if (is_array($odeps)) {
2001 foreach (
$tree->getChilds($a_ref_id) as $c) {
2007 if ($a_depth == 0) {
2008 foreach ($deps[
"del_ids"] as $obj_id) {
2009 unset($deps[
"dep"][$obj_id]);
2011 $deps = $deps[
"dep"];
2034 $ilDB = $DIC->database();
2036 $res =
$ilDB->query(
"SELECT * FROM object_description" .
2037 " WHERE " .
$ilDB->in(
"obj_id", $a_obj_ids,
"",
"integer"));
2040 $all[
$row[
"obj_id"]] = $row[
"description"];
2055 $ilDB = $DIC->database();
2061 $types = array_keys(
$objDefinition->getSubObjectsRecursively(
"root"));
2063 $sql =
"SELECT od.obj_id,od.type,od.title FROM object_data od" .
2064 " JOIN object_reference oref ON(oref.obj_id = od.obj_id)" .
2065 " JOIN tree ON (tree.child = oref.ref_id)";
2068 $sql .=
" WHERE od.owner = " .
$ilDB->quote($a_user_id,
"integer");
2070 $sql .=
" LEFT JOIN usr_data ud ON (ud.usr_id = od.owner)" .
2071 " WHERE (od.owner < " .
$ilDB->quote(1,
"integer") .
2072 " OR od.owner IS NULL OR ud.login IS NULL)" .
2073 " AND od.owner <> " .
$ilDB->quote(-1,
"integer");
2076 $sql .=
" AND " .
$ilDB->in(
"od.type", $types,
"",
"text") .
2077 " AND tree.tree > " .
$ilDB->quote(0,
"integer");
2081 $all[
$row[
"type"]][
$row[
"obj_id"]] = $row[
"title"];
2097 $ilDB = $DIC->database();
2099 if (!in_array(
$a_type,
array(
"catr",
"crsr",
"sess",
"grpr"))) {
2104 $missing_obj_ids =
array();
2105 foreach ($a_obj_title_map as $obj_id =>
$title) {
2107 $missing_obj_ids[] = $obj_id;
2111 if (!
sizeof($missing_obj_ids)) {
2119 $set =
$ilDB->query(
"SELECT oref.obj_id, od.type, od.title FROM object_data od" .
2120 " JOIN container_reference oref ON (od.obj_id = oref.target_obj_id)" .
2121 " AND " .
$ilDB->in(
"oref.obj_id", $missing_obj_ids,
"",
"integer"));
2122 while (
$row =
$ilDB->fetchAssoc($set)) {
2123 $a_obj_title_map[
$row[
"obj_id"]] = $row[
"title"];
2128 include_once
"Modules/Session/classes/class.ilObjSession.php";
2129 foreach ($missing_obj_ids as $obj_id) {
2131 $a_obj_title_map[$obj_id] =
$sess->getFirstAppointment()->appointmentToString();
2147 $ilDB = $DIC->database();
2149 $set =
$ilDB->query(
"SELECT create_date FROM object_data " .
2150 " WHERE obj_id = " .
$ilDB->quote($a_id,
"integer"));
2151 $rec =
$ilDB->fetchAssoc($set);
2152 return $rec[
"create_date"];
2166 $tree = $DIC->repositoryTree();
2174 $parent_ref_id =
$tree->checkForParentType($a_ref_id,
"grp");
2175 if (!$parent_ref_id) {
2176 $parent_ref_id =
$tree->checkForParentType($a_ref_id,
"crs");
2178 if ($parent_ref_id) {
2179 include_once
'./Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
2203 return $this->objDefinition->getSubObjects($this->type, $a_filter);
static lookupTemplateId($a_ref_id)
Lookup template id ilDB $ilDB.
static _getIcon( $a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
static setDeletedDates($a_ref_ids)
Set deleted date type $ilDB.
static getDeletionDependencies($a_obj_id)
Get deletion dependencies.
static _resetDeletedDate($a_ref_id)
only called in ilObjectGUI::insertSavedNodes
static _lookupDeletedDate($a_ref_id)
only called in ilObjectGUI::insertSavedNodes
static removeItemFromDesktops($a_id)
removes object from all user's desktops public
static _getContainerDirectory($a_id)
Get the container directory.
static _hasUntrashedReference($a_obj_id)
checks wether an object has at least one reference that is not in trash
static shortenText( $a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
static lookupTxtById($plugin_id, $lang_var)
__construct($a_id=0, $a_reference=true)
Constructor public.
static _prepareCloneSelection($a_ref_ids, $new_type, $show_path=true)
Prepare copy wizard object selection.
static getLongDescriptions(array $a_obj_ids)
Get long description data.
cloneDependencies($a_target_id, $a_copy_id)
Clone object dependencies.
static _appendNumberOfCopyToFilename($a_file_name, $nth_copy=null, $a_handle_extension=false)
Appends the text " - Copy" to a filename in the language of the current user.
static getAllOwnedRepositoryObjects($a_user_id)
Get all ids of objects user owns.
const TITLE_LENGTH
max length of object title
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
static deleteByRefId($a_ref_id)
Delete by ref_id ilDB $ilDB.
read()
read object data from db into object
updateMetaData()
update meta data entry
withReferences()
determines wehter objects are referenced or not (got ref ids or not)
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
setId($a_id)
set object id public
createMetaData()
create meta data entry
static _isInTrash($a_ref_id)
checks wether object is in trash
static _writeTitle($a_obj_id, $a_title)
write title to db (static)
getDiskUsage()
Gets the disk usage of the object in bytes.
static _lookupTitle($a_id)
lookup object title
static _getObjectsByType($a_obj_type="", $a_owner="")
Get objects by type.
getPossibleSubObjects($a_filter=true)
get all possible subobjects of this type the object can decide which types of subobjects are possible...
getCreateDate()
get create date public
getOwner()
get object owner
Object not found exception.
static _deleteByObjId($a_obj_id)
Delete by obj_id.
static _setDeletedDate($a_ref_id)
only called in ilTree::saveSubTree
static _getAllReferences($a_id)
get all reference ids of object
static _deleteByObjId($a_obj_id)
Delete by objekt id.
setTitle($a_title)
set object title
static _lookupLastUpdate($a_id, $a_as_string=false)
lookup last update
static collectDeletionDependencies(&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
Collect deletion dependencies.
static _lookupObjectId($a_ref_id)
lookup object id
static getInstance()
Get instance.
static hasAutoRating($a_type, $a_ref_id)
Check if auto rating is active for parent group/course.
createReference()
creates reference for object
static assignTemplate($a_ref_id, $a_obj_id, $a_tpl_id)
Assign template to object ilDB $ilDB.
applyDidacticTemplate($a_tpl_id)
Apply template.
catch(Exception $e) $message
static _getInstance($a_copy_id)
Get instance of copy wizard options.
setOwner($a_owner)
set object owner
foreach($_POST as $key=> $value) $res
getId()
get object id public
static _cloneValues($a_source_id, $a_target_id, $a_sub_type=null, $a_source_sub_id=null, $a_target_sub_id=null)
Clone Advanced Meta Data.
isUserRegistered($a_user_id=0)
static _lookupCreationDate($a_id)
Lookup creation date.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static _lookupDescription($a_id)
lookup object description
static _lookupObjId($a_id)
static add(ilObject $a_object)
setRefId($a_id)
set reference id public
getTitle()
get object title public
static _deleteSettingsOfBlock($a_block_id, $a_block_type)
Delete block settings of block.
updateOwner()
update owner of object in db
getDescription()
get object description
getImportId()
get import id
redirection script todo: (a better solution should control the processing via a xml file) ...
cloneMetaData($target_obj)
Copy meta data.
static _lookupOwner($a_id)
lookup object owner
initDefaultRoles()
init default roles settings Purpose of this function is to create a local role folder and local roles...
static _lookupImportId($a_obj_id)
putInTree($a_parent_ref)
maybe this method should be in tree object!?
getType()
get object type public
appendCopyInfo($a_target_id, $a_copy_id)
Prepend Copy info if object with same name exists in that container.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
static deleteAllEntries($a_ref_id)
Delete all db entries for ref id.
const AUTO_RATING_NEW_OBJECTS
setImportId($a_import_id)
set import id
Handles conditions for accesses to different ILIAS objects.
static _writeDescription($a_obj_id, $a_desc)
write description to db (static)
static _getLastUpdateOfObjects($a_objs)
Get last update for a set of media objects.
static fixMissingTitles($a_type, array &$a_obj_title_map)
Try to fix missing object titles.
static _writeImportId($a_obj_id, $a_import_id)
write import id to db (static)
getLongDescription()
get object long description (stored in object_description)
getRefId()
get reference id public
static _getIdsForTitle($title, $type='', $partialmatch=false)
countReferences()
count references of object
deleteMetaData()
delete meta data entry
static deleteByObjId($a_obj_id)
Delete by obj id ilDB $ilDB.
setDescription($a_desc)
set object description
static getLogger($a_component_id)
Get component logger.
static cloneDependencies($a_src_ref_id, $a_target_ref_id, $a_copy_id)
update()
update object in db
getLastUpdateDate()
get last update date public
static _deleteByObjId($a_obj_id)
getUntranslatedTitle()
get untranslated object title public
setType($a_type)
set object type public
static _lookupOwnerName($a_owner_id)
lookup owner name for owner id
setPermissions($a_parent_ref)
set permissions of object
static _getObjectsDataForType($a_type, $a_omit_trash=false)
get all objects of a certain type
setParentRolePermissions($a_parent_ref)
Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g courses, groups for building permission intersections with non_member templates.
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
static _lookupObjIdByImportId($a_import_id)
getPresentationTitle()
get presentation title Normally same as title Overwritten for sessions
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
static getActionsByTemplateId($a_tpl_id)
Get actions of one template.
static _getIdForImportId($a_import_id)
get current object id for import id (static)
MDUpdateListener($a_element)
Meta data update listener.