You are here

function node_import_settings_form in Node import 6

General settings for node_import module.

1 string reference to 'node_import_settings_form'
node_import_menu in ./node_import.module
Implementation of hook_menu().

File

./node_import.admin.inc, line 1058

Code

function node_import_settings_form(&$form_state) {
  $form = array();
  $form['node_import:directory'] = array(
    '#type' => 'textfield',
    '#title' => t('Import directory'),
    '#description' => t('Enter the directory, relative to %file-directory-path, where the files to import are stored. If FTP is enabled, this is also the location where users can upload files. Default value: %default-directory.', array(
      '%file-directory-path' => variable_get('file_directory_path', 'sites/default/files'),
      '%default-directory' => 'imports',
    )),
    '#default_value' => variable_get('node_import:directory', 'imports'),
    '#field_prefix' => variable_get('file_directory_path', 'sites/default/files') . '/',
    '#field_suffix' => '/',
  );
  if (function_exists('theme_token_help')) {
    $form['node_import:directory']['#description'] .= theme('token_help', 'user');
  }
  $form['ftp'] = array(
    '#type' => 'fieldset',
    '#title' => t('FTP settings'),
  );
  $form['ftp']['node_import:ftp:enabled'] = array(
    '#type' => 'checkbox',
    '#title' => t('Allow FTP uploads'),
    '#description' => t('If checked users can upload files to the import directory by using FTP (or other means) in addition to uploading files using the form. If unsure, uncheck this option.'),
    '#default_value' => variable_get('node_import:ftp:enabled', 0),
  );
  $form['ftp']['node_import:ftp:user'] = array(
    '#type' => 'textfield',
    '#title' => t('File owner'),
    '#description' => t('Files uploaded by FTP are assigned "ownership" to this user. Users will only be allowed to use files they have uploaded themselves and files "owned" by anonymous. If you leave this field blank, all files uploaded by FTP will be "owned" by anonymous and so all users will see those files as being available for them. If you enter a username here, files that are uploaded using FTP will be "owned" by that user and only that user will be able to see those uploaded files (in addition to the ones the user uploaded using the form). If unsure, leave this blank.'),
    '#default_value' => variable_get('node_import:ftp:user', ''),
    '#autocomplete_path' => 'user/autocomplete',
  );
  $form['ftp']['node_import:ftp:extensions'] = array(
    '#type' => 'textfield',
    '#title' => t('Allowed extensions'),
    '#description' => t('Enter a space-delimited list of allowed file extensions. Only files uploaded with these extensions are allowed, other files will be ignored. Default value: %default-extensions.', array(
      '%default-extensions' => 'csv tsv txt',
    )),
    '#default_value' => variable_get('node_import:ftp:extensions', 'csv tsv txt'),
  );
  return system_settings_form($form);
}