private function get_listing_prepare_response($path) {
        $ret = [
            // Fetch the list dynamically. An AJAX request is sent to the server as soon as the user opens a folder.
            'dynload' => true,
            'nosearch' => true, // Disable search.
            'nologin' => false, // Provide a login link because a user logs into his/her private Nextcloud storage.
            'path' => array([ // Contains all parent paths to the current path.
                'name' => $this->get_meta()->name,
                'path' => '',
            ]),
            'defaultreturntype' => $this->default_returntype(),
            'manage' => $this->issuer->get('baseurl'), // Provide button to go into file management interface quickly.
            'list' => array(), // Contains all file/folder information and is required to build the file/folder tree.
        ];

        // If relative path is a non-top-level path, calculate all its parents' paths.
        // This is used for navigation in the file picker.
        if ($path != '/') {
            $chunks = explode('/', trim($path, '/'));
            $parent = '/';
            // Every sub-path to the last part of the current path is a parent path.
            foreach ($chunks as $chunk) {
                $subpath = $parent . $chunk . '/';
                $ret['path'][] = [
                    'name' => urldecode($chunk),
                    'path' => $subpath
                ];
                // Prepare next iteration.
                $parent = $subpath;
            }
        }
        return $ret;
    }
private function get_listing_prepare_response($path) {
        $ret = [
            // Fetch the list dynamically. An AJAX request is sent to the server as soon as the user opens a folder.
            'dynload' => true,
            'nosearch' => true, // Disable search.
            'nologin' => false, // Provide a login link because a user logs into his/her private Nextcloud storage.
            'path' => array([ // Contains all parent paths to the current path.
                'name' => $this->get_meta()->name,
                'path' => '',
            ]),
            'defaultreturntype' => $this->default_returntype(),
            'manage' => $this->issuer->get('baseurl'), // Provide button to go into file management interface quickly.
            'list' => array(), // Contains all file/folder information and is required to build the file/folder tree.
        ];

        // If relative path is a non-top-level path, calculate all its parents' paths.
        // This is used for navigation in the file picker.
        if ($path != '/') {
            $chunks = explode('/', trim($path, '/'));
            $parent = '/';
            // Every sub-path to the last part of the current path is a parent path.
            foreach ($chunks as $chunk) {
                $subpath = $parent . $chunk . '/';
                $ret['path'][] = [
                    'name' => urldecode($chunk),
                    'path' => $subpath
                ];
                // Prepare next iteration.
                $parent = $subpath;
            }
        }
        return $ret;
    }
private function get_listing_prepare_response ( $ path ) { $ ret = [ // Fetch the list dynamically. An AJAX request is sent to the server as soon as the user opens a folder. 'dynload' => true , 'nosearch' => true , // Disable search. 'nologin' => false , // Provide a login link because a user logs into his/her private Nextcloud storage. 'path' => array ( [ // Contains all parent paths to the current path. 'name' => $ this -> get_meta ( ) -> name , 'path' => '' , ] ) , 'defaultreturntype' => $ this -> default_returntype ( ) , 'manage' => $ this -> issuer -> get ( 'baseurl' ) , // Provide button to go into file management interface quickly. 'list' => array ( ) , // Contains all file/folder information and is required to build the file/folder tree. ] ; // If relative path is a non-top-level path, calculate all its parents' paths. // This is used for navigation in the file picker. if ( $ path != '/' ) { $ chunks = explode ( '/' , trim ( $ path , '/' ) ) ; $ parent = '/' ; // Every sub-path to the last part of the current path is a parent path. foreach ( $ chunks as $ chunk ) { $ subpath = $ parent . $ chunk . '/' ; $ ret [ 'path' ] [ ] = [ 'name' => urldecode ( $ chunk ) , 'path' => $ subpath ] ; // Prepare next iteration. $ parent = $ subpath ; } } return $ ret ; }
Prepare response of get_listing; namely
- defining setting elements,
- filling in the parent path of the currently-viewed directory.

@param string $path Relative path
@return array ret array for use as get_listing's $ret
Prepare response of get_listing ; namely - defining setting elements - filling in the parent path of the currently - viewed directory .