You are here

public function Drupal_RichSnippets_Node_NodeSchemaPreprocessor::addImage in Rich Snippets 7

Implements Drupal_RichSnippets_SchemaPreprocessorAbstract::addImage().

Overrides Drupal_RichSnippets_SchemaPreprocessorInterface::addImage

File

lib/Drupal/RichSnippets/Node/NodeSchemaPreprocessor.php, line 89
Contains Drupal_RichSnippets_Node_NodeSchemaPreprocessor.

Class

Drupal_RichSnippets_Node_NodeSchemaPreprocessor
Rich Snippets preprocessor for the Node module.

Code

public function addImage($schema) {
  foreach ($this
    ->getSchemaFields($schema) as $items) {
    $image = array(
      'path' => $items[0]['uri'],
      'style_name' => RICH_SNIPPETS_STYLE_NAME,
    );
    $this->_variables['image'] = theme('image_style', $image);
  }
}