You are here

function theme_amazon_item__dvd in Amazon Product Advertisement API 7

Same name and namespace in other branches
  1. 6 amazon_media/amazon_media.theme.inc \theme_amazon_item__dvd()
  2. 7.2 amazon_media/amazon_media.module \theme_amazon_item__dvd()

Implements theme_ with specialty dvd.

Parameters

$item: fully populated amazon item.

$style: 'full', 'thumbnail', or whatever.

File

amazon_media/amazon_media.module, line 202
Provides additional behaviors and data type for amazon items which are DVDs, software, video games, music, etc.

Code

function theme_amazon_item__dvd($item, $style = 'default') {
  drupal_set_message('Theming with theme_amazon_item__dvd');
  $output = '';
  $type = $item['type'];
  switch ($style) {
    case 'full':
      $output .= '<div class="' . _amazon_item_classes($type) . ' amazon-item-full">';
      $output .= theme('image', array(
        'path' => $item['imagesets']['mediumimage']['url'],
        'alt' => t('Cover image'),
        'title' => check_markup($item['title']),
        'attributes' => array(),
        'getsize' => FALSE,
      ));
      $output .= '<h3>' . l(check_plain($item['title']), $item['detailpageurl'], array(
        'attributes' => array(
          'rel' => 'nofollow',
        ),
      )) . '</h3>';
      $output .= '</div>';
      break;
    case 'thumbnail':
      $output .= '<div class="' . _amazon_item_classes($type) . ' amazon-item-thumbnail">';
      $output .= theme('image', array(
        'path' => $item['imagesets']['mediumimage']['url'],
        'alt' => t('Cover image'),
        'title' => check_markup($item['title']),
        'attributes' => array(),
        'getsize' => FALSE,
      ));
      $output .= '</div>';
      break;
    default:
      $output .= '<div class="' . _amazon_item_classes($type) . '">';
      $output .= theme('image', array(
        'path' => $item['imagesets']['smallimage']['url'],
        'alt' => t('Cover image'),
        'title' => check_markup($item['title']),
        'attributes' => array(),
        'getsize' => FALSE,
      ));
      $output .= '<h3>' . l(check_markup($item['title']), $item['detailpageurl'], array(
        'attributes' => array(
          'rel' => 'nofollow',
        ),
      )) . '</h3>';
      $output .= '<div><strong>' . t('Director') . ':</strong> ' . implode(', ', $item['director']) . '</div>';
      $output .= '<div><strong>' . t('Rating') . ':</strong> ' . $item['audiencerating'] . '</div>';
      $output .= '<div><strong>' . t('Running time') . ':</strong> ' . $item['runningtime'] . ' ' . t('minutes') . '</div>';
      $output .= '</div>';
      break;
  }
  return $output;
}