cache = Gallery3_DAV_Cache::instance(); $this->root_node = $root_node; } public function move($source, $target) { $source_item = $this->cache->to_item($source); $target_item = $this->cache->to_album($target); try { access::required("view", $source_item); access::required("edit", $source_item); access::required("view", $target_item); access::required("edit", $target_item); } catch (Kohana_404_Exception $e) { throw new Sabre_DAV_Exception_Forbidden("Access denied"); } $source_item->parent_id = $target_item->id; $source_item->save(); return true; } public function getNodeForPath($path) { $path = trim($path,"/"); $item = $this->cache->to_item($path); if (!$item->loaded()) { throw new Sabre_DAV_Exception_FileNotFound("Could not find node at path: $path"); } if ($item->is_album()) { return new Gallery3_DAV_Album($path); } else { return new Gallery3_DAV_File($path); } } }