You are here

function alinks_node_view in Alinks 7

Implementation of hook_node_view().

File

./alinks.module, line 130
this module allows users to associates defined text to links

Code

function alinks_node_view($node, $view_mode, $langcode) {
  $node_types = in_array($node->type, variable_get('alinks_node_types', array()), TRUE);
  if ($node_types) {
    $words = alinks_get_strings();
    if ($words) {
      if (is_array($words) && !empty($words) && isset($node->content['body'][0]['#markup'])) {
        $node->content['body'][0]['#markup'] = alinks_make_links($node->content['body'][0]['#markup'], $words);
      }
    }
  }
}