You are here

function menu_link_weight_node_submit in Menu Link Weight 7

Implements hook_node_submit().

Sets the weight of the current menu link.

File

./menu_link_weight.module, line 449
Replaces the menu link weight dropdown with a tabledrag widget.

Code

function menu_link_weight_node_submit($node, $form, $form_state) {

  // Override the weight of the current link upon node submission.
  if (isset($node->menu['menu_link_weight']['link_current']['weight'])) {
    $node->menu['weight'] = $node->menu['menu_link_weight']['link_current']['weight'];
  }
}