You are here

function patterns_import_file in Patterns 6

Same name and namespace in other branches
  1. 5 patterns.module \patterns_import_file()
  2. 6.2 patterns.module \patterns_import_file()
  3. 7.2 includes/forms/import.inc \patterns_import_file()
  4. 7 includes/forms/import.inc \patterns_import_file()

Display the import pattern file form

1 string reference to 'patterns_import_file'
patterns_menu in ./patterns.module
Implementation of hook_menu().

File

./patterns.module, line 521
Enables extremely simple adding/removing features to your site with minimal to no configuration

Code

function patterns_import_file(&$form_state) {
  if (empty($form_state['post'])) {
    drupal_set_message(t('Import feature currently supports only XML file format.'), 'warning');
  }
  $form['#attributes']['enctype'] = 'multipart/form-data';
  $form['xmlfile'] = array(
    '#type' => 'file',
    '#title' => t('Upload Pattern File'),
    '#description' => t('Imported patterns are not executed until you run them manually.'),
    '#size' => 48,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Import'),
  );
  $form['#validate'][] = 'patterns_import_validate';
  $form['#submit'][] = 'patterns_import_submit';
  return $form;
}