'#description'=>t('The machine-readable name of this menu. This text will be used for constructing the URL of the <em>menu overview</em> page for this menu. This name may consist of only of lowercase letters, numbers, and hyphens, and must be unique.'),
'#required'=>TRUE,
);
...
...
@@ -559,6 +568,9 @@ function menu_edit_menu_validate($form, &$form_state) {
'description'=>'The navigation menu is provided by Drupal and is the main interactive menu for any site. It is usually the only menu that contains personalized links for authenticated users, and is often not even visible to anonymous users.',
),
'primary-links'=>array(
'menu_name'=>'primary-links',
'title'=>'Primary links',
'description'=>'Primary links are often used at the theme layer to show the major sections of a site. A typical representation for primary links would be tabs along the top.',
),
'secondary-links'=>array(
'menu_name'=>'secondary-links',
'title'=>'Secondary links',
'description'=>'Secondary links are often used for pages like legal notices, contact details, and other secondary navigation items that play a lesser role than primary links',
),
);
// Save user-defined titles.
foreach(array($primary,$secondary)as$mid){
if($item=db_fetch_array(db_query('SELECT * FROM {menu} WHERE mid = %d',$mid))){
// Items created via the menu module need to be assigned to it.
if($item['type']&MENU_CREATED_BY_ADMIN){
$item['module']='menu';
}
else{
$item['module']='system';
}
$item['updated']=TRUE;
// Save the link.
if($existing_item=db_fetch_array(db_query("SELECT mlid, menu_name FROM {menu_links} WHERE link_path = '%s' AND plid = '%s' AND link_title = '%s' AND menu_name = '%s'",$item['link_path'],$item['plid'],$item['link_title'],$item['menu_name']))){