You are here

protected function WordPressMigrateWizard::contentSelectForm in WordPress Migrate 7.2

File

./wordpress_migrate.migrate.inc, line 347

Class

WordPressMigrateWizard

Code

protected function contentSelectForm(&$form_state) {
  $form['overview'] = array(
    '#prefix' => '<p>',
    '#markup' => t('WordPress blogs contain two primary kinds of content,
        blog posts and pages. Here you may choose what types of Drupal nodes
        to create from each of those content types, or omit one or both from
        the import entirely.'),
    '#suffix' => '</p>',
  );

  // Get destination node type(s)
  $node_types = node_type_get_types();
  $options = array(
    '' => t('Do not import'),
  );
  foreach ($node_types as $node_type => $info) {
    $options[$node_type] = $info->name;
  }
  if (isset($options['blog'])) {
    $default = 'blog';
  }
  else {
    $default = '';
  }
  $form['blog_post_type'] = array(
    '#type' => 'select',
    '#title' => t('Import WordPress blog posts as'),
    '#default_value' => $default,
    '#options' => $options,
    '#description' => t(''),
  );
  if (isset($options['page'])) {
    $default = 'page';
  }
  else {
    $default = '';
  }
  $form['page_type'] = array(
    '#type' => 'select',
    '#title' => t('Import WordPress pages as'),
    '#default_value' => $default,
    '#options' => $options,
    '#description' => t(''),
  );
  return $form;
}