You are here

function menu_import_get_max_weight in Menu Export/Import 7

Get max weight for first level.

1 call to menu_import_get_max_weight()
menu_import_parse_menu_from_file in includes/import.inc
File parser function. Reads through the text file and constructs the menu.

File

includes/import.inc, line 603
Import functions for menu_import module.

Code

function menu_import_get_max_weight($menu_name) {
  $weight = db_query("SELECT MAX(weight) FROM {menu_links} WHERE menu_name = :menu_name AND depth = 1", array(
    ':menu_name' => $menu_name,
  ))
    ->fetchField();
  if (empty($weight)) {
    $weight = 0;
  }
  return $weight;
}