You are here

function oa_core_menu in Open Atrium Core 7.2

Implements hook_menu().

File

./oa_core.module, line 93

Code

function oa_core_menu() {

  // Add an administration page for Open Atrium
  $items['admin/openatrium'] = array(
    'title' => 'Open Atrium',
    'description' => 'Administer Open Atrium.',
    'weight' => 0,
    '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/openatrium/section-templates'] = array(
    'title' => 'Section Templates',
    'description' => 'Configure panelizer section templates',
    'weight' => 0,
    'access arguments' => array(
      'administer site configuration',
    ),
    'page callback' => 'oa_core_section_template',
  );
  $items['admin/openatrium/space-templates'] = array(
    'title' => 'Space Templates',
    'description' => 'Configure panelizer space templates',
    'weight' => 0,
    'access arguments' => array(
      'administer site configuration',
    ),
    'page callback' => 'oa_core_space_template',
  );
  $items['admin/openatrium/setting'] = array(
    //changing from /settings since Drupal not refreshing parent of existing items
    'title' => 'Config',
    'description' => 'Configuration settings related to Open Atrium',
    'weight' => -1,
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'oa_core_configure_form',
    ),
    'access arguments' => array(
      'administer site configuration',
    ),
  );
  $items['admin/openatrium/groups'] = array(
    'title' => 'Groups',
    'description' => 'Configure Open Atrium Groups',
    'weight' => 0,
    'access arguments' => array(
      'administer site configuration',
    ),
    'page callback' => 'oa_core_show_groups',
  );
  $items['group/%/%/remove/%/%'] = array(
    'title' => 'Remove member',
    'type' => MENU_CALLBACK,
    'page callback' => 'oa_core_remove_member',
    'page arguments' => array(
      1,
      2,
      4,
      5,
    ),
    'access callback' => 'og_ui_user_access_group',
    'access arguments' => array(
      'manage members',
      1,
      2,
    ),
  );
  $items['group/%/%/block/%'] = array(
    'title' => 'Block member',
    'type' => MENU_CALLBACK,
    'page callback' => 'oa_core_block_member',
    'page arguments' => array(
      1,
      2,
      4,
    ),
    'access callback' => 'og_ui_user_access_group',
    'access arguments' => array(
      'manage members',
      1,
      2,
    ),
  );
  $items['group/%/%/add-member/%'] = array(
    'title' => 'Add member',
    'type' => MENU_CALLBACK,
    'page callback' => 'oa_core_add_member',
    'page arguments' => array(
      1,
      2,
      4,
    ),
    'access callback' => 'user_is_logged_in',
  );
  $items['group/%/%/add-admin/%'] = array(
    'title' => 'Add Admin',
    'type' => MENU_CALLBACK,
    'page callback' => 'oa_core_add_admin',
    'page arguments' => array(
      1,
      2,
      4,
    ),
    'access callback' => 'og_ui_user_access_group',
    'access arguments' => array(
      'manage members',
      1,
      2,
    ),
  );
  $items['group/%/%/remove-admin/%'] = array(
    'title' => 'Add Admin',
    'type' => MENU_CALLBACK,
    'page callback' => 'oa_core_remove_admin',
    'page arguments' => array(
      1,
      2,
      4,
    ),
    'access callback' => 'og_ui_user_access_group',
    'access arguments' => array(
      'manage members',
      1,
      2,
    ),
  );
  $items['node/add/oa-space/%'] = array(
    'title' => 'Create Space',
    'page callback' => 'oa_core_create_space_page_callback',
    'page arguments' => array(
      OA_SPACE_TYPE,
      3,
    ),
    'access callback' => 'oa_core_create_space_access',
    'access arguments' => array(
      3,
    ),
    'type' => MENU_CALLBACK,
  );
  if (module_exists('devel')) {
    $items['oa-core/system-elements'] = array(
      'access arguments' => array(
        'access devel information',
      ),
      'page callback' => 'oa_core_element_test_page',
      'type' => MENU_CALLBACK,
      'file' => 'oa_core.fields.inc',
      'file path' => drupal_get_path('module', 'oa_core') . '/includes',
    );
  }

  // Two ajax path to return group options for select2widget.
  // One for pane (with Current Group) option and one for just exposed.
  $items['oacoreselect2widget/ajax/%/%/%/%'] = array(
    'title' => 'Ajax callback',
    'page callback' => 'oa_core_select2widget_ajax_callback',
    'page arguments' => array(
      FALSE,
      2,
      3,
      4,
      5,
    ),
    'access callback' => 'select2widget_autocomplete_access',
    'access arguments' => array(
      2,
      3,
      4,
      5,
    ),
    'type' => MENU_CALLBACK,
  );
  $items['oacoreselect2widgetpanes/ajax/%/%/%/%'] = array(
    'title' => 'Ajax callback',
    'page callback' => 'oa_core_select2widget_ajax_callback',
    'page arguments' => array(
      TRUE,
      2,
      3,
      4,
      5,
    ),
    'access callback' => 'select2widget_autocomplete_access',
    'access arguments' => array(
      2,
      3,
      4,
      5,
    ),
    'type' => MENU_CALLBACK,
  );
  return $items;
}