63 $this->
writelog(
'<constructor>('.$refId.
','.get_class($obj).
')');
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';
315 if(isset(
$_GET[
'mount-instructions']))
324 $ops = explode(
',',$operations);
325 if (in_array(
'visible',$ops) && ! in_array(
'write',$ops))
328 $operations .=
',write';
333 return $rbacsystem->checkAccess($operations, $this->
getRefId(), $type);
337 $GLOBALS[
'ilLog']->write(
'Checking permission for ref_id: '.$this->
getRefId());
338 $GLOBALS[
'ilLog']->write(
"Operations: ".print_r($operations,
true));
341 $operations = explode(
",",$operations.
"");
342 foreach ($operations as $operation)
344 if (!$ilAccess->checkAccess($operation,
'', $this->getRefId(), $type))
346 $GLOBALS[
'ilLog']->write(__METHOD__.
': Permission denied for user '.
$GLOBALS[
'ilUser']->getId());
361 return $this->obj->getType();
363 $GLOBALS[
'ilLog']->write(__METHOD__.
': Invalid object given, class='.get_class($this->obj));
400 require_once
'Modules/Folder/classes/class.ilObjFolder.php';
403 $newObj->setTitle($name);
406 $newObj->createReference();
407 $newObj->setPermissions($this->
getRefId());
408 $newObj->putInTree($this->
getRefId());
410 require_once
'class.ilObjFolderDAV.php';
424 require_once
'Modules/File/classes/class.ilObjFile.php';
427 $newObj->setTitle($name);
428 $newObj->setFileName($name);
429 include_once(
"./Services/Utilities/classes/class.ilMimeTypeUtil.php");
432 $newObj->setFileType($mime);
435 $newObj->createReference();
436 $newObj->setPermissions($this->
getRefId());
437 $newObj->putInTree($this->
getRefId());
440 require_once
'class.ilObjFileDAV.php';
441 $objDAV =
new ilObjFileDAV($newObj->getRefId(), $newObj);
460 require_once
'Modules/File/classes/class.ilObjFile.php';
462 $objDAV->initFromNull();
477 require_once
'./Services/Object/classes/class.ilObject.php';
479 $newObj->setType(
'null');
480 $newObj->setTitle($name);
482 $newObj->createReference();
483 $newObj->setPermissions($this->
getRefId());
484 $newObj->putInTree($this->
getRefId());
486 require_once
'class.ilObjNullDAV.php';
487 $objDAV =
new ilObjNullDAV($newObj->getRefId(), $newObj);
499 function remove($objDAV)
501 global $tree, $rbacadmin;
503 $subnodes = $tree->getSubTree($tree->getNodeData($objDAV->getRefId()));
504 foreach ($subnodes as $node)
506 $rbacadmin->revokePermission($node[
"child"]);
509 $tree->saveSubTree($objDAV->getRefId());
510 $tree->deleteTree($tree->getNodeData($objDAV->getRefId()));
522 $this->
writelog(
"addCopy($objDAV,$newName) ....");
523 global $rbacadmin, $tree;
524 $revIdMapping = array();
525 $newRef = $this->
cloneNodes($objDAV->getRefId(),$this->
getRefId(),$revIdMapping, $newName);
527 return $this->
createObject($newRef, $objDAV->getILIASType());
528 $this->
writelog(
'... addCopy done.');
541 function cloneNodes($srcRef,$dstRef,&$mapping, $newName=null)
543 $this->
writelog(
"cloneNodes($srcRef,$dstRef,$mapping,$newName)");
548 $srcObj =& $ilias->obj_factory->getInstanceByRefId($srcRef);
549 $this->
writelog(
'cloneNodes cloning srcRef='.$srcRef.
' dstRef='.$dstRef.
'...');
550 $newObj = $srcObj->cloneObject($dstRef);
551 $newRef = $newObj->getRefId();
556 $this->
writelog(
"cloneNodes newname not null? ".(! is_null($newName)));
557 if (! is_null($newName))
559 $newObjDAV = $this->
createObject($newRef, $srcObj->getType());
560 $newObjDAV->setResourceName($newName);
564 $mapping[$newRef] = $srcRef;
567 $children = $tree->getChilds($srcRef);
568 foreach ($tree->getChilds($srcRef) as $child)
572 if ($child[
"type"] !=
'rolf')
574 $this->
cloneNodes($child[
"ref_id"],$newRef,$mapping,null);
578 if (count($rolf = $tree->getChildsByType($newRef,
"rolf")))
580 $mapping[$rolf[0][
"ref_id"]] = $child[
"ref_id"];
584 $this->
writelog(
'cloneNodes ...cloned srcRef='.$srcRef.
' dstRef='.$dstRef.
' newRef='.$newRef);
602 $this->
writelog(
'addMove('.$objDAV->getRefId().
' to '.$this->
getRefId().
', newName='.$newName.
')');
605 if (! is_null($newName))
607 $objDAV->setResourceName($newName);
612 $old_parent = $tree->getParentId($objDAV->getRefId());
615 $tree->moveTree($objDAV->getRefId(),$this->
getRefId());
618 $rbacadmin->adjustMovedObjectPermissions($objDAV->getRefId(), $old_parent);
682 $query =
"SELECT tree FROM tree WHERE parent = ? AND tree < 0 ";
683 $sta = $ilDB->prepare(
$query,array(
'integer',
'integer'));
684 $res = $ilDB->execute($sta,array(
689 while(
$row = $ilDB->fetchObject(
$res))
692 if (!in_array(
$row->tree,$a_checked))
695 $a_checked[] =
$row->tree;
698 $del_node_data = $deleted_tree->getNodeData(
$row->tree);
699 $del_subtree_nodes = $deleted_tree->getSubTree($del_node_data);
703 if ($a_delete_objects)
705 foreach ($del_subtree_nodes as $node)
707 $node_obj =& $ilias->obj_factory->getInstanceByRefId($node[
"ref_id"]);
718 $tree->deleteTree($del_node_data);
742 $childrenDAV = array();
745 $childrenData =& $tree->getChilds($this->
getRefId(),
'');
746 foreach ($childrenData as
$data)
748 $childDAV =& $this->
createObject($data[
'ref_id'],$data[
'type']);
749 if (! is_null($childDAV))
753 $childrenDAV[] = $childDAV;
772 $permittedChildrenDAV = array();
773 foreach ($childrenDAV as $childDAV)
775 if ($childDAV->isPermitted($operations, $type))
777 $permittedChildrenDAV[] = $childDAV;
782 return $permittedChildrenDAV;
799 require_once
'class.ilObjMountPointDAV.php';
803 require_once
'class.ilObjRootDAV.php';
807 require_once
'class.ilObjCategoryDAV.php';
811 require_once
'class.ilObjFolderDAV.php';
815 require_once
'class.ilObjCourseDAV.php';
819 require_once
'class.ilObjGroupDAV.php';
823 require_once
'class.ilObjFileDAV.php';
827 require_once
'class.ilObjNullDAV.php';
833 if (! is_null($newObj))
851 $ilias->account->getLogin()
852 .
' DAV .'.get_class($this).
' '.str_replace(
"\n",
";",$message)
getObjectId()
Returns the object id of this object.
children()
Returns the children of this object.
getContentStream()
Returns the content of the object as a stream.
__toString()
This method is needed, because the object class in PHP 5.2 does not have a default implementation of ...
write()
Writes the object data.
static removeItemFromDesktops($a_id)
removes object from all user's desktops public
createObject($refId, $type)
Static factory method to create a DAV object for a given refId and type.
createNewVersion()
Creates a new version of the object.
getResourceType()
Returns the DAV resource type of this object.
childrenWithPermission($operations, $type='')
Returns the children of this object with the specified permissions.
createFile($name)
Creates a dav file as a child of this object.
Class ilObject Basic functions for all objects.
cloneNodes($srcRef, $dstRef, &$mapping, $newName=null)
Recursively clones all nodes of the RBAC tree.
ilObjectDAV($refId, $obj=null)
Constructor.
createFileFromNull($name, &$nullDAV)
Creates a dav file as a child of this object.
isNullResource()
Returns true if this is a null resource.
getILIASFileType()
Returns the ilias type for files that can be created as children of this object.
createCollection($name)
Creates a dav collection as a child of this object.
getDisplayName()
Returns the display name of this object.
getContentType()
Returns the mime type of the content of this object.
setContentLength($length)
Sets the length (number of bytes) of the content of this object.
static getMimeType($a_file="", $a_filename="", $a_mime="")
Get Mime type.
getModificationTimestamp()
Returns the modification date of this object as a Unix timestamp.
getResourceName()
Returns the resource name of this object.
read()
Reads the object data.
getILIASCollectionType()
Returns the ilias type for collections that can be created as children of this object.
isFile()
Returns true if this object is a DAV file.
createNull($name)
Creates a dav null object as a child of this object.
isCollection()
Returns true if this object is a DAV collection.
addMove(&$objDAV, $newName=null)
Adds (moves) the specified object as a child to this object.
getContentLength()
Returns the number of bytes of the content.
setContentType($type)
Sets the mime type of the content of this object.
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
removeDeletedNodes($a_node_id, $a_checked, $a_delete_objects=true)
remove already deleted objects within the objects in trash recursive function
isPermitted($operations, $type='')
Returns whether a specific operation is permitted for the current user.
getContentOutputStream()
Returns an output stream to the content.
$refId
Refid to the object.
setResourceName($name)
Sets the resource name of this object.
initFromNull()
Initializes the object after it has been converted from NULL.
$isDebug
The ObjectDAV prints lots of log messages to the ilias log, if this variable is set to true...
getNodeId()
Returns the node id of this object.
getContentOutputStreamLength()
Returns the length of the content output stream.
isOnline()
Returns true if the object is online.
getCreationTimestamp()
Returns the creation date of this object as a Unix timestamp.
getILIASType()
Returns the ilias type of the current object.
getContentData()
Returns the content of the object as a byte array.
writelog($message)
Writes a message to the logfile.,.
$obj
Application layer object.
addCopy(&$objDAV, $newName=null)
Adds a copy of the specified object as a child to this object.
getRefId()
Returns the ref id of this object.