Commit 25fe44c9 authored by jsacksick's avatar jsacksick Committed by Jonathan Sacksick

Add classes to toolbar megamenu links.

Change-Id: I5eb94b80337850e4cad2c81ab80677ed54e265ca
Reviewed-on: https://code.drupalcommerce.org/569Tested-by: 's avatarJenkins <jenkins@commerceguys.com>
Reviewed-by: 's avatarJonathan Sacksick <jonathan.sacksick@gmail.com>
parent 9b95099a
......@@ -16,6 +16,7 @@ function commerce_kickstart_menus_menu() {
'options' => array(
'toolbar_expanded' => TRUE,
'toolbar_break' => TRUE,
'toolbar_css' => 'site-settings',
),
);
// Products
......@@ -30,6 +31,7 @@ function commerce_kickstart_menus_menu() {
'options' => array(
'toolbar_expanded' => TRUE,
'toolbar_break' => TRUE,
'toolbar_css' => 'products',
),
);
// Products > Actions
......@@ -44,6 +46,7 @@ function commerce_kickstart_menus_menu() {
'options' => array(
'toolbar_expanded' => TRUE,
'toolbar_break' => TRUE,
'toolbar_css' => 'actions',
),
);
// Products > Settings
......@@ -88,6 +91,7 @@ function commerce_kickstart_menus_menu() {
'options' => array(
'toolbar_expanded' => TRUE,
'toolbar_break' => TRUE,
'toolbar_css' => 'orders',
),
);
// Orders > Actions
......@@ -116,6 +120,7 @@ function commerce_kickstart_menus_menu() {
'options' => array(
'toolbar_expanded' => TRUE,
'toolbar_break' => TRUE,
'toolbar_css' => 'content',
),
);
// Content > Actions
......@@ -324,6 +329,7 @@ function commerce_kickstart_menus_menu_alter(&$items) {
$items['admin/commerce/config']['options'] = array(
'toolbar_expanded' => TRUE,
'toolbar_break' => TRUE,
'toolbar_css' => 'store-settings',
);
}
......@@ -332,6 +338,7 @@ function commerce_kickstart_menus_menu_alter(&$items) {
$items['admin/help']['options'] = array(
'toolbar_expanded' => TRUE,
'toolbar_break' => TRUE,
'toolbar_css' => 'help',
);
}
......@@ -389,6 +396,7 @@ function commerce_kickstart_menus_menu_alter(&$items) {
$items['admin/commerce/jirafe']['title'] = 'Reports';
$items['admin/commerce/jirafe']['parent'] = 'admin';
$items['admin/commerce/jirafe']['weight'] = -25;
$items['admin/commerce/jirafe']['options']['toolbar_css'] = 'reports';
}
if (isset($items['admin/commerce/config/jirafe'])) {
$items['admin/commerce/config/jirafe']['hidden'] = TRUE;
......
......@@ -199,9 +199,14 @@ function toolbar_megamenu_tree_output($tree, $balance = TRUE) {
}
if ($build) {
foreach (element_children($build) as $group_id) {
$mlid = key($build[$group_id]);
$css_class = $group_id;
if (isset($build[$group_id][$mlid]['#localized_options']['toolbar_css'])) {
$css_class = $build[$group_id][$mlid]['#localized_options']['toolbar_css'];
}
$build[$group_id] += array(
'#sorted' => TRUE,
'#prefix' => '<ul class="menu group group-' . $group_id . '">',
'#prefix' => '<ul class="menu group group-' . $group_id . ' toolbar-menu-' . $css_class . '">',
'#suffix' => '</ul>',
);
}
......
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