function content_copy_import_form in Content Construction Kit (CCK) 6
Same name and namespace in other branches
- 5 content_copy.module \content_copy_import_form()
- 6.3 modules/content_copy/content_copy.module \content_copy_import_form()
- 6.2 modules/content_copy/content_copy.module \content_copy_import_form()
A form to import formatted text created with export.
1 string reference to 'content_copy_import_form'
- content_copy_menu in modules/
content_copy/ content_copy.module - Implementation of hook_menu().
File
- modules/
content_copy/ content_copy.module, line 222 - Adds capability to import/export CCK field data definitions.
Code
function content_copy_import_form(&$form_state, $type_name = '') {
include_once './' . drupal_get_path('module', 'content') . '/includes/content.admin.inc';
include_once './' . drupal_get_path('module', 'node') . '/content_types.inc';
$form['#prefix'] = t('This form will import field definitions exported from another content type or another database.<br/>Note that fields cannot be duplicated within the same content type, so imported fields will be added only if they do not already exist in the selected type.');
$form['type_name'] = array(
'#type' => 'select',
'#options' => array(
'<create>' => t('<Create>'),
) + node_get_types('names'),
'#default_value' => $type_name,
'#title' => t('Content type'),
'#description' => t('Select the content type to import these fields into.<br/>Select <Create> to create a new content type to contain the fields.'),
);
$form['macro'] = array(
'#type' => 'textarea',
'#rows' => 40,
'#title' => t('Import data'),
'#required' => TRUE,
'#description' => t('Paste the text created by a content export into this field.'),
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Import'),
);
return $form;
}