You are here

function feedapi_feedapi_settings_form in FeedAPI 6

Same name and namespace in other branches
  1. 5 feedapi.module \feedapi_feedapi_settings_form()

Implementation of hook_feedapi_settings_form().

File

./feedapi.module, line 651
Handle the submodules (for feed and item processing) Provide a basic management of feeds

Code

function feedapi_feedapi_settings_form($type) {
  if ($type == 'general') {
    $form['refresh_on_create'] = array(
      '#type' => 'checkbox',
      '#title' => t('Refresh feed on creation'),
      '#description' => t('If checked, feed items will be processed immediately after a feed is created.'),
      '#default_value' => 0,
    );
    $form['update_existing'] = array(
      '#type' => 'checkbox',
      '#title' => t('Update existing feed items'),
      '#description' => t('If checked, existing feed items will be updated when feed is refreshed.'),
      '#default_value' => 1,
    );
    $period = array();
    $period[FEEDAPI_CRON_ALWAYS_REFRESH] = t('As often as possible');
    $period += drupal_map_assoc(array(
      900,
      1800,
      3600,
      10800,
      21600,
      32400,
      43200,
      86400,
      172800,
      259200,
      604800,
      1209600,
      2419200,
      3628800,
      4838400,
      7257600,
      15724800,
      31536000,
    ), 'format_interval');
    $period[FEEDAPI_CRON_NEVER_REFRESH] = t('Never refresh');
    $form['refresh_time'] = array(
      '#type' => 'select',
      '#title' => t('Minimum refresh period'),
      '#description' => t('Select the minimum time that should elapse between two refreshes of the same feed. For news feeds, don\'t go under 30 minutes. Note that FeedAPI cannot guarantee that a feed will be refreshed at the rate of the selected time. The actual refresh rate depends on many factors such as number of feeds in system and your hardware.'),
      '#options' => $period,
      '#default_value' => FEEDAPI_CRON_DEFAULT_REFRESH_TIME,
    );
    $period = drupal_map_assoc(array(
      3600,
      10800,
      21600,
      32400,
      43200,
      86400,
      172800,
      259200,
      604800,
      1209600,
      2419200,
      3628800,
      4838400,
      7257600,
      15724800,
      31536000,
    ), 'format_interval');
    $period[FEEDAPI_NEVER_DELETE_OLD] = t('Never delete');
    $form['items_delete'] = array(
      '#type' => 'select',
      '#title' => t('Delete news items older than'),
      '#options' => $period,
      '#default_value' => FEEDAPI_NEVER_DELETE_OLD,
    );
  }
  return $form;
}