You are here

function amazon_test_form in Amazon Product Advertisement API 6

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

Form to allow debugging the actual retrieval from Amazon.

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

File

./amazon.admin.inc, line 184

Code

function amazon_test_form($form_state) {
  $form = array();
  $form['asin'] = array(
    '#type' => 'textfield',
    '#title' => t('Amazon Product ID'),
    '#description' => t('The ASIN, ISBN-10, or ISBN-13 of a product listed on Amazon.'),
    '#required' => TRUE,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Look Up Product'),
  );
  if (isset($form_state['amazon_item'])) {
    $markup = theme('amazon_item', $form_state['amazon_item'], 'details');
    $markup .= '<pre>' . print_r($form_state['amazon_item'], TRUE) . '</pre>';
    $form['item_data'] = array(
      '#type' => 'markup',
      '#value' => $markup,
      '#weight' => 10,
    );
  }
  return $form;
}