You are here

migrate_ui.module in Migrate 6.2

Same filename and directory in other branches
  1. 7.2 migrate_ui/migrate_ui.module

File

migrate_ui/migrate_ui.module
View source
<?php

define('MIGRATE_ACCESS_BASIC', 'migration information');
function migrate_ui_help($path, $arg) {
  switch ($path) {
    case 'admin/migrate':
      return t('The current status of each migration defined in this system. Click on a migration name for details on its configuration.');
  }
}

/**
 * Implementation of hook_perm().
 */
function migrate_ui_perm() {
  return array(
    MIGRATE_ACCESS_BASIC,
  );
}

/**
 * Implementation of hook_menu().
 */
function migrate_menu() {
  $items = array();
  $items['admin/content/migrate'] = array(
    'title' => 'Migrate',
    'type' => MENU_LOCAL_TASK | MENU_NORMAL_ITEM,
    'description' => 'Monitor the creation of Drupal content from source data',
    'page callback' => 'migrate_ui_dashboard',
    'access arguments' => array(
      MIGRATE_ACCESS_BASIC,
    ),
    'file' => 'migrate_ui/migrate_ui.pages.inc',
  );
  $items['admin/content/migrate/dashboard'] = array(
    'title' => 'Migrate',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items['admin/content/migrate/registration'] = array(
    'title' => 'Registration',
    'type' => MENU_LOCAL_TASK,
    'description' => 'Configure class registration',
    'page callback' => 'migrate_ui_registration',
    'access arguments' => array(
      MIGRATE_ACCESS_BASIC,
    ),
    'file' => 'migrate_ui/migrate_ui.pages.inc',
    'weight' => 5,
  );
  $items['admin/content/migrate/handlers'] = array(
    'title' => 'Handlers',
    'type' => MENU_LOCAL_TASK,
    'description' => 'Configure migration handlers',
    'page callback' => 'migrate_ui_handlers',
    'access arguments' => array(
      MIGRATE_ACCESS_BASIC,
    ),
    'file' => 'migrate_ui/migrate_ui.pages.inc',
    'weight' => 10,
  );
  $items['admin/content/migrate/messages/%migration'] = array(
    'title callback' => 'migration_title',
    'title arguments' => array(
      4,
    ),
    'description' => 'View messages from a migration',
    'page callback' => 'migrate_ui_messages',
    'page arguments' => array(
      4,
    ),
    'access arguments' => array(
      MIGRATE_ACCESS_BASIC,
    ),
    'file' => 'migrate_ui/migrate_ui.pages.inc',
  );
  $items['admin/content/migrate/%migration'] = array(
    'title callback' => 'migration_title',
    'title arguments' => array(
      3,
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'migrate_migration_info',
      3,
    ),
    'access arguments' => array(
      MIGRATE_ACCESS_BASIC,
    ),
    'file' => 'migrate_ui/migrate_ui.pages.inc',
  );
  if (FALSE) {

    // Not working yet
    migrate_ui_menu_add($items);
  }
  return $items;
}

// A menu load callback.
function migration_load($machine_name) {
  if ($machine_name) {
    return Migration::getInstance($machine_name);
  }
}
function migration_title($migration) {
  if (is_string($migration)) {
    $migration = migration_load($migration);
  }
  return $migration
    ->getMachineName();
}

Functions

Namesort descending Description
migrate_menu Implementation of hook_menu().
migrate_ui_help
migrate_ui_perm Implementation of hook_perm().
migration_load
migration_title

Constants