You are here

function og_menu in Organic groups 6

Same name and namespace in other branches
  1. 5.8 og.module \og_menu()
  2. 5 og.module \og_menu()
  3. 5.2 og.module \og_menu()
  4. 5.3 og.module \og_menu()
  5. 5.7 og.module \og_menu()
  6. 6.2 og.module \og_menu()
  7. 7.2 og.module \og_menu()
  8. 7 og.module \og_menu()

File

./og.module, line 40

Code

function og_menu() {

  // Anon users should be able to get to the join page
  $items['og/subscribe/%node'] = array(
    'type' => MENU_CALLBACK,
    'page callback' => 'og_subscribe',
    'page arguments' => array(
      2,
    ),
    'access callback' => 'node_access',
    'access arguments' => array(
      'view',
      2,
    ),
    'title' => 'Join group',
  );
  $items['og/opml'] = array(
    'type' => MENU_CALLBACK,
    'page callback' => 'og_opml',
    'access callback' => 'user_is_logged_in',
    'title' => 'OPML',
  );
  $items['og/unsubscribe/%node/%user'] = array(
    'type' => MENU_CALLBACK,
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'og_confirm_unsubscribe',
      2,
      3,
    ),
    'access callback' => 'og_menu_access_unsubscribe',
    'access arguments' => array(
      2,
      3,
    ),
    'title' => 'Leave group',
  );
  $items['og/approve/%node/%user/%'] = array(
    'type' => MENU_CALLBACK,
    'page callback' => 'og_approve',
    'page arguments' => array(
      2,
      3,
      4,
    ),
    'access callback' => 'og_is_group_admin',
    'access arguments' => array(
      2,
    ),
    'title' => 'Approve membership request',
  );
  $items['og/deny/%node/%user/%'] = array(
    'type' => MENU_CALLBACK,
    'page callback' => 'og_deny',
    'page arguments' => array(
      2,
      3,
      4,
    ),
    'access callback' => 'og_is_group_admin',
    'access arguments' => array(
      2,
    ),
    'title' => 'Deny membership request',
  );
  $items['og/create_admin/%node/%user'] = array(
    'type' => MENU_CALLBACK,
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'og_create_admin_confirm',
      2,
      3,
    ),
    'access callback' => 'og_is_group_admin',
    'access arguments' => array(
      2,
    ),
    'title' => 'Create group administrator',
  );
  $items['og/delete_admin/%node/%user'] = array(
    'type' => MENU_CALLBACK,
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'og_remove_admin_confirm',
      2,
      3,
    ),
    'access callback' => 'og_is_group_admin',
    'access arguments' => array(
      2,
    ),
    'title' => 'Delete group administrator',
  );

  // members only and group may not be invite-only or closed
  $items['og/invite/%node'] = array(
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'og_invite_form',
      2,
    ),
    'access callback' => 'og_menu_access_invite',
    'access arguments' => array(
      2,
    ),
    'title' => 'Send invitation',
    'type' => MENU_CALLBACK,
  );
  $items["og/manage/%node"] = array(
    'page callback' => 'og_manage',
    'page arguments' => array(
      2,
    ),
    'access callback' => 'og_is_group_member',
    'access arguments' => array(
      2,
      FALSE,
    ),
    'title' => 'Manage membership',
    'type' => MENU_CALLBACK,
  );
  $items['og/activity'] = array(
    'title' => 'Group activity',
    'page callback' => 'og_page_activity',
    'access arguments' => array(
      'administer organic groups',
    ),
    'weight' => 4,
    'type' => MENU_LOCAL_TASK,
  );
  $items['admin/og'] = array(
    'title' => 'Organic groups',
    'description' => 'Administer the suite of Organic groups modules.',
    'position' => 'right',
    'weight' => -5,
    'page callback' => 'system_admin_menu_block_page',
    'access arguments' => array(
      'administer site configuration',
    ),
    'file' => 'system.admin.inc',
    'file path' => drupal_get_path('module', 'system'),
  );
  $items['admin/og/og'] = array(
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'og_admin_settings',
    ),
    'title' => 'Organic groups configuration',
    'access arguments' => array(
      'administer site configuration',
    ),
    'description' => 'Configure the main Organic groups module (og).',
    'file' => 'og.admin.inc',
    'file path' => drupal_get_path('module', 'og') . '/includes',
    'weight' => -5,
  );

  // group admin only
  $items['og/users/%node/add_user'] = array(
    'page callback' => 'drupal_get_form',
    'title' => 'Add members',
    'page arguments' => array(
      'og_add_users',
      2,
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 5,
    'access callback' => 'og_is_group_admin',
    'access arguments' => array(
      2,
    ),
  );

  // Broadcast tab on group node.
  $items['node/%node/broadcast'] = array(
    'title' => 'Broadcast',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'og_broadcast_form',
      1,
    ),
    'access callback' => 'og_broadcast_access',
    'access arguments' => array(
      1,
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 7,
  );
  return $items;
}