diff options
-rw-r--r-- | includes/common.inc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/includes/common.inc b/includes/common.inc index d2303bd31..2dab60263 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -1037,7 +1037,15 @@ function drupal_attributes($attributes = NULL) { } function l($text, $url, $attributes = array(), $query = NULL, $fragment = NULL) { - return "<a href=\"". url($url, $query, $fragment) ."\"". ($url == $_GET['q'] ? ' class="active"' : NULL) . drupal_attributes($attributes) .">$text</a>"; + if ($url == $_GET['q']) { + if (isset($attributes['class'])) { + $attributes['class'] .= ' active'; + } + else { + $attributes['class'] = 'active'; + } + } + return "<a href=\"". url($url, $query, $fragment) ."\"". drupal_attributes($attributes) .">$text</a>"; } function field_get($string, $name) { |