diff options
-rw-r--r-- | includes/common.inc | 2 | ||||
-rw-r--r-- | includes/menu.inc | 6 |
2 files changed, 2 insertions, 6 deletions
diff --git a/includes/common.inc b/includes/common.inc index 39597b8aa..55f3e6520 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -985,7 +985,7 @@ function drupal_attributes($attributes = NULL) { } function l($text, $url, $attributes = array(), $query = NULL, $fragment = NULL) { - return "<a href=\"". url($url, $query, $fragment) ."\"". drupal_attributes($attributes) .">$text</a>"; + return "<a href=\"". url($url, $query, $fragment) ."\"". ($url == $_GET['q'] ? ' class="active"' : NULL) . drupal_attributes($attributes) .">$text</a>"; } function field_get($string, $name) { diff --git a/includes/menu.inc b/includes/menu.inc index 7001e1d9b..dc37df005 100644 --- a/includes/menu.inc +++ b/includes/menu.inc @@ -259,11 +259,7 @@ function _menu_sort($a, $b) { function _render_item($path) { global $_list; - if ($path == $_GET["q"]) { - $css = " class=\"active\""; - } - - return "<a href=\"". url($path) ."\"$css>". $_list[$path]["title"] ."</a>"; + return l($_list[$path]["title"], $path); } |