function template_preprocess_amazon_views_view_row_item in Amazon Product Advertisement API 7
Same name and namespace in other branches
- 6 amazon.module \template_preprocess_amazon_views_view_row_item()
- 7.2 amazon.module \template_preprocess_amazon_views_view_row_item()
Template helper for theme_amazon_views_view_row_item
File
- ./
amazon.module, line 870
Code
function template_preprocess_amazon_views_view_row_item(&$vars) {
$options = $vars['options'];
$vars['amazon_item'] = '';
// make sure var is defined.
$asin = $vars['row']->asin;
$items = amazon_item_lookup($asin);
if (empty($items[$asin])) {
return;
}
else {
$item = $items[$asin];
$item['view'] = $vars['view'];
$vars['amazon_item'] = $item;
if ($options['display_format'] == 'inline') {
$vars['content'] = theme('amazon_item_inline', array(
'item' => $item,
'style' => $options['display_format'],
));
}
else {
$vars['content'] = theme('amazon_item', array(
'item' => $item,
'style' => $options['display_format'],
));
}
}
}