You are here

function social_group_request_theme_registry_alter in Open Social 10.3.x

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_group/modules/social_group_request/social_group_request.module \social_group_request_theme_registry_alter()
  2. 10.0.x modules/social_features/social_group/modules/social_group_request/social_group_request.module \social_group_request_theme_registry_alter()
  3. 10.1.x modules/social_features/social_group/modules/social_group_request/social_group_request.module \social_group_request_theme_registry_alter()
  4. 10.2.x modules/social_features/social_group/modules/social_group_request/social_group_request.module \social_group_request_theme_registry_alter()

Implements hook_theme_registry_alter().

File

modules/social_features/social_group/modules/social_group_request/social_group_request.module, line 116
Primary module hooks for social_group_request module.

Code

function social_group_request_theme_registry_alter(&$theme_registry) {

  // Unfortunately the preprocess functions aren't ordered by module weight.
  // Changing module weight doesn't work, also with dependency set to
  // social_group this should be dealt with but isn't.
  // So we enforce our preprocess after social_group.
  if (!empty($theme_registry['group']['preprocess functions'])) {
    $current_key = array_search('social_group_request_preprocess_group', $theme_registry['group']['preprocess functions'], FALSE);
    unset($theme_registry['group']['preprocess functions'][$current_key]);

    // Give it a new key all the way at the end.
    $theme_registry['group']['preprocess functions'][] = 'social_group_request_preprocess_group';
  }
}