You are here

private function Presentation::splitFiles in Filebrowser 8.2

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

File

src/Presentation.php, line 410

Class

Presentation

Namespace

Drupal\filebrowser

Code

private function splitFiles($files) {

  // TODO : take data from $unsorted_rows and not $data
  $result = [];
  foreach ($files as $name => $data) {
    if ($name == '.') {
      continue;
    }
    elseif ($data->fileData->type == 'file') {
      $result['files'][] = $data;
    }
    else {

      // Do not retain the '.' folder
      $result['folders'][] = $data;
    }
  }
  return $result;
}