You are here

private function Presentation::sortIconViewFiles in Filebrowser 8.2

Same name and namespace in other branches
  1. 3.x src/Presentation.php \Drupal\filebrowser\Presentation::sortIconViewFiles()
1 call to Presentation::sortIconViewFiles()
Presentation::iconView in src/Presentation.php

File

src/Presentation.php, line 428

Class

Presentation

Namespace

Drupal\filebrowser

Code

private function sortIconViewFiles(&$source) {

  /** @var DisplayFile $data */
  $files = [];
  $folders = [];
  foreach ($source as $name => $data) {
    if ($name != '.') {
      if ($data->fileData->type == 'file') {
        $files[$name] = $data;
      }
      else {
        $folders[$name] = $data;
      }
    }
  }
  $source = $folders + $files;
}