You are here

function og_vocab_menu in OG Vocabulary 6

Same name and namespace in other branches
  1. 5 og_vocab.module \og_vocab_menu()
  2. 7 og_vocab.module \og_vocab_menu()

Implementation of hook_menu().

File

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

Code

function og_vocab_menu() {

  // Taxonomy tab that will display the vocabularies associated with the group.
  $items['node/%node/og/vocab'] = array(
    'title' => 'Taxonomy',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'og_vocab_admin_overview_vocabularies',
      1,
    ),
    'access callback' => 'og_vocab_determine_access',
    'access arguments' => array(
      1,
      'administer own group vocabulary',
    ),
    'weight' => 6,
    'type' => MENU_LOCAL_TASK,
    'file' => 'og_vocab.admin.inc',
  );

  // Create a new vocabulary to be associated with the group.
  $items['node/%node/og/vocab/add/vocabulary'] = array(
    'title' => 'Create vocabulary',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'taxonomy_form_vocabulary',
    ),
    'access callback' => 'og_vocab_determine_access',
    'access arguments' => array(
      1,
      'add own group vocabulary',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'taxonomy.admin.inc',
    'file path' => drupal_get_path('module', 'taxonomy'),
  );

  // Edit an existing vocabulary currently associated with the group.
  $items['node/%node/og/vocab/edit/vocabulary/%taxonomy_vocabulary'] = array(
    'title' => 'Edit vocabulary',
    'page callback' => 'taxonomy_admin_vocabulary_edit',
    'page arguments' => array(
      6,
    ),
    'access callback' => 'og_vocab_determine_access',
    'access arguments' => array(
      1,
      'edit own group vocabulary',
      6,
    ),
    'type' => MENU_CALLBACK,
    'file' => 'taxonomy.admin.inc',
    'file path' => drupal_get_path('module', 'taxonomy'),
  );

  // List the terms associated with the vocabulary.
  $items['node/%node/og/vocab/terms/%taxonomy_vocabulary'] = array(
    'title' => 'List Terms',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'taxonomy_overview_terms',
      5,
    ),
    'access callback' => 'og_vocab_determine_access',
    'access arguments' => array(
      1,
      'administer own group vocabulary',
      5,
    ),
    'type' => MENU_CALLBACK,
    'weight' => -10,
    'file' => 'taxonomy.admin.inc',
    'file path' => drupal_get_path('module', 'taxonomy'),
  );

  // List the terms associated with the vocabulary inherits properties
  // from above.
  $items['node/%node/og/vocab/terms/%taxonomy_vocabulary/list'] = array(
    'title' => 'List',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );

  // Create a new term and associate it with the vocabulary.
  $items['node/%node/og/vocab/terms/%taxonomy_vocabulary/add_term'] = array(
    'title' => 'Add term',
    'page callback' => 'taxonomy_add_term_page',
    'page arguments' => array(
      5,
    ),
    'access callback' => 'og_vocab_determine_access',
    'access arguments' => array(
      1,
      'edit own group term',
      5,
    ),
    'type' => MENU_LOCAL_TASK,
    'file' => 'taxonomy.admin.inc',
    'file path' => drupal_get_path('module', 'taxonomy'),
  );

  // Edit term.
  $items['node/%node/og/vocab/terms/edit/%'] = array(
    'title' => 'Edit term',
    'page callback' => 'og_vocab_taxonomy_admin_term_edit',
    'page arguments' => array(
      6,
    ),
    'access callback' => 'og_vocab_determine_access',
    'access arguments' => array(
      1,
      'edit own group term',
      6,
      'term',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'taxonomy.admin.inc',
    'file path' => drupal_get_path('module', 'taxonomy'),
  );
  return $items;
}