You are here

function rich_snippets_default_preprocessor in Rich Snippets 7

Default preprocessor when the result isn't associated with a schema.

Parameters

array &$variables: An associative array of template variables.

1 call to rich_snippets_default_preprocessor()
rich_snippets_preprocess_search_result in ./rich_snippets.module
Implements hook_preprocess_HOOK() for theme_search_result().

File

./rich_snippets.preprocess.inc, line 14
Rich Snippets preprocess hook implementations.

Code

function rich_snippets_default_preprocessor(&$variables) {

  // Build the date, remove it from search info.
  if (isset($variables['result']['date'])) {
    $date = theme('rich_snippets_date', array(
      'date' => $variables['result']['date'],
    ));
    $variables['snippet'] = $date . ' ' . $variables['snippet'];
    unset($variables['info_split']['date']);
  }

  // Re-format the author info.
  if (isset($variables['info_split']['user'])) {
    $user_args = array(
      '!user' => $variables['info_split']['user'],
    );
    $variables['info_split']['user'] = t('By !user', $user_args);
  }
}