application/Espo/Core/Utils/File/Manager.php
protected function getSingeFileList(array $fileList, $onlyFileType = null, $basePath = null, $parentDirName = '')
    {
        $singleFileList = array();
        foreach($fileList as $dirName => $fileName) {

            if (is_array($fileName)) {
                $currentDir = Utils\Util::concatPath($parentDirName, $dirName);

                if (!isset($onlyFileType) || $onlyFileType == $this->isFile($currentDir, $basePath)) {
                    $singleFileList[] = $currentDir;
                }

                $singleFileList = array_merge($singleFileList, $this->getSingeFileList($fileName, $onlyFileType, $basePath, $currentDir));

            } else {
                $currentFileName = Utils\Util::concatPath($parentDirName, $fileName);

                if (!isset($onlyFileType) || $onlyFileType == $this->isFile($currentFileName, $basePath)) {
                    $singleFileList[] = $currentFileName;
                }
            }
        }

        return $singleFileList;
    }
protected function getSingeFileList(array $fileList, $onlyFileType = null, $basePath = null, $parentDirName = '')
    {
        $singleFileList = array();
        foreach($fileList as $dirName => $fileName) {

            if (is_array($fileName)) {
                $currentDir = Utils\Util::concatPath($parentDirName, $dirName);

                if (!isset($onlyFileType) || $onlyFileType == $this->isFile($currentDir, $basePath)) {
                    $singleFileList[] = $currentDir;
                }

                $singleFileList = array_merge($singleFileList, $this->getSingeFileList($fileName, $onlyFileType, $basePath, $currentDir));

            } else {
                $currentFileName = Utils\Util::concatPath($parentDirName, $fileName);

                if (!isset($onlyFileType) || $onlyFileType == $this->isFile($currentFileName, $basePath)) {
                    $singleFileList[] = $currentFileName;
                }
            }
        }

        return $singleFileList;
    }
protected function getSingeFileList ( array $ fileList , $ onlyFileType = null , $ basePath = null , $ parentDirName = '' ) { $ singleFileList = array ( ) ; foreach ( $ fileList as $ dirName => $ fileName ) { if ( is_array ( $ fileName ) ) { $ currentDir = Utils \ Util :: concatPath ( $ parentDirName , $ dirName ) ; if ( ! isset ( $ onlyFileType ) || $ onlyFileType == $ this -> isFile ( $ currentDir , $ basePath ) ) { $ singleFileList [ ] = $ currentDir ; } $ singleFileList = array_merge ( $ singleFileList , $ this -> getSingeFileList ( $ fileName , $ onlyFileType , $ basePath , $ currentDir ) ) ; } else { $ currentFileName = Utils \ Util :: concatPath ( $ parentDirName , $ fileName ) ; if ( ! isset ( $ onlyFileType ) || $ onlyFileType == $ this -> isFile ( $ currentFileName , $ basePath ) ) { $ singleFileList [ ] = $ currentFileName ; } } } return $ singleFileList ; }
Convert file list to a single array

@param aray $fileList
@param bool $onlyFileType [null, true, false] - Filter for type of files/directories.
@param string $parentDirName

@return aray
Convert file list to a single array