diff --git a/core/themes/seven/seven.theme b/core/themes/seven/seven.theme index ef4166c..3ab8d22 100644 --- a/core/themes/seven/seven.theme +++ b/core/themes/seven/seven.theme @@ -151,11 +151,17 @@ function seven_menu_local_action($variables) { $link += array( 'href' => '', 'localized_options' => array(), + 'route_parameters' => array(), ); - // Will be the existing classes array or NULL. - $classes = &$link['localized_options']['attributes']['class']; - $classes = array_merge((array) $classes, array('button', 'button--primary', 'button--small')); - // We require Modernizr for button styling. + $link['localized_options']['attributes']['class'][] = 'button'; + $link['localized_options']['attributes']['class'][] = 'button--primary'; + $link['localized_options']['attributes']['class'][] = 'button--small'; + + // @todo Replace with a generalized solution for icons. + // See http://drupal.org/node/1849712 + $link['localized_options']['attributes']['class'][] = 'button-action'; + + // We require Modernizr for button styling. $libraries = array( '#attached' => array( 'library' => array( @@ -165,14 +171,16 @@ function seven_menu_local_action($variables) { ); drupal_render($libraries); - // @todo Replace with a generalized solution for icons. - // See http://drupal.org/node/1849712 - $classes[] = 'button-action'; - - $link['localized_options']['html'] = TRUE; - $output = '
  • '; - $output .= l($link['title'], $link['href'], $link['localized_options']); + // @todo Remove this check and the call to l() when all pages are converted to + // routes. + // @todo Figure out how to support local actions without a href properly. + if ($link['href'] === '' && !empty($link['route_name'])) { + $output .= Drupal::l($link['title'], $link['route_name'], $link['route_parameters'], $link['localized_options']); + } + else { + $output .= l($link['title'], $link['href'], $link['localized_options']); + } $output .= "
  • "; return $output;