You are here

public static function Imce::element in FileField Sources 8

Theme the output of the imce element.

File

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

Class

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

Namespace

Drupal\filefield_sources\Plugin\FilefieldSource

Code

public static function element($variables) {
  $element = $variables['element'];
  $output = '';
  foreach (Element::children($element) as $key) {
    if (!empty($element[$key])) {
      $output .= \Drupal::service('renderer')
        ->render($element[$key]);
    }
  }
  return '<div class="filefield-source filefield-source-imce clear-block">' . $output . '</div>';
}