You are here

function gin_lb_is_valid_theme in Gin Layout Builder 1.0.x

Returns true if the current theme is not gin.

Return value

bool return true if gin === 'false'

7 calls to gin_lb_is_valid_theme()
gin_lb_form_alter in ./gin_lb.module
Implements hook_form_alter().
gin_lb_is_layout_builder_form_id in ./gin_lb.module
Returns true if the given form id should rendered in gin style.
gin_lb_preprocess_links__media_library_menu in ./gin_lb.module
Implements hook_preprocess_links__media_library_menu().
gin_lb_preprocess_media_library_item in ./gin_lb.module
Implements hook_preprocess_media_library_item__widget().
gin_lb_theme_suggestions_alter in ./gin_lb.module
Implements hook_theme_suggestions_alter().

... See full list

File

./gin_lb.module, line 35
Provides hooks for gin_lb module.

Code

function gin_lb_is_valid_theme() {

  /** @var \Drupal\Core\Theme\ThemeManagerInterface $theme_manager */
  $theme_manager = \Drupal::service('theme.manager');
  $active_theme = $theme_manager
    ->getActiveTheme();
  if ($active_theme
    ->getName() === 'gin' || array_key_exists('gin', $active_theme
    ->getBaseThemeExtensions())) {
    return FALSE;
  }
  return TRUE;
}