Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.232
diff -u -F^f -r1.232 theme.inc
--- includes/theme.inc	4 May 2005 18:12:17 -0000	1.232
+++ includes/theme.inc	4 May 2005 19:13:30 -0000
@@ -289,12 +289,38 @@ function theme_get_setting($setting_name
       }
     }
 
-    if (!$settings['toggle_primary_links']) {
-      $settings['primary_links'] = '';
-    }
-
-    if (!$settings['toggle_secondary_links']) {
-      $settings['secondary_links'] = '';
+    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);
+      $count = ($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="'. $link .'"'. drupal_attributes($attributes) .'>'. $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'));
+        }
+      }
     }
   }
 
Index: modules/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system.module,v
retrieving revision 1.207
diff -u -F^f -r1.207 system.module
--- modules/system.module	4 May 2005 18:12:17 -0000	1.207
+++ modules/system.module	4 May 2005 19:13:30 -0000
@@ -658,20 +658,20 @@ function system_theme_settings($key = ''
       $group = '';
       $rows = array();
 
-      //Use $utype field , and strtolower() it to get the type field.. to avoid issues with ucfirst() and unicode.
+      // Use $utype field , and strtolower() it to get the type field.. to avoid issues with ucfirst() and unicode.
       $type = strtolower($utype);
-      $value = theme_get_setting($type . '_links');
+      $value = $settings[$type . '_links'];
       if (!is_array($value)) {
         $value = array();
       }
 
-      //Increment the link count, if the user has requested more links.
+      // 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.
+      // 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) {
Index: themes/bluemarine/page.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/themes/bluemarine/page.tpl.php,v
retrieving revision 1.1
diff -u -F^f -r1.1 page.tpl.php
--- themes/bluemarine/page.tpl.php	4 May 2005 18:12:17 -0000	1.1
+++ themes/bluemarine/page.tpl.php	4 May 2005 19:13:37 -0000
@@ -20,8 +20,8 @@
 
     </td>
     <td id="menu">
-      <div id="secondary"><?php print (is_array($secondary_links) && count($secondary_links) > 0) ? theme('links', $secondary_links) : l(t('edit secondary links'),'admin/themes/settings') ?></div>
-      <div id="primary"><?php print (is_array($primary_links) && count($primary_links) > 0) ? theme('links', $primary_links) : l(t('edit primary links'), 'admin/themes/settings') ?></div>
+      <div id="secondary"><?php print theme('links', $secondary_links) ?></div>
+      <div id="primary"><?php print theme('links', $primary_links) ?></div>
       <?php if ($search_box) { ?><form action="<?php print $search_url ?>" method="post">
         <div id="search">
           <input class="form-text" type="text" size="15" value="" name="keys" alt="<?php print $search_description ?>" />
@@ -43,7 +43,7 @@
         <?php print $breadcrumb ?>
         <h1 class="title"><?php print $title ?></h1>
         <div class="tabs"><?php print $tabs ?></div>
-        <div id="help"><?php print $help ?></div>
+        <?php print $help ?>
         <?php print $messages ?>
 
         <?php print $content; ?>
Index: themes/bluemarine/style.css
===================================================================
RCS file: /cvs/drupal/drupal/themes/bluemarine/style.css,v
retrieving revision 1.8
diff -u -F^f -r1.8 style.css
--- themes/bluemarine/style.css	4 May 2005 18:12:17 -0000	1.8
+++ themes/bluemarine/style.css	4 May 2005 19:13:38 -0000
@@ -14,7 +14,7 @@
   padding: 0.3em;
 }
 h1, h2, h3, h4, h5, h6 {
-  margin: 0.5;
+  margin-bottom: 0.5em;
 }
 h1 {
   font-size: 1.3em;
@@ -25,6 +25,10 @@
 h3, h4, h5, h6 {
   font-size: 1.1em;
 }
+p {
+  margin-top: 0.5em;
+  margin-bottom: 0.9em;
+}
 a {
   text-decoration: none;
   font-weight: bold;
@@ -83,6 +87,7 @@ fieldset {
 #logo img {
   float: left;
   padding: 0em 1.0em 0em 1em;
+  border: 0;
 }
 #menu {
   padding: 0.5em 0.5em 0 0.5em;
Index: themes/chameleon/chameleon.theme
===================================================================
RCS file: /cvs/drupal/drupal/themes/chameleon/chameleon.theme,v
retrieving revision 1.26
diff -u -F^f -r1.26 chameleon.theme
--- themes/chameleon/chameleon.theme	30 Apr 2005 17:47:57 -0000	1.26
+++ themes/chameleon/chameleon.theme	4 May 2005 19:13:38 -0000
@@ -43,8 +43,8 @@ function chameleon_page($content) {
 
   $output .= "</div>\n";
 
-  $primary_links = theme_get_setting('primary_links');
-  $secondary_links = theme_get_setting('secondary_links');
+  $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.1
diff -u -F^f -r1.1 phptemplate.engine
--- themes/engines/phptemplate/phptemplate.engine	4 May 2005 18:12:17 -0000	1.1
+++ themes/engines/phptemplate/phptemplate.engine	4 May 2005 19:13:38 -0000
@@ -119,37 +119,6 @@ function phptemplate_page($content) {
     $frontpage = true;
   }
 
-  $links['primary'] = array();
-  $links['secondary'] = array();
-
-  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 = theme_get_setting($type . '_links');
-
-    //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 (theme_get_setting('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, 4) == 'http') {
-            $links[$type][] = '<a href="'. $link .'"'. drupal_attributes($attributes) .'>'. $text .'</a>';
-          }
-          else {
-            $links[$type][] = l($text, $link, $attributes);
-          }
-        }
-      }
-    }
-  }
-
   /**
   * Populate sidebars.
   */
@@ -185,8 +154,8 @@ function phptemplate_page($content) {
     'search_button_text'  => t('search'),
     'search_description'  => t('Enter the terms you wish to search for.'),
     'title'               => drupal_get_title(),
-    'primary_links'       => $links['primary'],
-    'secondary_links'     => $links['secondary'],
+    'primary_links'       => theme_get_setting('primary_links'),
+    'secondary_links'     => theme_get_setting('secondary_links'),
     'breadcrumb'          => theme('breadcrumb', drupal_get_breadcrumb()),
     'tabs'                => theme('menu_local_tasks'),
     'messages'            => theme('status_messages'),
