function hook_group_operation_links in Group 7
Add group operation links.
This hook enables modules to inject custom operations into the operations column of the table found at admin/group by associating a callback function with the operation, which is called when the form is submitted.
The callback function receives the Group of the table row and should return an array of links to display in the operations column.
Parameters
Group $group: The group to format links for.
Return value
array An array of links, declared as in theme_links(). At the very least, the 'title' and 'href' keys should be defined.
See also
1 function implements hook_group_operation_links()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- group_group_operation_links in ./
group.group.inc - Implements hook_group_operation_links().
1 invocation of hook_group_operation_links()
- group_groups_form in admin/
group.inc - Builds the group overview table.
File
- ./
group.api.php, line 216 - Hooks provided by the Group module.
Code
function hook_group_operation_links(Group $group) {
$operations = array();
// Add an 'edit' link if available.
if (group_access('update', $group)) {
$operations['edit'] = array(
'title' => t('edit'),
'href' => "group/{$group->gid}/edit",
);
}
// Add a 'delete' link if available.
if (group_access('delete', $group)) {
$operations['delete'] = array(
'title' => t('delete'),
'href' => "group/{$group->gid}/delete",
);
}
return $operations;
}