Index: database/database.mysql
===================================================================
RCS file: /cvs/drupal/drupal/database/database.mysql,v
retrieving revision 1.201
diff -u -p -r1.201 database.mysql
--- database/database.mysql	18 Oct 2005 14:41:26 -0000	1.201
+++ database/database.mysql	30 Oct 2005 10:45:07 -0000
@@ -860,3 +860,8 @@ INSERT INTO locales_meta (locale, name, 
 INSERT INTO url_alias (src, dst) VALUES ('node/feed', 'rss.xml');
 
 INSERT INTO variable (name, value) VALUES ('node_options_forum', 'a:1:{i:0;s:6:"status";}');
+
+INSERT INTO menu VALUES (2, 0, 'Primary links', '', 0, 115);
+INSERT INTO menu VALUES (3, 2, 'edit primary links', 'admin/menu', 0, 118);
+INSERT INTO variable VALUES ('menu_primary_menu', 'i:2');
+INSERT INTO variable VALUES ('menu_secondary_menu', 'i:2');
Index: database/database.pgsql
===================================================================
RCS file: /cvs/drupal/drupal/database/database.pgsql,v
retrieving revision 1.140
diff -u -p -r1.140 database.pgsql
--- database/database.pgsql	18 Oct 2005 14:41:26 -0000	1.140
+++ database/database.pgsql	30 Oct 2005 10:45:07 -0000
@@ -852,6 +852,11 @@ INSERT INTO url_alias (src, dst) VALUES 
 
 INSERT INTO variable (name, value) VALUES ('node_options_forum', 'a:1:{i:0;s:6:"status";}');
 
+INSERT INTO menu VALUES (2, 0, 'Primary links', '', 0, 115);
+INSERT INTO menu VALUES (3, 2, 'edit primary links', 'admin/menu', 0, 118);
+INSERT INTO variable VALUES ('menu_primary_menu', 'i:2');
+INSERT INTO variable VALUES ('menu_secondary_menu', 'i:2');
+
 ---
 --- Alter some sequences
 ---
Index: database/updates.inc
===================================================================
RCS file: /cvs/drupal/drupal/database/updates.inc,v
retrieving revision 1.140
diff -u -p -r1.140 updates.inc
--- database/updates.inc	22 Oct 2005 15:14:46 -0000	1.140
+++ database/updates.inc	30 Oct 2005 10:45:08 -0000
@@ -67,7 +67,8 @@ $sql_updates = array(
   "2005-09-07" => "update_147",
   "2005-09-18" => "update_148",
   "2005-09-27" => "update_149",
-  "2005-10-15" => "update_150"
+  "2005-10-15" => "update_150",
+  "2005-10-23" => "update_151",
 );
 
 function update_110() {
@@ -919,6 +920,76 @@ function update_150() {
   return $ret;
 }
 
+function update_151() {
+  $ret = array();
+
+  $ts = variable_get('theme_settings', '');
+
+  // set up data array so we can loop over both sets of links
+  $menus = array(0 => array('links_var' => 'primary_links',
+                            'toggle_var' => 'toggle_primary_links',
+                            'more_var' => 'primary_links_more',
+                            'menu_name' => t('Primary links'),
+                            'hint_text' => t('edit primary links'),
+                            'menu_var' => 'menu_primary_menu',
+                            'pid' => 0),
+                 1 => array('links_var' => 'secondary_links',
+                            'toggle_var' => 'toggle_secondary_links',
+                            'more_var' => 'secondary_links_more',
+                            'menu_name' => t('Secondary links'),
+                            'hint_text' => t('edit secondary links'),
+                            'menu_var' => 'menu_secondary_menu',
+                            'pid' => 0));
+
+  for ($loop = 0; $loop <= 1 ; $loop ++) {
+    // create new Primary and Secondary links menus
+    $menus[$loop]['pid'] = db_next_id('{menu}_mid');
+    $ret[] = update_sql("INSERT INTO {menu} (mid, pid, path, title, description, weight, type) " .
+                         "VALUES ({$menus[$loop]['pid']}, 0, '', '{$menus[$loop]['menu_name']}', '', 0, 115)");
+  
+    // insert all entries from theme links into new menus
+    $num_inserted = 0;
+    if ($links = variable_get($menus[$loop]['links_var'], '')) {
+      for ($i = 0; $i < count($links['text']); $i++) {
+        if ($links['text'][$i] != "" && $links['link'][$i] != "") {
+          $num_inserted ++;
+          $node_unalias = db_fetch_array(db_query("SELECT src FROM {url_alias} WHERE dst = '%s'", $links['link'][$i]));
+          if (is_array($node_unalias)) {
+	    $link_path = $node_unalias['src'];
+	  }
+	  else {
+	    $link_path = $links['link'][$i];
+	  }
+
+          $mid = db_next_id('{menu}_mid');
+          $ret[] = update_sql("INSERT INTO {menu} (mid, pid, path, title, description, weight, type) " .
+                               "VALUES ($mid, {$menus[$loop]['pid']}, '$link_path', '{$links['text'][$i]}', '{$links['description'][$i]}', 0, 118)");
+        }
+      }
+    }
+  
+    // if no old entries then insert hint link
+    if ($num_inserted == 0) {
+      $mid = db_next_id('{menu}_mid');
+      $ret[] = update_sql("INSERT INTO {menu} (mid, pid, path, title, description, weight, type) " .
+                          "VALUES ($mid, {$menus[$loop]['pid']}, 'admin/menu', '{$menus[$loop]['hint_text']}', '', 0, 118)");
+    }
+  
+    // set menu_primary_menu variable appropriately
+    if (!$ts[$menus[$loop]['toggle_var']] || $num_inserted == 0) {
+      variable_set($menus[$loop]['menu_var'], 0);
+    }
+    else {
+      variable_set($menus[$loop]['menu_var'], $menus[$loop]['pid']);
+    }
+    variable_del($menus[$loop]['toggle_var']);
+    variable_del($menus[$loop]['links_var']);
+    variable_del($menus[$loop]['more_var']);
+  }
+  
+  return $ret;
+}
+
 function update_sql($sql) {
   $edit = $_POST["edit"];
   $result = db_query($sql);
Index: includes/menu.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/menu.inc,v
retrieving revision 1.88
diff -u -p -r1.88 menu.inc
--- includes/menu.inc	29 Oct 2005 06:58:56 -0000	1.88
+++ includes/menu.inc	30 Oct 2005 10:45:08 -0000
@@ -493,6 +493,21 @@ function menu_in_active_trail($mid) {
 }
 
 /**
+ * Returns true when the menu item is in the active trail within a 
+ * specific subsection of the menu tree.
+ *
+ * @param $mid
+ *   The menu item being considered.
+ * @param $pid
+ *   The root of the subsection of the menu tree in which to look.
+ */
+function menu_in_active_trail_in_submenu($mid, $pid) {
+  $trail = _menu_get_active_trail_in_submenu($pid);
+
+  return in_array($mid, $trail);
+}
+
+/**
  * Populate the database representation of the menu.
  *
  * This need only be called at the start of pages that modify the menu.
@@ -708,6 +723,161 @@ function theme_menu_local_task($mid, $ac
 }
 
 /**
+ * Returns the primary links menu.
+ *
+ * @param $list
+ *   If true, the menu will be rendered as an unordered list.
+ *   If false the menu will be rendered in "link | link" format.
+ */
+function menu_primary_links($list = FALSE) {
+  $mpm = variable_get('menu_primary_menu', 0);
+  if ($mpm == 0) {
+    return '';
+  }
+
+  if ($list) {
+    return theme('menu_links_list', 1, $mpm);
+  }
+  else {
+    return theme('menu_links_text', 1, $mpm);
+  }
+}
+
+/**
+ * Returns the secondary links menu.
+ *
+ * @param $list
+ *   If true, the menu will be rendered as an unordered list.
+ *   If false the menu will be rendered in "link | link" format.
+ */
+function menu_secondary_links($list = FALSE) {
+  $msm = variable_get('menu_secondary_menu', 0);
+  if ($msm == 0) {
+    return '';
+  }
+
+  if ($msm == variable_get('menu_primary_menu', 0)) {
+    $start_level = 2;
+  }
+  else {
+    $start_level = 1;
+  }
+  
+  if ($list) {
+    return theme('menu_links_list', $start_level, $msm);
+  }
+  else {
+    return theme('menu_links_text', $start_level, $msm);
+  }
+}
+
+/**
+ * Returns a rendered menu suitable for horizontal display. The menu is
+ * rendered in "link | link | link" format. This is used to display the
+ * primary and secondary links. 
+ *
+ * @param $start_level
+ *   The number of levels under the pid you want to render.
+ *   The default is 1 and will render children of $pid.
+ *   If you want to render the secondary items, set this to 2 and this 
+ *   will skip the first (primary) level and give you level 2.
+ * @param $pid
+ *   The menu ID to render. Children of this menu item will be rendered, 
+ *   but the item itself will be omitted.
+ *   Defaults to NULL, in which case it will use the menu_primary_menu setting.
+ *
+ * @ingroup themeable
+ */
+function theme_menu_links_text($start_level = 1, $pid = NULL) {
+  $output = '';
+
+  if ($links = menu_links($start_level, $pid, FALSE)) {
+    $output .= theme('links', $links);
+  }
+
+  return $output;
+}
+
+/**
+ * Returns a rendered menu suitable for horizontal display. The menu is
+ * rendered as an unordered list. This may be used to generate primary
+ * and secondary links. The CSS provided by default is the same as the 
+ * CSS used for local tasks. It is expected that the theme will provide 
+ * custom CSS if it wishes to make use of this feature.
+ *
+ * @param $start_level
+ *   The number of levels under the pid you want to render.
+ *   The default is 1 and will render children of $pid.
+ *   If you want to render the secondary items, set this to 2 and this 
+ *   will skip the first (primary) level and give you level 2.
+ * @param $pid
+ *   The menu ID to render. Children of this menu item will be rendered, 
+ *   but the item itself will be omitted.
+ *   Defaults to NULL, in which case it will use the menu_primary_menu setting.
+ *
+ * @ingroup themeable
+ */
+function theme_menu_links_list($start_level = 1, $pid = NULL) {
+  $output = '';
+
+  if ($links = menu_links($start_level, $pid, TRUE)) {
+    $output .= "<ul class=\"primary\">\n" . implode("\n", $links) . "</ul>\n";
+  }
+
+  return $output;
+}
+
+/**
+ * Returns an array containing the menu items in a specified single level
+ * of the menu tree.
+ *
+ * @param $start_level
+ *   Follow the active trail down this many levels before starting to render.
+ *   Used to generate a primary/secondary menu from different levels of a tree.
+ * @param $pid
+ *   The parent menu ID from which to search for children. Defaults to the 
+ *   menu_primary_menu setting.
+ */
+function menu_links($start_level = 1, $pid, $as_list = FALSE) {
+  if (!$pid) {
+    $pid = variable_get('menu_primary_menu', 0);
+  }
+  if (!$pid) {
+    return NULL;
+  }
+
+  $menu = menu_get_menu();
+  $menu_items = array();
+
+  if ($start_level < 1) {
+    $start_level = 1;
+  }
+
+  if ($start_level > 1) {
+    $trail = _menu_get_active_trail_in_submenu($pid);
+    if ($trail) {
+      $mid = $trail[$start_level - 1];
+    }
+  }
+  else {
+    $mid = $pid;
+  }
+
+  if ($mid && array_key_exists('children', $menu['visible'][$mid])) {
+    foreach ($menu['visible'][$mid]['children'] as $cid) {
+      if ($as_list) {
+        $menu_items[] = theme('menu_local_task', $cid, menu_in_active_trail_in_submenu($cid, $pid), TRUE);
+      }
+      else {
+        $menu_items[] = menu_item_link($cid);
+      }
+    }
+  }
+
+  return $menu_items;
+}
+
+/**
  * @} End of "defgroup menu".
  */
 
@@ -734,6 +904,56 @@ function _menu_get_active_trail() {
 }
 
 /**
+ * Find the active trail through a specific subsection of the menu tree.
+ *
+ * @param $pid
+ *   The root item from which the active trail must descend.
+ */
+function _menu_get_active_trail_in_submenu($pid) {
+  static $trails;
+  static $built;
+
+  if (!$built) {
+    // Find all menu items which point to the current node and for each
+    // follow the parents up the chain to build an active trail.
+    $built = TRUE;
+    $menu = menu_get_menu();
+    $path = $_GET['q'];
+    $count = 0;
+    while ($path && !$count) {
+      foreach ($menu['items'] as $key => $item) {
+        if (array_key_exists('path', $item) && $item['path'] == $path) {
+          $trails[$count] = array();
+          $mid = $key;
+          while ($mid && $menu['items'][$mid]) {
+            array_unshift($trails[$count], $mid);
+            $mid = $menu['items'][$mid]['pid'];
+          }
+	  $count ++;
+        }
+      }
+      $path = substr($path, 0, strrpos($path, '/'));
+    }
+  }
+
+  if ($trails) {
+    foreach ($trails as $key => $trail) {
+      for ($i = 0 ; $i < count($trail); $i++) {
+        if ($trail[$i] == $pid) {
+	  // create a trail from $pid to the current page inclusive.
+          for ( ; $i < count($trail) ; $i++) {
+	    $subtrail[] = $trail[$i];
+	  }
+          return $subtrail;
+        }
+      }
+    }
+  }
+  
+  return null;
+}
+
+/**
  * Comparator routine for use in sorting menu items.
  */
 function _menu_sort($a, $b) {
Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.263
diff -u -p -r1.263 theme.inc
--- includes/theme.inc	22 Oct 2005 15:14:46 -0000	1.263
+++ includes/theme.inc	30 Oct 2005 10:45:08 -0000
@@ -212,8 +212,6 @@ function path_to_theme() {
  */
 function theme_get_settings($key = NULL) {
   $defaults = array(
-    'primary_links'                 =>  array(),
-    'secondary_links'               =>  array(),
     'mission'                       =>  '',
     'default_logo'                  =>  1,
     'logo_path'                     =>  '',
@@ -225,8 +223,6 @@ function theme_get_settings($key = NULL)
     'toggle_search'                 =>  1,
     'toggle_slogan'                 =>  0,
     'toggle_mission'                =>  1,
-    'toggle_primary_links'          =>  1,
-    'toggle_secondary_links'        =>  1,
     'toggle_node_user_picture'      =>  0,
     'toggle_comment_user_picture'   =>  0,
   );
@@ -307,41 +303,6 @@ function theme_get_setting($setting_name
       }
     }
 
-    foreach (array('primary', 'secondary') as $type) {
-      // Get the data to populate the textfields, if the variable is not an array .. try to parse the old-style link format.
-      $value = $settings[$type . '_links'];
-
-      // Clear out existing (internal) values
-      $settings[$type .'_links'] = array();
-
-      // Get the amount of links to show, possibly expanding if there are more links defined than the count specifies.
-      $count = variable_get($type . '_link_count', 5);
-      if (isset($value['link']) && $count > sizeof($value['link'])) {
-        $count = sizeof($value['link']);
-      }
-
-      if ($settings['toggle_' . $type . '_links']) {
-        for ($i =0; $i < $count; $i++) {
-          unset($attributes);
-          if (!empty($value['text'][$i])) {
-            if (!empty($value['description'][$i])) {
-              $attributes['title'] = $value['description'][$i];
-            }
-            $text = $value['text'][$i];
-            $link = $value['link'][$i];
-            if (substr($link, 0, 7) == 'http://') {
-              $settings[$type .'_links'][] = '<a href="'. check_url($link) .'"'. drupal_attributes($attributes) .'>'. check_plain($text) .'</a>';
-            }
-            else {
-              $settings[$type .'_links'][] = l($text, $link, $attributes);
-            }
-          }
-        }
-        if ($settings[$type .'_links'] == array()) {
-          $settings[$type .'_links'] = array(l(t('edit %type links', array('%type' => $type)),'admin/themes/settings'));
-        }
-      }
-    }
   }
 
   return isset($settings[$setting_name]) ? $settings[$setting_name] : NULL;
Index: modules/menu.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/menu.module,v
retrieving revision 1.41
diff -u -p -r1.41 menu.module
--- modules/menu.module	28 Oct 2005 14:04:20 -0000	1.41
+++ modules/menu.module	30 Oct 2005 10:45:09 -0000
@@ -47,6 +47,11 @@ function menu_menu($may_cache) {
       'callback' => 'menu_reset',
       'access' => user_access('administer menu'),
       'type' => MENU_LOCAL_TASK);
+
+    $items[] = array('path' => 'admin/settings/menu',
+      'title' => t('menus'),
+      'callback' => 'menu_configure',
+      'access' => user_access('administer menu'));
   }
 
   return $items;
@@ -65,9 +70,48 @@ function menu_help($section) {
       return t('<p>Enter the name for your new menu. Remember to enable the newly created block in the %blocks administration page.</p>', array('%blocks' => l(t('blocks'), 'admin/block')));
     case 'admin/menu/item/add':
       return t('<p>Enter the title, path, position and the weight for your new menu item.</p>');
+    case 'admin/settings/menu':
+      return t('<p>Customize the menu settings.</p>');
   }
 }
 
+
+/**
+ * Menu callback; presents menu configuration options.
+ */
+function menu_configure() {
+  $menu = menu_get_menu();
+  
+  $primary_options[0] = t('No primary links');
+  foreach ($menu['items'][0]['children'] as $mid) {
+    $primary_options[$mid] = $menu['items'][$mid]['title'];
+  }
+
+  $form['settings_links'] = array('#type' => 'fieldset', '#title' => t('Primary links settings'));
+  $form['settings_links']['menu_primary_menu'] = array(
+    '#type' => 'select',
+    '#title' => t('primary links menu'),
+    '#default_value' => variable_get('menu_primary_menu', 0),
+    '#options' => $primary_options,
+    '#description' => t('Primary links are a navigation system which typically (depending on your theme) appears at the top-right of the window. You may control which links appear in this area by choosing a menu from which the primary links will be generated and then placing your preferred links into the menu using the <a href="%menu">menu administration</a>.', array('%menu' => url('admin/menu')))
+  );
+
+  $secondary_options[0] = t('No secondary links');
+  foreach ($menu['items'][0]['children'] as $mid) {
+    $secondary_options[$mid] = $menu['items'][$mid]['title'];
+  }
+
+  $form['settings_links']['menu_secondary_menu'] = array(
+    '#type' => 'select',
+    '#title' => t('secondary links menu'),
+    '#default_value' => variable_get('menu_secondary_menu', 0),
+    '#options' => $secondary_options,
+    '#description' => t('Secondary links typically appear alongside primary links. You can choose to disable secondary links, or use a specific menu as secondary links. If you select the same menu as primary links then secondary links will automatically show the appropriate second level of your navigation hierarchy. This is the default.')
+  );
+
+  return system_settings_form('menu_configure', $form);
+}
+
 /**
  * Implementation of hook_block().
  */
Index: modules/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system.module,v
retrieving revision 1.247
diff -u -p -r1.247 system.module
--- modules/system.module	26 Oct 2005 01:24:09 -0000	1.247
+++ modules/system.module	30 Oct 2005 10:45:09 -0000
@@ -1042,11 +1042,6 @@ function system_theme_settings($key = ''
 
   // System wide only settings.
   if (!$key) {
-    // Menu settings
-
-    $form['primary_links'] = system_navigation_links_form('primary', 'Primary');
-    $form['secondary_links'] = system_navigation_links_form('secondary', 'Secondary');
-
     // Toggle node display.
     $node_types = module_invoke('node', 'get_types');
     if ($node_types) {
@@ -1065,8 +1060,6 @@ function system_theme_settings($key = ''
     'toggle_name'                 => t('Site name'),
     'toggle_slogan'               => t('Site slogan'),
     'toggle_mission'              => t('Mission statement'),
-    'toggle_primary_links'        => t('Primary links'),
-    'toggle_secondary_links'      => t('Secondary links'),
     'toggle_node_user_picture'    => t('User pictures in posts'),
     'toggle_comment_user_picture' => t('User pictures in comments'),
     'toggle_search'               => t('Search box'),
@@ -1116,62 +1109,6 @@ function system_theme_settings($key = ''
 
 }
 
-function system_navigation_links_form($type, $utype) {
-  $settings = theme_get_settings('');
-  $value = $settings[$type . '_links'];
-
-  if (!is_array($value)) {
-    $value = array();
-  }
-  // Increment the link count, if the user has requested more links.
-  if (variable_get($type . '_links_more', false)) {
-    variable_del($type . '_links_more');
-    variable_set($type . '_link_count', variable_get($type . '_link_count', 5) + 5);
-  }
-
-  // Get the amount of links to show, possibly expanding if there are more links defined than the count specifies.
-  $count = variable_get($type . '_link_count', 5);
-  $count = ($count > sizeof($value['link'])) ? $count : sizeof($value['link']);
-
-  if (variable_get($type . '_link_count', 5) != $count) {
-    variable_set($type . '_link_count', $count);
-  }
-  $form = array(
-    '#type' => 'item', '#title' => t('_TYPE_ link settings', array('_TYPE_' => $utype)), '#theme' => 'system_navigation_links_form',
-    '#description' => t('You can specify your _TYPE_ links here, one link per line.<br /> The link text field is the text you want to link.<br /> The url field is the location the link points to.<br /> The description field is an optional description of where the link points.', array('_TYPE_' => $type))
-  );
-
-  $form['#tree'] = TRUE;
-
-  for ($i = 0; $i < $count; $i++) {
-    foreach (array('text', 'link', 'description') as $field) {
-      $form[$field][$i] = array('#type' => 'textfield', '#default_value' => $value[$field][$i], '#size' => 15, '#maxlength' => 90);
-    }
-  }
-
-  $form[$type . '_links_more'] = array(
-    '#type' => 'checkbox', '#title' => t('I need more _TYPE_ links.', array('_TYPE_' => $type)), '#default_value' => FALSE,
-    '#description' => t('Checking this box will give you 5 additional _TYPE_ links.', array('_TYPE_' => $type))
-  );
-  return $form;
-}
-
-function theme_system_navigation_links_form(&$form) {
-  $header = array(t('link text'), t('url'), t('description'));
-  foreach (element_children($form['text']) as $key) {
-    $row = array();
-    $row[] = form_render($form['text'][$key]);
-    $row[] = form_render($form['link'][$key]);
-    $row[] = form_render($form['description'][$key]);
-    $rows[] = $row;
-
-  }
-  $output = theme('table', $header, $rows);
-  $output .= form_render($form);
-  return $output;
-}
-
-
 function search_box() {
   $form['#action'] = url('search');
   $form['keys'] = array('#type' => 'textfield', '#size'=> 15, '#value' => '', '#attributes' => array('alt' => t('Enter the terms you wish to search for.'), 'class' => 'form-text'));
Index: themes/bluemarine/page.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/themes/bluemarine/page.tpl.php,v
retrieving revision 1.11
diff -u -p -r1.11 page.tpl.php
--- themes/bluemarine/page.tpl.php	7 Oct 2005 06:51:43 -0000	1.11
+++ themes/bluemarine/page.tpl.php	30 Oct 2005 10:45:09 -0000
@@ -18,8 +18,8 @@
       <?php if ($site_slogan) { ?><div class='site-slogan'><?php print $site_slogan ?></div><?php } ?>
     </td>
     <td id="menu">
-      <?php if ($secondary_links) { ?><div id="secondary"><?php print theme('links', $secondary_links) ?></div><?php } ?>
-      <?php if ($primary_links) { ?><div id="primary"><?php print theme('links', $primary_links) ?></div><?php } ?>
+      <?php if ($secondary_links) { ?><div id="secondary"><?php print $secondary_links ?></div><?php } ?>
+      <?php if ($primary_links) { ?><div id="primary"><?php print $primary_links ?></div><?php } ?>
       <?php print $search_box ?>
     </td>
   </tr>
Index: themes/chameleon/chameleon.theme
===================================================================
RCS file: /cvs/drupal/drupal/themes/chameleon/chameleon.theme,v
retrieving revision 1.33
diff -u -p -r1.33 chameleon.theme
--- themes/chameleon/chameleon.theme	16 Aug 2005 18:06:18 -0000	1.33
+++ themes/chameleon/chameleon.theme	30 Oct 2005 10:45:09 -0000
@@ -11,9 +11,7 @@ function chameleon_features() {
        'logo',
        'toggle_favicon',
        'toggle_name',
-       'toggle_slogan',
-       'toggle_primary_links',
-       'toggle_secondary_links');
+       'toggle_slogan');
 }
 
 function chameleon_regions() {
@@ -55,8 +53,6 @@ function chameleon_page($content) {
 
   $output .= "</div>\n";
 
-  $primary_links = theme('links', theme_get_setting('primary_links'));
-  $secondary_links = theme('links', theme_get_setting('secondary_links'));
   if ($primary_links || $secondary_links) {
     $output .= ' <div class="navlinks">';
     if ($primary_links) {
Index: themes/engines/phptemplate/phptemplate.engine
===================================================================
RCS file: /cvs/drupal/drupal/themes/engines/phptemplate/phptemplate.engine,v
retrieving revision 1.21
diff -u -p -r1.21 phptemplate.engine
--- themes/engines/phptemplate/phptemplate.engine	23 Oct 2005 09:58:43 -0000	1.21
+++ themes/engines/phptemplate/phptemplate.engine	30 Oct 2005 10:45:09 -0000
@@ -130,9 +130,7 @@ function phptemplate_features() {
     'toggle_mission',
     'toggle_name',
     'toggle_node_user_picture',
-    'toggle_primary_links',
     'toggle_search',
-    'toggle_secondary_links',
     'toggle_slogan'
   );
 }
@@ -200,9 +198,9 @@ function phptemplate_page($content) {
     'messages'            => theme('status_messages'),
     'mission'             => isset($mission) ? $mission : '',
     'onload_attributes'   => theme('onload_attribute'),
-    'primary_links'       => theme_get_setting('primary_links'),
+    'primary_links'       => menu_primary_links(),
     'search_box'          => (theme_get_setting('toggle_search') ? search_box() : ''),
-    'secondary_links'     => theme_get_setting('secondary_links'),
+    'secondary_links'     => menu_secondary_links(),
     'sidebar_left'        => $sidebar_left,
     'sidebar_right'       => $sidebar_right,
     'site_name'           => (theme_get_setting('toggle_name') ? variable_get('site_name', 'Drupal') : ''),
Index: themes/pushbutton/page.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/themes/pushbutton/page.tpl.php,v
retrieving revision 1.6
diff -u -p -r1.6 page.tpl.php
--- themes/pushbutton/page.tpl.php	7 Oct 2005 06:11:12 -0000	1.6
+++ themes/pushbutton/page.tpl.php	30 Oct 2005 10:45:09 -0000
@@ -34,7 +34,7 @@
     </td>
 
     <td class="primary-links" width="70%" align="center" valign="middle">
-      <?php print theme('links', $primary_links) ?>
+      <?php print $primary_links ?>
     </td>
   </tr>
 </table>
@@ -42,7 +42,7 @@
 <table id="secondary-menu" summary="Navigation elements." border="0" cellpadding="0" cellspacing="0" width="100%">
   <tr>
     <td class="secondary-links" width="75%"  align="center" valign="middle">
-      <?php print theme('links', $secondary_links) ?>
+      <?php print $secondary_links ?>
     </td>
     <td  width="25%"  align="center" valign="middle">
       <?php print $search_box ?>
@@ -102,18 +102,14 @@
 <table id="footer-menu" summary="Navigation elements." border="0" cellpadding="0" cellspacing="0" width="100%">
   <tr>
     <td align="center" valign="middle">
-    <?php if (is_array($primary_links)) : ?>
+    <?php if ($primary_links != "") : ?>
       <div class="primary-links">
-        <?php foreach ($primary_links as $link): ?>
-          <?php print $link?> |
-        <?php endforeach; ?>
+        <?php print $primary_links ?>
       </div>
     <?php endif; ?>
-    <?php if (is_array($secondary_links)) : ?>
+    <?php if ($secondary_links != "") : ?>
       <div class="secondary-links">
-        <?php foreach ($secondary_links as $link): ?>
-          <?php print $link?> |
-        <?php endforeach; ?>
+        <?php print $secondary_links ?>
       </div>
     <?php endif; ?>
     </td>
