Skip to content

Commit

Permalink
Remove the theme_menu_link override. (Moved to subtheme)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jen Lampton committed Jan 17, 2022
1 parent bbbc6d5 commit 89bf06d
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions template.php
Original file line number Diff line number Diff line change
Expand Up @@ -775,39 +775,6 @@ function borg_menu_tree__user_menu($variables) {
return $output;
}

/**
* Overrides theme_menu_link().
*/
function borg_menu_link(array $variables) {
$element = $variables['element'];
$sub_menu = '';

if ($element['#below']) {
$sub_menu = backdrop_render($element['#below']);
}

$menu_name = isset($element['#original_link']['menu_name']) ? $element['#original_link']['menu_name'] : NULL;
if ($menu_name === 'main-menu' || $menu_name === 'menu-handbook') {
// If this is the handbook link and we're on a book page, set an active class.
if ($element['#href'] === 'node/1') {
$node = menu_get_object();
if (isset($node) && isset($node->type) && $node->type === 'book') {
$element['#attributes']['class'][] = 'active';
}
}
}

if ($menu_name === 'main-menu' && ($element['#href'] == 'https://forum.backdropcms.org' ||
$element['#href'] == 'https://api.backdropcms.org')) {
$title = check_plain($element['#title']);
$element['#title'] = $title . ' <i class="fa fa-external-link" aria-hidden="true"></i>';
$element['#localized_options']['html'] = TRUE;
}

$output = l($element['#title'], $element['#href'], $element['#localized_options']);
return '<li' . backdrop_attributes($element['#attributes']) . '>' . $output . $sub_menu . "</li>\n";
}

/**
* Overrides theme_feed_icon().
*/
Expand Down

0 comments on commit 89bf06d

Please sign in to comment.