You are here

function domain_menu in Domain Access 6.2

Same name and namespace in other branches
  1. 5 domain.module \domain_menu()
  2. 7.3 domain.module \domain_menu()
  3. 7.2 domain.module \domain_menu()

Implement hook_menu()

File

./domain.module, line 164
Core module functions for the Domain Access suite.

Code

function domain_menu() {
  $items = array();
  $admin = user_access('administer domains');
  $items['admin/build/domain'] = array(
    'title' => 'Domains',
    'access arguments' => array(
      'administer domains',
    ),
    'page callback' => 'domain_view',
    'file' => 'domain.admin.inc',
    'description' => 'Settings for the Domain Access module.',
  );
  $items['admin/build/domain/view'] = array(
    'title' => 'Domain list',
    'access arguments' => array(
      'administer domains',
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'page callback' => 'domain_view',
    'file' => 'domain.admin.inc',
    'weight' => -10,
  );
  $items['admin/build/domain/settings'] = array(
    'title' => 'Settings',
    'access arguments' => array(
      'administer domains',
    ),
    'type' => MENU_LOCAL_TASK,
    'page callback' => 'domain_configure',
    'file' => 'domain.admin.inc',
    'weight' => -8,
  );
  $items['admin/build/domain/create'] = array(
    'title' => 'Create domain record',
    'access arguments' => array(
      'administer domains',
    ),
    'type' => MENU_LOCAL_TASK,
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'domain_form',
    ),
    'file' => 'domain.admin.inc',
    'weight' => -7,
  );
  $items['admin/build/domain/advanced'] = array(
    'title' => 'Node settings',
    'access arguments' => array(
      'administer domains',
    ),
    'type' => MENU_LOCAL_TASK,
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'domain_advanced_form',
    ),
    'file' => 'domain.admin.inc',
    'weight' => -6,
  );

  // Register the batch actions as menu callbacks
  $batch = module_invoke_all('domainbatch');
  if (!empty($batch)) {
    $items['admin/build/domain/batch'] = array(
      'title' => 'Batch updating',
      'access arguments' => array(
        'administer domains',
      ),
      'type' => MENU_LOCAL_TASK,
      'page callback' => 'domain_batch',
      'file' => 'domain.admin.inc',
      'weight' => -5,
    );

    // Get the submenu items
    foreach ($batch as $key => $value) {
      $items['admin/build/domain/batch/' . $key] = array(
        'title' => $value['#form']['#title'],
        'access arguments' => isset($value['#permission']) ? array(
          $value['#permission'],
        ) : array(
          'administer domains',
        ),
        'type' => MENU_CALLBACK,
        'page callback' => 'domain_batch',
        'page arguments' => array(
          $key,
        ),
        'file' => 'domain.admin.inc',
        'weight' => isset($value['#weight']) ? $value['#weight'] : 0,
      );
    }
  }
  $items['admin/build/domain/roles'] = array(
    'title' => 'User defaults',
    'access arguments' => array(
      'administer domains',
    ),
    'type' => MENU_LOCAL_TASK,
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'domain_roles_form',
    ),
    'file' => 'domain.admin.inc',
    'weight' => -4,
  );
  $items['admin/build/domain/edit/%domain'] = array(
    'title' => 'Edit domain record',
    'access arguments' => array(
      'administer domains',
    ),
    'type' => MENU_CALLBACK,
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'domain_form',
      4,
    ),
    'file' => 'domain.admin.inc',
  );
  $items['admin/build/domain/delete/%domain'] = array(
    'title' => 'Delete domain record',
    'access arguments' => array(
      'administer domains',
    ),
    'type' => MENU_CALLBACK,
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'domain_delete_form',
      4,
    ),
    'file' => 'domain.admin.inc',
  );
  return $items;
}