You are here

function domain_menu in Domain Access 7.3

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

Implements hook_menu().

File

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

Code

function domain_menu() {
  $items = array();
  $admin = user_access('administer domains');
  $items['admin/structure/domain'] = array(
    'title' => 'Domains',
    'access arguments' => array(
      'administer domains',
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'domain_overview_form',
    ),
    'file' => 'domain.admin.inc',
    'description' => 'Manage and configure domains.',
  );
  $items['admin/structure/domain/view'] = array(
    'title' => 'Domain list',
    'access arguments' => array(
      'administer domains',
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'domain_overview_form',
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'file' => 'domain.admin.inc',
    'description' => 'View domains for the site.',
    'weight' => -50,
  );
  $items['admin/structure/domain/settings'] = array(
    'title' => 'Settings',
    'access arguments' => array(
      'administer domains',
    ),
    'type' => MENU_LOCAL_TASK,
    'page callback' => 'domain_configure',
    'file' => 'domain.admin.inc',
    'description' => 'Configure Domain Access settings.',
    'weight' => -20,
  );
  $items['admin/structure/domain/create'] = array(
    'title' => 'Create domain',
    'access arguments' => array(
      'administer domains',
    ),
    'type' => MENU_LOCAL_ACTION,
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'domain_form',
    ),
    'file' => 'domain.admin.inc',
    'description' => 'Create new domain record.',
  );

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

    // Get the submenu items
    foreach ($batch as $key => $value) {
      $items['admin/structure/domain/batch/' . $key] = array(
        'title' => $value['#form']['#title'],
        'access arguments' => isset($value['#permission']) ? array(
          $value['#permission'],
        ) : array(
          'administer domains',
        ),
        'type' => MENU_VISIBLE_IN_BREADCRUMB,
        'page callback' => 'domain_batch',
        'page arguments' => array(
          $key,
        ),
        'file' => 'domain.admin.inc',
        'description' => isset($value['#description']) ? $value['#description'] : '',
        'weight' => isset($value['#weight']) ? $value['#weight'] : 0,
      );
    }
  }
  $items['admin/structure/domain/nodes'] = array(
    'title' => 'Content defaults',
    'access arguments' => array(
      'administer domains',
    ),
    'type' => MENU_LOCAL_TASK,
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'domain_nodes_form',
    ),
    'file' => 'domain.admin.inc',
    'description' => 'Default domain settings for content.',
    'weight' => -10,
  );
  $items['admin/structure/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',
    'description' => 'Default domain settings for users.',
    'weight' => -5,
  );
  $items['admin/structure/domain/view/%domain'] = array(
    'title' => 'View',
    'title callback' => 'domain_title',
    'title arguments' => array(
      4,
    ),
    'access arguments' => array(
      'administer domains',
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'domain_form',
      4,
    ),
    'description' => 'Edit domain record.',
    'file' => 'domain.admin.inc',
    'weight' => -10,
  );
  $items['admin/structure/domain/view/%domain/edit'] = array(
    'title' => 'Edit',
    'access arguments' => array(
      'administer domains',
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items['admin/structure/domain/view/%domain/delete'] = array(
    'title' => 'Delete',
    'access arguments' => array(
      'administer domains',
    ),
    'type' => MENU_LOCAL_TASK,
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'domain_delete_form',
      4,
    ),
    'description' => 'Delete domain record.',
    'file' => 'domain.admin.inc',
    'weight' => 50,
  );
  $items['admin/structure/domain/repair'] = array(
    'title' => 'Domain update database',
    'access arguments' => array(
      'administer domains',
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'domain_repair_form',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'domain.admin.inc',
  );
  return $items;
}