You are here

function hook_social_group_group_visibility_description_alter in Open Social 10.2.x

Same name and namespace in other branches
  1. 10.3.x modules/social_features/social_group/social_group.api.php \hook_social_group_group_visibility_description_alter()
  2. 10.0.x modules/social_features/social_group/social_group.api.php \hook_social_group_group_visibility_description_alter()
  3. 10.1.x modules/social_features/social_group/social_group.api.php \hook_social_group_group_visibility_description_alter()

Provide a description for a given key from the group_visibility #options.

Parameters

string $description: The descriptive.

1 invocation of hook_social_group_group_visibility_description_alter()
social_group_group_visibility_description in modules/social_features/social_group/social_group.module
Returns a description array for the field_flexible_group_visibility options.

File

modules/social_features/social_group/social_group.api.php, line 154
Hooks provided by the Social Group module.

Code

function hook_social_group_group_visibility_description_alter($key, &$description) {
  switch ($key) {
    case 'custom_role_1':
      $description = '<p><strong><svg class="icon-small"><use xlink:href="#icon-lock"></use></svg></strong>';
      $description .= '<strong>' . t('Custom role 1')
        ->render() . '</strong>';
      $description .= '-' . t('All users with this role can see it')
        ->render();
      $description .= '</p>';
      break;
    case 'custom_role_2':
      $description = '<p><strong><svg class="icon-small"><use xlink:href="#icon-community"></use></svg></strong>';
      $description .= '<strong>' . t('Custom role 2')
        ->render() . '</strong>';
      $description .= '-' . t('All users with this role can change it')
        ->render();
      $description .= '</p>';
      break;
  }
}