src/Contao/View/Contao2BackendView/Widget/FileTree.php
private function renderList(array &$icons, Collection $collection = null, $followSubDirs = false)
    {
        if (!$collection) {
            return;
        }

        foreach ($collection->getModels() as $model) {
            // File system and database seem not in sync
            if (!\file_exists($this->rootDir . '/' . $model->path)) {
                continue;
            }

            if (('folder' === $model->type) && $followSubDirs) {
                $this->renderList($icons, FilesModel::findByPid($model->uuid));
                continue;
            }
            if (false !== ($icon = $this->renderIcon($model, $this->isGallery, $this->isDownloads))) {
                $icons[\md5($model->uuid)] = ['uuid' => $model->uuid, 'image' => $icon];
            }
        }
    }
private function renderList(array &$icons, Collection $collection = null, $followSubDirs = false)
    {
        if (!$collection) {
            return;
        }

        foreach ($collection->getModels() as $model) {
            // File system and database seem not in sync
            if (!\file_exists($this->rootDir . '/' . $model->path)) {
                continue;
            }

            if (('folder' === $model->type) && $followSubDirs) {
                $this->renderList($icons, FilesModel::findByPid($model->uuid));
                continue;
            }
            if (false !== ($icon = $this->renderIcon($model, $this->isGallery, $this->isDownloads))) {
                $icons[\md5($model->uuid)] = ['uuid' => $model->uuid, 'image' => $icon];
            }
        }
    }
private function renderList ( array & $ icons , Collection $ collection = null , $ followSubDirs = false ) { if ( ! $ collection ) { return ; } foreach ( $ collection -> getModels ( ) as $ model ) { // File system and database seem not in sync if ( ! \ file_exists ( $ this -> rootDir . '/' . $ model -> path ) ) { continue ; } if ( ( 'folder' === $ model -> type ) && $ followSubDirs ) { $ this -> renderList ( $ icons , FilesModel :: findByPid ( $ model -> uuid ) ) ; continue ; } if ( false !== ( $ icon = $ this -> renderIcon ( $ model , $ this -> isGallery , $ this -> isDownloads ) ) ) { $ icons [ \ md5 ( $ model -> uuid ) ] = [ 'uuid' => $ model -> uuid , 'image' => $ icon ] ; } } }
Render the file list.

@param array           $icons         The generated icons.
@param Collection|null $collection    The files collection.

@param bool            $followSubDirs If true subfolders get rendered.

@return void
Render the file list .