84 return ($this->obj == null) ? null : $this->obj->getId();
106 $this->obj->setPermissions($this->
getRefId());
120 if (is_null($this->obj))
122 $this->obj =& $ilias->obj_factory->getInstanceByRefId($this->
getRefId());
132 $this->
writelog(
'write() refid='.$this->refId);
133 $this->obj->update();
144 return $this->obj->getUntranslatedTitle();
153 $this->
writelog(
'setResourceName('.$name.
')');
154 return $this->obj->setTitle($name);
163 return $this->obj->getTitle();
173 return strtotime($this->obj->getCreateDate());
183 return strtotime($this->obj->getLastUpdateDate());
229 return 'application/x-non-readable';
316 $ops = explode(
',',$operations);
317 if (in_array(
'visible',$ops) && ! in_array(
'write',$ops))
320 $operations .=
',write';
325 return $rbacsystem->checkAccess($operations, $this->
getRefId(), $type);
333 return $this->obj->getType();
369 require_once
'Modules/Folder/classes/class.ilObjFolder.php';
372 $newObj->setTitle($name);
375 $newObj->createReference();
376 $newObj->setPermissions($this->
getRefId());
377 $newObj->putInTree($this->
getRefId());
379 require_once
'class.ilObjFolderDAV.php';
393 require_once
'Modules/File/classes/class.ilObjFile.php';
396 $newObj->setTitle($name);
397 $newObj->setFileName($name);
398 include_once(
"./Services/Utilities/classes/class.ilMimeTypeUtil.php");
401 $newObj->setFileType($mime);
404 $newObj->createReference();
405 $newObj->setPermissions($this->
getRefId());
406 $newObj->putInTree($this->
getRefId());
409 require_once
'class.ilObjFileDAV.php';
410 $objDAV =&
new ilObjFileDAV($newObj->getRefId(), $newObj);
429 require_once
'Modules/File/classes/class.ilObjFile.php';
431 $objDAV->initFromNull();
446 require_once
'classes/class.ilObject.php';
448 $newObj->setType(
'null');
449 $newObj->setTitle($name);
451 $newObj->createReference();
452 $newObj->setPermissions($this->
getRefId());
453 $newObj->putInTree($this->
getRefId());
455 require_once
'class.ilObjNullDAV.php';
456 $objDAV =&
new ilObjNullDAV($newObj->getRefId(), $newObj);
468 function remove($objDAV)
470 global $tree, $rbacadmin;
472 $subnodes = $tree->getSubTree($tree->getNodeData($objDAV->getRefId()));
473 foreach ($subnodes as $node)
475 $rbacadmin->revokePermission($node[
"child"]);
478 $tree->saveSubTree($objDAV->getRefId());
479 $tree->deleteTree($tree->getNodeData($objDAV->getRefId()));
491 $this->
writelog(
"addCopy($objDAV,$newName) ....");
492 global $rbacadmin, $tree;
493 $revIdMapping = array();
494 $newRef = $this->
cloneNodes($objDAV->getRefId(),$this->
getRefId(),$revIdMapping, $newName);
496 return $this->
createObject($newRef, $objDAV->getILIASType());
497 $this->
writelog(
'... addCopy done.');
510 function cloneNodes($srcRef,$dstRef,&$mapping, $newName=null)
512 $this->
writelog(
"cloneNodes($srcRef,$dstRef,$mapping,$newName)");
517 $srcObj =& $ilias->obj_factory->getInstanceByRefId($srcRef);
518 $this->
writelog(
'cloneNodes cloning srcRef='.$srcRef.
' dstRef='.$dstRef.
'...');
519 $newObj = $srcObj->cloneObject($dstRef);
520 $newRef = $newObj->getRefId();
525 $this->
writelog(
"cloneNodes newname not null? ".(! is_null($newName)));
526 if (! is_null($newName))
528 $newObjDAV = $this->
createObject($newRef, $srcObj->getType());
529 $newObjDAV->setResourceName($newName);
533 $mapping[$newRef] = $srcRef;
536 $children = $tree->getChilds($srcRef);
537 foreach ($tree->getChilds($srcRef) as $child)
541 if ($child[
"type"] !=
'rolf')
543 $this->
cloneNodes($child[
"ref_id"],$newRef,$mapping,null);
547 if (count($rolf = $tree->getChildsByType($newRef,
"rolf")))
549 $mapping[$rolf[0][
"ref_id"]] = $child[
"ref_id"];
553 $this->
writelog(
'cloneNodes ...cloned srcRef='.$srcRef.
' dstRef='.$dstRef.
' newRef='.$newRef);
571 $this->
writelog(
'addMove('.$objDAV->getRefId().
' to '.$this->
getRefId().
', newName='.$newName.
')');
574 if (! is_null($newName))
576 $objDAV->setResourceName($newName);
581 $old_parent = $tree->getParentId($objDAV->getRefId());
584 $tree->moveTree($objDAV->getRefId(),$this->
getRefId());
587 $rbacadmin->adjustMovedObjectPermissions($objDAV->getRefId(), $old_parent);
649 global
$log, $ilias, $tree;
651 $q =
"SELECT tree FROM tree WHERE parent='".$a_node_id.
"' AND tree < 0";
653 $r = $ilias->db->query($q);
658 if (!in_array($row->tree,$a_checked))
660 $deleted_tree =
new ilTree($row->tree);
661 $a_checked[] = $row->tree;
663 $row->tree = $row->tree * (-1);
664 $del_node_data = $deleted_tree->getNodeData($row->tree);
665 $del_subtree_nodes = $deleted_tree->getSubTree($del_node_data);
669 if ($a_delete_objects)
671 foreach ($del_subtree_nodes as $node)
673 $node_obj =& $ilias->obj_factory->getInstanceByRefId($node[
"ref_id"]);
684 $tree->deleteTree($del_node_data);
708 $childrenDAV = array();
711 $childrenData =& $tree->getChilds($this->
getRefId(),
'');
712 foreach ($childrenData as
$data)
714 $childDAV =& $this->
createObject($data[
'ref_id'],$data[
'type']);
715 if (! is_null($childDAV))
719 $childrenDAV[] = $childDAV;
738 $permittedChildrenDAV = array();
739 foreach ($childrenDAV as $childDAV)
741 if ($childDAV->isPermitted($operations, $type))
743 $permittedChildrenDAV[] = $childDAV;
748 return $permittedChildrenDAV;
765 require_once
'class.ilObjMountPointDAV.php';
769 require_once
'class.ilObjRootDAV.php';
773 require_once
'class.ilObjCategoryDAV.php';
777 require_once
'class.ilObjFolderDAV.php';
781 require_once
'class.ilObjCourseDAV.php';
785 require_once
'class.ilObjGroupDAV.php';
789 require_once
'class.ilObjFileDAV.php';
793 require_once
'class.ilObjNullDAV.php';
799 if (! is_null($newObj))
817 $ilias->account->getLogin()
818 .
' DAV .'.get_class($this).
' '.str_replace(
"\n",
";",$message)