false, 'message' => 'Unknown shared object type'); } $treeFilePath = IHMConfigClass::getSharedTreeFilePath(); if (!file_exists($treeFilePath)) return array('success' => false, 'message' => 'Cannot retrieve shared objects file'); $dom = new DomDocument("1.0"); if (!$dom->load($treeFilePath)) return array('success' => false, 'message' => 'Cannot load shared objects file'); $objectRootNodeId = 'shared'.$object_type.'-treeRootNode'; $objectRootNode = $dom->getElementById($objectRootNodeId); if (!isset($objectRootNode)) return array('success' => false, 'message' => 'Cannot retrieve shared objects root node'); $folderNodes = $objectRootNode->getElementsByTagName("folder"); foreach ($folderNodes as $folderNode) { $objectNodes = $folderNode->getElementsByTagName($object_type); foreach ($objectNodes as $objectNode) { if ($objectNode->getAttribute('xml:id') == $object_id) { switch ($object_type) { } return array('success' => true, 'path' => IHMConfigClass::getSharedPath().$objectDir."/".$folderNode->getAttribute('name').'/data/'.$object_id.".xml"); } } } return array('success' => false, 'message' => 'Cannot retrieve shared object with id '.$object_id); } } ?>