You are here

function amazon_storage_settings_form in Amazon Product Advertisement API 7.2

Same name and namespace in other branches
  1. 6 amazon.admin.inc \amazon_storage_settings_form()
  2. 7 amazon.admin.inc \amazon_storage_settings_form()

Form to determine how long things get cached.

1 string reference to 'amazon_storage_settings_form'
amazon_menu in ./amazon.module
Implementation of hook_menu. Adds the url path for the Amazon settings page.

File

./amazon.admin.inc, line 87
Amazon Admin pages.

Code

function amazon_storage_settings_form($form, &$form_state) {
  $period = drupal_map_assoc(array(
    3600,
    7200,
    14400,
    21600,
    43200,
    86400,
  ), 'format_interval');
  $form['details']['amazon_refresh_schedule'] = array(
    '#type' => 'select',
    '#title' => t('Amazon refresh schedule'),
    '#description' => t('Cached information on Amazon items must be refreshed regularly to keep pricing and stock information up to date. Cron must be enabled for this function to work properly.'),
    '#default_value' => variable_get('amazon_refresh_schedule', 86400),
    '#options' => $period,
  );
  $form['details']['amazon_refresh_cron_limit'] = array(
    '#type' => 'textfield',
    '#title' => t('Limit'),
    '#description' => t('This will be the number of items processed each time cron runs.'),
    '#default_value' => variable_get('amazon_refresh_cron_limit', 50),
  );
  $form['details']['amazon_core_data'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Store extended product data'),
    '#default_value' => variable_get('amazon_core_data', array(
      'creators',
      'images',
      'editorial_reviews',
    )),
    '#options' => array(
      'creators' => t('Book authors, film actors, etc.'),
      'images' => t('Product image links'),
      'editorial_reviews' => t('Editorial reviews'),
    ),
  );
  return system_settings_form($form);
}