You are here

function theme_asin_text in Amazon Product Advertisement API 6

1 call to theme_asin_text()
theme_asin_autocomplete in asin/asin.module

File

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

Code

function theme_asin_text($element) {
  drupal_add_css(drupal_get_path('module', 'asin') . '/asin.css', 'module', 'all', FALSE);
  $output = $element['#children'];
  if (!empty($element['#value']) && !empty($element['#value']['asin'])) {
    $asin = $element['#value']['asin'];
    if ($data = amazon_item_lookup(array(
      $asin,
    ))) {
      $output .= '<p class="asin-edit-title">' . check_plain($data[$asin]['title']) . '</p>';
    }
  }
  return $output;
}