function views_handler_field_amazon_image::init in Amazon Product Advertisement API 6
Same name and namespace in other branches
- 7.2 includes/views_handler_field_amazon_image.inc \views_handler_field_amazon_image::init()
- 7 includes/views_handler_field_amazon_image.inc \views_handler_field_amazon_image::init()
Override init function to provide generic option to link to node.
File
- includes/
views_handler_field_amazon_image.inc, line 23 - Provide views handler so that Amazon Image can be displayed in the various ways that are available.
Class
- views_handler_field_amazon_image
- @file Provide views handler so that Amazon Image can be displayed in the various ways that are available.
Code
function init(&$view, &$data) {
parent::init($view, $data);
if (!empty($data['image_size'])) {
$this->additional_fields['height'] = 'height';
$this->additional_fields['width'] = 'width';
}
if (!empty($data['link_format']) && $data['link_format'] == 'amazon') {
$this->additional_fields['detailpageurl'] = array(
'table' => 'amazon_item',
'field' => 'detailpageurl',
'value' => 'amazon_item_detailpageurl',
);
}
$this->additional_fields['asin'] = 'asin';
$this->additional_fields['url'] = 'url';
}