You are here

public static function Imce::preRenderWidget in FileField Sources 8

Pre-renders widget form.

File

src/Plugin/FilefieldSource/Imce.php, line 211

Class

Imce
A FileField source plugin to allow referencing of files from IMCE.

Namespace

Drupal\filefield_sources\Plugin\FilefieldSource

Code

public static function preRenderWidget($element) {

  // Hide elements if there is already an uploaded file.
  if (!empty($element['#value']['fids'])) {
    $element['filefield_imce']['imce_paths']['#access'] = FALSE;
    $element['filefield_imce']['imce_button']['#access'] = FALSE;
  }
  return $element;
}