You are here

function defaultcontent_preprocess_link_DISABLED in Default Content 7.2

Same name and namespace in other branches
  1. 7 defaultcontent.module \defaultcontent_preprocess_link_DISABLED()

Implements hook_preprocess_link().

we are going to preorcess the link function so we can make sure we set it to active even if we are using the node-name path

File

./defaultcontent.module, line 539
Module file for the Default content module which allow export and import of default content in a Drupal site.

Code

function defaultcontent_preprocess_link_DISABLED(&$vars) {
  if (preg_match('|node-name/(.*)|', $vars['path'], $matches) && ($nid = defaultcontent_get_default($matches[1]))) {
    if ($_GET['q'] == 'node/' . $nid) {
      $vars['options']['attributes']['class'][] = 'active';
    }
  }
}