fields(array( 'menu_name' => 'admin_shortcuts', 'title' => $t('Administration shortcuts'), 'description' => $t('The Admininstration shortcuts menu contains commonly used links for administrative tasks.') )) ->execute(); // Add starter convenience shortcuts. menu_rebuild(); $items = array( 'node/add' => 'Add', 'admin/content' => 'Find content', 'admin' => 'Dashboard', ); $weight = -20; foreach ($items as $path => $title) { $link = array( 'mlid' => 0, 'link_title' => $title, 'link_path' => $path, 'router_path' => $path, 'menu_name' => 'admin_shortcuts', 'module' => 'menu', 'weight' => $weight, ); // Check for an existing menu item before attempting to create a new one. $menu_link = db_query("SELECT mlid FROM {menu_links} WHERE link_path = :path AND menu_name = :menu_name", array( ':path' => $link['link_path'], ':menu_name' => $link['menu_name'] )) ->fetchField(); if (!$menu_link) { menu_link_save($link); } // Increment weight so items can be displayed in desired order. $weight++; } }