You are here

function feed_import_settings_form in Feed Import 7.2

Same name and namespace in other branches
  1. 7 feed_import.module \feed_import_settings_form()

Settings form

1 string reference to 'feed_import_settings_form'
feed_import_menu in ./feed_import.module
Implements hook_menu().

File

./feed_import.module, line 497
User interface, cron functions for feed_import module

Code

function feed_import_settings_form($form, &$form_state) {
  $form['feed_import_use_cron'] = array(
    '#type' => 'checkbox',
    '#default_value' => variable_get('feed_import_use_cron', 0),
    '#title' => t('Cron import'),
    '#description' => t('Run import for enabled feeds at cron'),
  );
  $form['container'] = array(
    '#type' => 'fieldset',
    '#states' => array(
      'invisible' => array(
        'input[name="feed_import_use_cron"]' => array(
          'checked' => FALSE,
        ),
      ),
    ),
  );
  $form['container']['feed_import_let_overlap'] = array(
    '#type' => 'checkbox',
    '#default_value' => variable_get('feed_import_let_overlap', 0),
    '#title' => t('Allow import overlap'),
    '#description' => t('This is not indicated for nodes.'),
  );
  $form['container']['feed_import_time_settings'] = array(
    '#type' => 'radios',
    '#options' => array(
      t('From time to time'),
      t('Specified time interval'),
    ),
    '#default_value' => variable_get('feed_import_time_settings', 0),
    '#title' => t('When feeds can be imported'),
  );
  $form['container']['feed_import_time_between_imports'] = array(
    '#type' => 'textfield',
    '#default_value' => variable_get('feed_import_time_between_imports', 3600),
    '#title' => t('Time between two imports at cron (seconds)'),
    '#description' => t('Time betwen two cron imports.'),
    '#states' => array(
      'visible' => array(
        'input[name="feed_import_time_settings"]' => array(
          'value' => 0,
        ),
      ),
    ),
  );
  $form['container']['feed_import_interval_start'] = array(
    '#type' => 'textfield',
    '#default_value' => variable_get('feed_import_interval_start', '00:00'),
    '#title' => t('Start time'),
    '#description' => t('Format is hh:mm.'),
    '#states' => array(
      'visible' => array(
        'input[name="feed_import_time_settings"]' => array(
          'value' => 1,
        ),
      ),
    ),
  );
  $form['container']['feed_import_interval_stop'] = array(
    '#type' => 'textfield',
    '#default_value' => variable_get('feed_import_interval_stop', '24:00'),
    '#title' => t('End time'),
    '#description' => t('Format is hh:mm. This must be greater than start time.'),
    '#states' => array(
      'visible' => array(
        'input[name="feed_import_time_settings"]' => array(
          'value' => 1,
        ),
      ),
    ),
  );
  $form['feed_import_delete_items_per_cron'] = array(
    '#type' => 'textfield',
    '#default_value' => variable_get('feed_import_delete_items_per_cron', 300),
    '#title' => t('Expired items delete per cron'),
    '#description' => t('How many expired items to delete when cron runs.'),
  );
  $form['feed_import_insert_hashes_chunk'] = array(
    '#type' => 'textfield',
    '#default_value' => variable_get('feed_import_insert_hashes_chunk', 500),
    '#title' => t('Chunk size for inserting hashes'),
    '#description' => t('How many items to insert at once'),
  );
  $form['feed_import_update_ids_chunk'] = array(
    '#type' => 'textfield',
    '#default_value' => variable_get('feed_import_update_ids_chunk', 1000),
    '#title' => t('Chunk size for updating expire time'),
    '#description' => t('How many items to update at once'),
  );
  $form['feed_import_hash_property'] = array(
    '#type' => 'textfield',
    '#default_value' => variable_get('feed_import_hash_property', '_feed_item_hash'),
    '#title' => t('Tomporary property which holds item hash'),
    '#description' => t('Change this only if you already have a property named like this.'),
  );
  $form['feed_import_field_param_name'] = array(
    '#type' => 'textfield',
    '#default_value' => variable_get('feed_import_field_param_name', '[field]'),
    '#title' => t('Param name for filters'),
    '#description' => t('Enter this when using filters and you want to send extracted field value as argument.'),
  );
  return system_settings_form($form);
}