You are here

function variable_realm_admin_menu in Variable 7

Implements hook_menu().

File

variable_realm_admin/variable_realm_admin.module, line 10
Variable Realms Admin module

Code

function variable_realm_admin_menu() {
  $items['admin/config/system/variable/realm'] = array(
    'title' => 'Realms',
    'description' => 'Configure realms.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'variable_realm_admin_realm_overview',
    ),
    'file' => 'variable_realm_admin.pages.inc',
    'access arguments' => array(
      'administer site configuration',
    ),
    'type' => MENU_LOCAL_TASK,
  );
  $items['admin/config/system/variable/realm/overview'] = array(
    'title' => 'Overview',
    'description' => 'Configure realms.',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $weight = 0;
  foreach (variable_realm_list() as $realm => $title) {
    $items['admin/config/system/variable/realm/' . $realm] = array(
      'title callback' => 'variable_realm_admin_realm_title',
      'title arguments' => array(
        $realm,
      ),
      'description' => 'Configure realm variables.',
      'page callback' => 'variable_realm_admin_realm_info',
      'page arguments' => array(
        $realm,
      ),
      'access callback' => 'variable_realm_admin_access',
      'access arguments' => array(
        $realm,
      ),
      'file' => 'variable_realm_admin.pages.inc',
      'type' => MENU_LOCAL_TASK,
      'weight' => $weight++,
    );
  }
  $items['admin/config/system/variable/realm/%/edit'] = array(
    'title' => 'Edit',
    'description' => 'Edit realm variables.',
    'page callback' => 'variable_realm_admin_realm_edit',
    'page arguments' => array(
      5,
    ),
    'access callback' => 'variable_realm_admin_access',
    'access arguments' => array(
      5,
      'select',
    ),
    'file' => 'variable_realm_admin.pages.inc',
  );
  $items['admin/config/system/variable/realm/%/configure'] = array(
    'title' => 'Configure',
    'description' => 'Configure realm variables.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'variable_realm_select_variables_form',
      5,
    ),
    'access callback' => 'variable_realm_admin_access',
    'access arguments' => array(
      5,
      'select',
    ),
    'file' => 'variable_realm.form.inc',
    'file path' => drupal_get_path('module', 'variable_realm'),
  );
  return $items;
}