You are here

function og_vocab_form_taxonomy_overview_vocabularies_alter in OG Vocabulary 7

Implements hook_form_FORM-ID_alter().

Vocabularies overview.

File

./og_vocab.module, line 960
Give each group its own system controlled vocabularies.

Code

function og_vocab_form_taxonomy_overview_vocabularies_alter(&$form, $form_state) {
  if (!($context = og_vocab_is_group_admin_context())) {
    return;
  }
  $group_type = $context['group_type'];
  $gid = $context['gid'];
  $path_prefix = "group/{$group_type}/{$gid}/admin";
  foreach (array_keys($form) as $key) {
    if (!is_numeric($key)) {
      continue;
    }
    $ops = array(
      'edit',
      'list',
      'add',
    );
    foreach ($ops as $op) {
      $form[$key][$op]['#href'] = $path_prefix . str_replace('admin/structure', '', $form[$key][$op]['#href']);
    }
  }
}