You are here

function asin_form_devel_generate_content_form_alter in Amazon Product Advertisement API 6

Same name and namespace in other branches
  1. 7.2 asin/asin.module \asin_form_devel_generate_content_form_alter()
  2. 7 asin/asin.module \asin_form_devel_generate_content_form_alter()

Allow selection of the SearchIndex and Keywords to be used

File

asin/asin.module, line 571
Defines a field type for referencing an Amazon product.

Code

function asin_form_devel_generate_content_form_alter(&$form, $form_state) {
  $form['asin_options'] = array(
    '#type' => 'fieldset',
    '#title' => t('Amazon ASIN Field Configuration'),
    '#expanded' => FALSE,
  );
  $form['asin_options']['asin_devel_generate_search_index'] = array(
    '#type' => 'select',
    '#title' => t('Amazon SearchIndex'),
    '#options' => drupal_map_assoc(array(
      'All',
      'Books',
      'DVD',
      'Electronics',
      'Kitchen',
      'Software',
    )),
    '#default_value' => variable_get('asin_devel_generate_search_index', 'All'),
  );
  $form['asin_options']['asin_devel_generate_keywords'] = array(
    '#type' => 'textfield',
    '#title' => t('Amazon.com search keywords for ASIN fields'),
    '#description' => t('Comma-separated list of keywords to be used in search to populate Amazon module asin fields'),
    '#default_value' => variable_get('asin_devel_generate_keywords', 'computers'),
  );
  $form['submit']['#weight'] = 99;
  array_unshift($form['#submit'], 'asin_devel_generate_set_values');
}