You are here

public function elFinderVolumeDrupal::owner in elFinder file manager 8.2

Same name and namespace in other branches
  1. 6.2 inc/elfinder.drupalfs.driver.inc \elFinderVolumeDrupal::owner()
  2. 7.3 inc/elfinder.drupalfs.driver.inc \elFinderVolumeDrupal::owner()
  3. 7.2 inc/elfinder.drupalfs.driver.inc \elFinderVolumeDrupal::owner()

File

src/Controller/elFinderVolumeDrupal.php, line 329
elFinder driver for Drupal filesystem.

Class

elFinderVolumeDrupal
@file

Code

public function owner($target) {
  $path = $this
    ->decode($target);
  $file = $this
    ->_drupalfileobject($path);
  if ($file
    ->id()) {
    $owneraccount = $file
      ->getOwner();

    /* AS */
    $owner = $owneraccount
      ->getUsername();
    $ownerformat = \Drupal::config('elfinder.settings')
      ->get('filesystem.owner_format');
    if ($ownerformat != '') {
      $owner = token_replace($ownerformat, array(
        'user' => $owneraccount,
      ));
    }
    return $owner;
  }
  return FALSE;
}