Commit 5fa33b29 authored by Dries's avatar Dries

- Made l() add 'class="active"' to the active/current URL.
parent 81e14382
......@@ -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) {
......
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment