protected function build_breadcrumb($path) {
        $breadcrumb = array(array(
            'name' => get_string('root', 'repository_filesystem'),
            'path' => $this->build_node_path('root')
        ));

        $crumbs = explode('|', $path);
        $trail = '';

        foreach ($crumbs as $crumb) {
            list($mode, $nodepath, $display) = $this->explode_node_path($crumb);
            switch ($mode) {
                case 'search':
                    $breadcrumb[] = array(
                        'name' => get_string('searchresults', 'repository_filesystem'),
                        'path' => $this->build_node_path($mode, $nodepath, $display, $trail),
                    );
                    break;

                case 'browse':
                    $breadcrumb[] = array(
                        'name' => $display,
                        'path' => $this->build_node_path($mode, $nodepath, $display, $trail),
                    );
                    break;
            }

            $lastcrumb = end($breadcrumb);
            $trail = $lastcrumb['path'];
        }

        return $breadcrumb;
    }