You are here

function forward_preprocess in Forward 7.3

Implements hook_preprocess().

File

./forward.module, line 1050
Allows forwarding of entities by email, and provides a record of how often each has been forwarded.

Code

function forward_preprocess(&$variables, $hook) {

  // Add template suggestions for theming various entity types when using the custom "Forward" view mode
  if ($hook == 'node' || $hook == 'taxonomy_term') {

    // Known entity types
    if ($variables['elements']['#view_mode'] == 'forward') {
      $variables['theme_hook_suggestions'][] = $variables['elements']['#entity_type'] . '__forward';
    }
  }
  if ($hook == 'entity') {

    // Additional entity types added via entity maintenance
    if ($variables['elements']['#view_mode'] == 'forward') {
      $variables['theme_hook_suggestions'][] = $variables['elements']['#entity_type'] . '__forward';
      $variables['theme_hook_suggestions'][] = $variables['elements']['#entity_type'] . '__' . $variables['elements']['#bundle'] . '__forward';
    }
  }
}