migrate_materio.module 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. /**
  3. * @file
  4. * This is the file description for Migrate Materio module.
  5. *
  6. * In this more verbose, multi-line description, you can specify what this
  7. * file does exactly. Make sure to wrap your documentation in column 78 so
  8. * that the file can be displayed nicely in default-sized consoles.
  9. */
  10. define('MIG_MAT_SRC_DB', variable_get('migrate_materio_database', ''));
  11. define('MIG_MAT_SRC_DB_D6', variable_get('migrate_materio_database_drupal6', ''));
  12. /**
  13. * You must implement hook_migrate_api(), setting the API level to 2, for
  14. * your migration classes to be recognized by the Migrate module (for the 7.x-2.x branch).
  15. */
  16. function migrate_materio_migrate_api() {
  17. $api = array(
  18. 'api' => 2,
  19. );
  20. return $api;
  21. }
  22. /**
  23. * Implements hook_menu().
  24. */
  25. function migrate_materio_menu() {
  26. $items = array();
  27. $items['admin/config/development/migrate_materio'] = array(
  28. 'title' => 'Materio Migration Settings',
  29. 'page callback' => 'drupal_get_form',
  30. 'page arguments' => array('migrate_materio_settings'),
  31. 'access callback' => 'user_access',
  32. 'access arguments' => array('administer site configuration'),
  33. );
  34. return $items;
  35. }
  36. /**
  37. * Form to setting up the database name and migration file path for migration of data.
  38. */
  39. function migrate_materio_settings($form, &$form_state) {
  40. $form['migrate_materio_database'] = array(
  41. '#type' => 'textfield',
  42. '#title' => 'Database name',
  43. '#default_value' => variable_get('migrate_materio_database', ''),
  44. '#description' => t('Please enter the name of the database. Note that the database must be accessible by current website db user and must reside on the same db server.'),
  45. '#required' => TRUE,
  46. );
  47. $form['migrate_materio_database_drupal6'] = array(
  48. '#type' => 'textfield',
  49. '#title' => 'Drupal 6 Database name',
  50. '#default_value' => variable_get('migrate_materio_database_drupal6', ''),
  51. '#description' => t('Please enter the name of the drupal 6 database. Note that the database must be accessible by current website db user and must reside on the same db server.'),
  52. '#required' => TRUE,
  53. );
  54. // $form['redcat_migration_file_path'] = array(
  55. // '#type' => 'textfield',
  56. // '#title' => 'Migrated Files Path',
  57. // '#default_value' => variable_get('redcat_migration_file_path', '/Users/amodi/Sites/redcat.org/sites/redcat.org/files'),
  58. // '#description' => t('Please enter the full path to get to the home directory of the migrating site - the files will be found through the base'),
  59. // '#required' => TRUE,
  60. // );
  61. return system_settings_form($form);
  62. }