23 if (!isset(self::$instance)) {
24 self::$instance =
new self();
26 return self::$instance;
44 $a_uri = strtolower(trim($a_uri,
'/'));
51 $splitted_path = explode(
'/', $a_uri, 3);
54 if (count($splitted_path) < 2) {
58 $repository_mountpoint = $splitted_path[1];
59 $path_in_mountpoint = $splitted_path[2];
63 if ($repository_mountpoint ==
'ilias') {
64 if ($path_in_mountpoint !=
'') {
65 $ref_path = self::getRefIdForGivenRootAndPath(ROOT_FOLDER_ID, $path_in_mountpoint);
66 $searched_node = $ref_path[count($ref_path) - 1];
67 $ref_id = $searched_node[
'child'];
69 $ref_id = ROOT_FOLDER_ID;
73 elseif (substr($splitted_path[1], 0, 4) ==
'ref_') {
76 $start_node = (int) explode(
'_', $repository_mountpoint)[1];
77 if ($path_in_mountpoint !=
'' && $start_node > 0) {
78 $ref_id = self::getRefIdForGivenRootAndPath($start_node, $path_in_mountpoint);
79 } elseif ($path_in_mountpoint ==
'') {
80 $ref_id = $start_node;
100 return self::iterateRecursiveThroughTree(explode(
'/', $path_from_startnode), 0, $start_ref);
116 if ($path_title_array[$searched_element_index] ==
'' || count($path_title_array) == $searched_element_index) {
117 return $parent_ref_id;
121 foreach ($DIC->repositoryTree()->getChildIds($parent_ref_id) as $child_ref) {
124 if ($path_title_array[$searched_element_index] == $child_title) {
125 if (count($path_title_array) - 1 == $searched_element_index) {
130 return self::iterateRecursiveThroughTree($path_title_array, $searched_element_index + 1, $child_ref);
static getRefIdForGivenRootAndPath(int $start_ref, string $path_from_startnode)
static _lookupTitle($a_id)
lookup object title
static _lookupObjectId($a_ref_id)
lookup object id
static getRefIdForWebDAVPath($a_uri)
Returns the ref_id of the given webdav path.
static iterateRecursiveThroughTree($path_title_array, $searched_element_index, $parent_ref_id)
Recursive function to iterate through tree with given path.