You are here

function amazon_media_preprocess_amazon_item in Amazon Product Advertisement API 7

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

Implements hook_preprocess.

Parameters

$variables:

File

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

Code

function amazon_media_preprocess_amazon_item(&$variables) {
  if (!empty($variables['publicationdate'])) {
    $date = explode('-', $variables['publicationdate']);
    $variables['publicationyear'] = $date[0];
  }

  // Various bits we want to ensure have defaults.
  $variables += array(
    'director' => '',
    'actor' => '',
    'audiencerating' => t('NR - Not Rated'),
    'publicationyear' => '',
    'runningtime' => '',
  );
}