getFormObject(); if ($form_object instanceof ViewsForm && strpos($form_object->getBaseFormId(), 'views_form_media_library') === 0) { $form['#attributes']['class'][] = 'media-library-views-form'; } } /** * Implements hook_preprocess_image_widget(). */ function classy_preprocess_image_widget(array &$variables) { $data = &$variables['data']; // This prevents image widget templates from rendering preview container HTML // to users that do not have permission to access these previews. // @todo revisit in https://drupal.org/node/953034 // @todo revisit in https://drupal.org/node/3114318 if (isset($data['preview']['#access']) && $data['preview']['#access'] === FALSE) { unset($data['preview']); } } /** * No changes that impact functionality should be made to this file, as Classy * will be deprecated in Drupal 9. Changes should instead be made in the core * themes Bartik, Seven, Claro and/or Umami. */