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();
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';
318 $ops = explode(
',',$operations);
319 if (in_array(
'visible',$ops) && ! in_array(
'write',$ops))
322 $operations .=
',write';
327 return $rbacsystem->checkAccess($operations, $this->
getRefId(),
$type);
332 $operations = explode(
",",$operations.
"");
333 foreach ($operations as $operation)
335 if (!$ilAccess->checkAccess($operation,
'', $this->getRefId(),
$type))
349 return $this->obj->getType();
385 require_once
'Modules/Folder/classes/class.ilObjFolder.php';
388 $newObj->setTitle(
$name);
391 $newObj->createReference();
392 $newObj->setPermissions($this->
getRefId());
393 $newObj->putInTree($this->
getRefId());
395 require_once
'class.ilObjFolderDAV.php';
409 require_once
'Modules/File/classes/class.ilObjFile.php';
412 $newObj->setTitle(
$name);
413 $newObj->setFileName(
$name);
414 include_once(
"./Services/Utilities/classes/class.ilMimeTypeUtil.php");
417 $newObj->setFileType($mime);
420 $newObj->createReference();
421 $newObj->setPermissions($this->
getRefId());
422 $newObj->putInTree($this->
getRefId());
425 require_once
'class.ilObjFileDAV.php';
426 $objDAV =&
new ilObjFileDAV($newObj->getRefId(), $newObj);
445 require_once
'Modules/File/classes/class.ilObjFile.php';
447 $objDAV->initFromNull();
462 require_once
'classes/class.ilObject.php';
464 $newObj->setType(
'null');
465 $newObj->setTitle(
$name);
467 $newObj->createReference();
468 $newObj->setPermissions($this->
getRefId());
469 $newObj->putInTree($this->
getRefId());
471 require_once
'class.ilObjNullDAV.php';
472 $objDAV =&
new ilObjNullDAV($newObj->getRefId(), $newObj);
484 function remove($objDAV)
486 global $tree, $rbacadmin;
488 $subnodes = $tree->getSubTree($tree->getNodeData($objDAV->getRefId()));
489 foreach ($subnodes as $node)
491 $rbacadmin->revokePermission($node[
"child"]);
494 $tree->saveSubTree($objDAV->getRefId());
495 $tree->deleteTree($tree->getNodeData($objDAV->getRefId()));
507 $this->
writelog(
"addCopy($objDAV,$newName) ....");
508 global $rbacadmin, $tree;
509 $revIdMapping = array();
510 $newRef = $this->
cloneNodes($objDAV->getRefId(),$this->
getRefId(),$revIdMapping, $newName);
512 return $this->
createObject($newRef, $objDAV->getILIASType());
513 $this->
writelog(
'... addCopy done.');
526 function cloneNodes($srcRef,$dstRef,&$mapping, $newName=null)
528 $this->
writelog(
"cloneNodes($srcRef,$dstRef,$mapping,$newName)");
533 $srcObj =& $ilias->obj_factory->getInstanceByRefId($srcRef);
534 $this->
writelog(
'cloneNodes cloning srcRef='.$srcRef.
' dstRef='.$dstRef.
'...');
535 $newObj = $srcObj->cloneObject($dstRef);
536 $newRef = $newObj->getRefId();
541 $this->
writelog(
"cloneNodes newname not null? ".(! is_null($newName)));
542 if (! is_null($newName))
544 $newObjDAV = $this->
createObject($newRef, $srcObj->getType());
545 $newObjDAV->setResourceName($newName);
549 $mapping[$newRef] = $srcRef;
552 $children = $tree->getChilds($srcRef);
553 foreach ($tree->getChilds($srcRef) as $child)
557 if ($child[
"type"] !=
'rolf')
559 $this->
cloneNodes($child[
"ref_id"],$newRef,$mapping,null);
563 if (count($rolf = $tree->getChildsByType($newRef,
"rolf")))
565 $mapping[$rolf[0][
"ref_id"]] = $child[
"ref_id"];
569 $this->
writelog(
'cloneNodes ...cloned srcRef='.$srcRef.
' dstRef='.$dstRef.
' newRef='.$newRef);
587 $this->
writelog(
'addMove('.$objDAV->getRefId().
' to '.$this->
getRefId().
', newName='.$newName.
')');
590 if (! is_null($newName))
592 $objDAV->setResourceName($newName);
597 $old_parent = $tree->getParentId($objDAV->getRefId());
600 $tree->moveTree($objDAV->getRefId(),$this->
getRefId());
603 $rbacadmin->adjustMovedObjectPermissions($objDAV->getRefId(), $old_parent);
667 $query =
"SELECT tree FROM tree WHERE parent = ? AND tree < 0 ";
668 $sta = $ilDB->prepare(
$query,array(
'integer',
'integer'));
669 $res = $ilDB->execute($sta,array(
674 while(
$row = $ilDB->fetchObject(
$res))
677 if (!in_array(
$row->tree,$a_checked))
680 $a_checked[] =
$row->tree;
683 $del_node_data = $deleted_tree->getNodeData(
$row->tree);
684 $del_subtree_nodes = $deleted_tree->getSubTree($del_node_data);
688 if ($a_delete_objects)
690 foreach ($del_subtree_nodes as $node)
692 $node_obj =& $ilias->obj_factory->getInstanceByRefId($node[
"ref_id"]);
703 $tree->deleteTree($del_node_data);
727 $childrenDAV = array();
730 $childrenData =& $tree->getChilds($this->
getRefId(),
'');
731 foreach ($childrenData as
$data)
733 $childDAV =& $this->
createObject($data[
'ref_id'],$data[
'type']);
734 if (! is_null($childDAV))
738 $childrenDAV[] = $childDAV;
757 $permittedChildrenDAV = array();
758 foreach ($childrenDAV as $childDAV)
760 if ($childDAV->isPermitted($operations,
$type))
762 $permittedChildrenDAV[] = $childDAV;
767 return $permittedChildrenDAV;
784 require_once
'class.ilObjMountPointDAV.php';
788 require_once
'class.ilObjRootDAV.php';
792 require_once
'class.ilObjCategoryDAV.php';
796 require_once
'class.ilObjFolderDAV.php';
800 require_once
'class.ilObjCourseDAV.php';
804 require_once
'class.ilObjGroupDAV.php';
808 require_once
'class.ilObjFileDAV.php';
812 require_once
'class.ilObjNullDAV.php';
818 if (! is_null($newObj))
836 $ilias->account->getLogin()
837 .
' DAV .'.get_class($this).
' '.str_replace(
"\n",
";",$message)