You are here

function filebrowser_theme_suggestions_form_element_alter in Filebrowser 8.2

Same name and namespace in other branches
  1. 3.x filebrowser.module \filebrowser_theme_suggestions_form_element_alter()

File

./filebrowser.module, line 342

Code

function filebrowser_theme_suggestions_form_element_alter(array &$suggestions, array $variables) {
  if ($node = \Drupal::service('filebrowser.common')
    ->getNodeFromPath()) {
    if ($node
      ->bundle() == 'dir_listing') {
      if (!empty($variables['element']['#attributes']['class'])) {
        $classes = $variables['element']['#attributes']['class'];
        if (in_array(Common::FILEBROWSER_GRID_ITEM_CLASS, $classes)) {
          $suggestions = [
            'filebrowser_form_element',
          ];
        }
      }
    }
  }
}