You are here

function theme_forward_link in Forward 7.3

Same name and namespace in other branches
  1. 7.2 forward.module \theme_forward_link()

Theme function for Forward link

7 theme calls to theme_forward_link()
forward_block_view in ./forward.module
Implements hook_block_view().
forward_ds_field_create in ./forward.module
Callback for Display Suite field.
forward_handler_field_forward_link::render in views/forward_handler_field_forward_link.inc
Render the field.
forward_panels_entity_render in plugins/content_types/forward_entity.inc
forward_panels_node_render in plugins/content_types/forward_node.inc

... See full list

File

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

Code

function theme_forward_link($variables) {
  $entity_type = isset($variables['entity_type']) ? $variables['entity_type'] : NULL;
  $entity = isset($variables['entity']) ? $variables['entity'] : NULL;
  $path = isset($variables['path']) ? $variables['path'] : NULL;
  $block = isset($variables['block']) ? $variables['block'] : FALSE;

  // Handle an entity path (such as node/nid) with no entity
  if (!$entity && $path) {
    $id = _forward_entity_from_path($path, $entity_type, $entity, $bundle);
  }

  // Generate the link unless given a bad path
  $output = '';
  if (!$path || !url_is_external($path)) {
    $link = forward_link_create($entity_type, $entity, $path, $block);
    $output = $link['content'];
  }
  return $output;
}