You are here

public function SocialGroupSecretConfigOverride::loadOverrides in Open Social 8.7

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_group/modules/social_group_secret/src/SocialGroupSecretConfigOverride.php \Drupal\social_group_secret\SocialGroupSecretConfigOverride::loadOverrides()
  2. 8.6 modules/social_features/social_group/modules/social_group_secret/src/SocialGroupSecretConfigOverride.php \Drupal\social_group_secret\SocialGroupSecretConfigOverride::loadOverrides()
  3. 8.8 modules/social_features/social_group/modules/social_group_secret/src/SocialGroupSecretConfigOverride.php \Drupal\social_group_secret\SocialGroupSecretConfigOverride::loadOverrides()
  4. 10.3.x modules/social_features/social_group/modules/social_group_secret/src/SocialGroupSecretConfigOverride.php \Drupal\social_group_secret\SocialGroupSecretConfigOverride::loadOverrides()
  5. 10.0.x modules/social_features/social_group/modules/social_group_secret/src/SocialGroupSecretConfigOverride.php \Drupal\social_group_secret\SocialGroupSecretConfigOverride::loadOverrides()
  6. 10.1.x modules/social_features/social_group/modules/social_group_secret/src/SocialGroupSecretConfigOverride.php \Drupal\social_group_secret\SocialGroupSecretConfigOverride::loadOverrides()
  7. 10.2.x modules/social_features/social_group/modules/social_group_secret/src/SocialGroupSecretConfigOverride.php \Drupal\social_group_secret\SocialGroupSecretConfigOverride::loadOverrides()

Load overrides.

Overrides ConfigFactoryOverrideInterface::loadOverrides

File

modules/social_features/social_group/modules/social_group_secret/src/SocialGroupSecretConfigOverride.php, line 37

Class

SocialGroupSecretConfigOverride
Class SocialGroupSecretConfigOverride.

Namespace

Drupal\social_group_secret

Code

public function loadOverrides($names) {
  $overrides = [];
  $config_names = [
    'search_api.index.social_all',
    'search_api.index.social_groups',
  ];
  foreach ($config_names as $config_name) {
    if (in_array($config_name, $names)) {
      $overrides[$config_name] = [
        'field_settings' => [
          'rendered_item' => [
            'configuration' => [
              'view_mode' => [
                'entity:group' => [
                  'secret_group' => 'teaser',
                ],
              ],
            ],
          ],
        ],
      ];
    }
  }
  $config_names = [
    'views.view.search_all',
    'views.view.search_groups',
  ];
  foreach ($config_names as $config_name) {
    if (in_array($config_name, $names)) {
      $overrides[$config_name] = [
        'display' => [
          'default' => [
            'display_options' => [
              'row' => [
                'options' => [
                  'view_modes' => [
                    'entity:group' => [
                      'secret_group' => 'teaser',
                    ],
                  ],
                ],
              ],
            ],
          ],
        ],
      ];
    }
  }
  $config_names = [
    'views.view.group_members',
    'views.view.group_manage_members',
  ];
  foreach ($config_names as $config_name) {
    if (in_array($config_name, $names)) {
      $overrides[$config_name] = [
        'dependencies' => [
          'config' => [
            'secret_group-group_membership' => 'group.content_type.secret_group-group_membership',
          ],
        ],
        'display' => [
          'default' => [
            'display_options' => [
              'filters' => [
                'type' => [
                  'value' => [
                    'secret_group-group_membership' => 'secret_group-group_membership',
                  ],
                ],
              ],
            ],
          ],
        ],
      ];
    }
  }
  $config_names = [
    'views.view.group_events' => 'secret_group-group_node-event',
    'views.view.group_topics' => 'secret_group-group_node-topic',
  ];
  foreach ($config_names as $config_name => $content_type) {
    if (in_array($config_name, $names)) {
      $overrides[$config_name] = [
        'dependencies' => [
          'config' => [
            'group-content-type' => 'group.content_type.' . $content_type,
            'group-type' => 'group.type',
          ],
        ],
        'display' => [
          'default' => [
            'display_options' => [
              'arguments' => [
                'gid' => [
                  'validate_options' => [
                    'bundles' => [
                      'secret_group' => 'secret_group',
                    ],
                  ],
                ],
              ],
              'filters' => [
                'type' => [
                  'value' => [
                    $content_type => $content_type,
                  ],
                ],
              ],
            ],
          ],
        ],
      ];
    }
  }
  $config_name = 'message.template.create_content_in_joined_group';
  if (in_array($config_name, $names, FALSE)) {
    $overrides[$config_name]['third_party_settings']['activity_logger']['activity_bundle_entities'] = [
      'group_content-secret_group-group_node-event' => 'group_content-secret_group-group_node-event',
      'group_content-secret_group-group_node-topic' => 'group_content-secret_group-group_node-topic',
    ];
  }
  $config_name = 'views.view.newest_groups';
  $displays = [
    'page_all_groups',
    'block_newest_groups',
  ];
  if (in_array($config_name, $names)) {
    foreach ($displays as $display_name) {
      $overrides[$config_name] = [
        'display' => [
          $display_name => [
            'cache_metadata' => [
              'contexts' => [
                'user' => 'user',
              ],
            ],
          ],
        ],
      ];
    }
  }
  return $overrides;
}