function og_subgroups_menu in Subgroups for Organic groups 5
Same name and namespace in other branches
- 5.4 og_subgroups.module \og_subgroups_menu()
- 5.3 og_subgroups.module \og_subgroups_menu()
- 6 og_subgroups.module \og_subgroups_menu()
Implementation of hook_menu().
File
- ./
og_subgroups.module, line 32 - Maintains subgroups hierarchy created by the orgainc groups module.
Code
function og_subgroups_menu($may_cache) {
$items = array();
if (!$may_cache) {
$items[] = array(
'path' => 'admin/og/subgroups',
'title' => t('Subgroups for organic groups configuration'),
'callback' => 'drupal_get_form',
'callback arguments' => array(
'og_subgroups_settings',
),
'access' => user_access('administer groups hierachy'),
'weight' => 1,
);
$arg0 = arg(0);
$arg1 = arg(1);
if ($arg0 == 'node' && is_numeric($arg1)) {
$node = node_load($arg1);
if (og_is_group_type($node->type)) {
$items[] = array(
'path' => 'node/' . arg(1) . '/og/subgroups',
'title' => t('Subgroups'),
'callback' => 'drupal_get_form',
'callback arguments' => array(
'og_subgroups_outline',
$arg1,
),
'access' => user_access('edit groups hierachy'),
'type' => MENU_LOCAL_TASK,
'weight' => 2,
);
}
}
}
return $items;
}