public function elFinderVolumeDrupal::owner in elFinder file manager 8.2
Same name and namespace in other branches
- 6.2 inc/elfinder.drupalfs.driver.inc \elFinderVolumeDrupal::owner()
 - 7.3 inc/elfinder.drupalfs.driver.inc \elFinderVolumeDrupal::owner()
 - 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;
}