You are here

function hook_group_filters in Group 7

Add filters to the group overview page.

This hook is used to provide additional filters to the group overview page found at admin/group. The filters should always be something that can be used in a select element.

Keep in mind that this only adds the filters to the user interface. To actually have them do something, you need to write a hook_query_TAG_alter() implementation for the 'group_overview' tag.

See also

group_filters_form()

group_query_group_overview_alter()

1 function implements hook_group_filters()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

group_group_filters in ./group.group.inc
Implements hook_group_filters().
2 invocations of hook_group_filters()
group_filters_form in admin/group.inc
Builds the group overview filters.
group_filters_form_submit in admin/group.inc
Filter form submit callback.

File

./group.api.php, line 124
Hooks provided by the Group module.

Code

function hook_group_filters() {

  // Get a list of all group types.
  $group_types = array();
  foreach (group_types() as $name => $group_type) {
    $group_types[$name] = $group_type
      ->label();
  }

  // Build a group type filter.
  $filters['type'] = array(
    'title' => t('Group type'),
    'options' => array(
      '[any]' => t('any'),
    ) + $group_types,
  );
  return $filters;
}