You are here

class SocialGroupAdminPeopleConfigOverride in Open Social 8.8

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_group/src/SocialGroupAdminPeopleConfigOverride.php \Drupal\social_group\SocialGroupAdminPeopleConfigOverride
  2. 8.5 modules/social_features/social_group/src/SocialGroupAdminPeopleConfigOverride.php \Drupal\social_group\SocialGroupAdminPeopleConfigOverride
  3. 8.6 modules/social_features/social_group/src/SocialGroupAdminPeopleConfigOverride.php \Drupal\social_group\SocialGroupAdminPeopleConfigOverride
  4. 8.7 modules/social_features/social_group/src/SocialGroupAdminPeopleConfigOverride.php \Drupal\social_group\SocialGroupAdminPeopleConfigOverride
  5. 10.3.x modules/social_features/social_group/src/SocialGroupAdminPeopleConfigOverride.php \Drupal\social_group\SocialGroupAdminPeopleConfigOverride
  6. 10.0.x modules/social_features/social_group/src/SocialGroupAdminPeopleConfigOverride.php \Drupal\social_group\SocialGroupAdminPeopleConfigOverride
  7. 10.1.x modules/social_features/social_group/src/SocialGroupAdminPeopleConfigOverride.php \Drupal\social_group\SocialGroupAdminPeopleConfigOverride
  8. 10.2.x modules/social_features/social_group/src/SocialGroupAdminPeopleConfigOverride.php \Drupal\social_group\SocialGroupAdminPeopleConfigOverride

Class SocialGroupAdminPeopleConfigOverride.

@package Drupal\social_group

Hierarchy

Expanded class hierarchy of SocialGroupAdminPeopleConfigOverride

2 string references to 'SocialGroupAdminPeopleConfigOverride'
SocialGroupAdminPeopleConfigOverride::getCacheSuffix in modules/social_features/social_group/src/SocialGroupAdminPeopleConfigOverride.php
The string to append to the configuration static cache name.
social_group.services.yml in modules/social_features/social_group/social_group.services.yml
modules/social_features/social_group/social_group.services.yml
1 service uses SocialGroupAdminPeopleConfigOverride
social_group.admin_people_override in modules/social_features/social_group/social_group.services.yml
\Drupal\social_group\SocialGroupAdminPeopleConfigOverride

File

modules/social_features/social_group/src/SocialGroupAdminPeopleConfigOverride.php, line 15

Namespace

Drupal\social_group
View source
class SocialGroupAdminPeopleConfigOverride implements ConfigFactoryOverrideInterface {

  /**
   * The module handler.
   *
   * @var \Drupal\Core\Extension\ModuleHandlerInterface
   */
  protected $moduleHandler;

  /**
   * Constructs the configuration override.
   *
   * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
   *   The module handler.
   */
  public function __construct(ModuleHandlerInterface $module_handler) {
    $this->moduleHandler = $module_handler;
  }

  /**
   * Load overrides.
   */
  public function loadOverrides($names) {
    $overrides = [];
    $config_name = 'views.view.user_admin_people';

    // Add AddMembersToGroup to VBO Admin people.
    if (in_array($config_name, $names, TRUE)) {
      $overrides[$config_name] = [
        'display' => [
          'default' => [
            'display_options' => [
              'fields' => [
                'views_bulk_operations_bulk_form' => [
                  'selected_actions' => [
                    'social_group_add_members_to_group_action' => 'social_group_add_members_to_group_action',
                  ],
                ],
              ],
            ],
          ],
        ],
      ];
    }
    $config_name = 'views.view.group_manage_members';

    // Add all available group types on the platform here, so they can all
    // make use of the new manage members overview.
    if (in_array($config_name, $names, TRUE)) {
      $social_group_types = [
        'open_group',
        'closed_group',
        'public_group',
      ];
      $this->moduleHandler
        ->alter('social_group_types', $social_group_types);

      // Loop over all group types.
      foreach ($social_group_types as $group_type) {
        $membership = $group_type . '-group_membership';

        // Add each group type to the filters of this overview.
        $overrides[$config_name]['display']['default']['display_options']['filters']['type']['value'][$membership] = $membership;
      }
    }
    return $overrides;
  }

  /**
   * {@inheritdoc}
   */
  public function getCacheSuffix() {
    return 'SocialGroupAdminPeopleConfigOverride';
  }

  /**
   * {@inheritdoc}
   */
  public function getCacheableMetadata($name) {
    return new CacheableMetadata();
  }

  /**
   * {@inheritdoc}
   */
  public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION) {
    return NULL;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
SocialGroupAdminPeopleConfigOverride::$moduleHandler protected property The module handler.
SocialGroupAdminPeopleConfigOverride::createConfigObject public function Creates a configuration object for use during install and synchronization. Overrides ConfigFactoryOverrideInterface::createConfigObject
SocialGroupAdminPeopleConfigOverride::getCacheableMetadata public function Gets the cacheability metadata associated with the config factory override. Overrides ConfigFactoryOverrideInterface::getCacheableMetadata
SocialGroupAdminPeopleConfigOverride::getCacheSuffix public function The string to append to the configuration static cache name. Overrides ConfigFactoryOverrideInterface::getCacheSuffix
SocialGroupAdminPeopleConfigOverride::loadOverrides public function Load overrides. Overrides ConfigFactoryOverrideInterface::loadOverrides
SocialGroupAdminPeopleConfigOverride::__construct public function Constructs the configuration override.