? 569568_rootcandy_top_navigation.patch
? images/tooltip
Index: theme-settings.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/themes/rootcandy/theme-settings.php,v
retrieving revision 1.6.2.16
diff -u -p -r1.6.2.16 theme-settings.php
--- theme-settings.php	20 Jun 2009 16:53:25 -0000	1.6.2.16
+++ theme-settings.php	10 Sep 2009 19:22:57 -0000
@@ -111,6 +111,7 @@ function rootcandy_settings($saved_setti
 
   $primary_options = array_merge($primary_options, menu_get_menus());
   $roles = user_roles(FALSE);
+  $max_weight = 0;
   foreach ($roles as $rid => $role) {
     if (empty($settings['rootcandy_navigation_source_'. $rid])) $settings['rootcandy_navigation_source_'. $rid] = '';
 
@@ -120,6 +121,13 @@ function rootcandy_settings($saved_setti
       '#options' => $primary_options,
       '#tree' => FALSE,
     );
+
+    // check the highest weight for later use
+    if (isset($settings['role-weight-'. $rid])) {
+      if ($max_weight < $settings['role-weight-'. $rid]) {
+        $max_weight = $settings['role-weight-'. $rid];
+      }
+    }
   }
 
   $form['navigation']['custom-icons'] = array(
@@ -152,11 +160,11 @@ function rootcandy_settings($saved_setti
     '#default_value' => $settings['rootcandy_help_display'],
   );
 
-  $i = 100;
+  $max_weight = (isset($max_weight)) ? $max_weight : 100;
   foreach ($roles as $rid => $role) {
     if (empty($settings['role-weight-'. $rid])) $settings['role-weight-'. $rid] = '';
     if (!$weight = $settings['role-weight-'. $rid]) {
-      $weight = $i++;
+      $weight = ++$max_weight;
     }
     $data = array($role);
     $form['rows'][$rid]['data'] = array('#type' => 'value', '#value' => $data);
Index: rootcandy_dark/theme-settings.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/themes/rootcandy/rootcandy_dark/Attic/theme-settings.php,v
retrieving revision 1.1.2.10
diff -u -p -r1.1.2.10 theme-settings.php
--- rootcandy_dark/theme-settings.php	20 Jun 2009 16:53:26 -0000	1.1.2.10
+++ rootcandy_dark/theme-settings.php	10 Sep 2009 19:22:58 -0000
@@ -111,6 +111,7 @@ function rootcandy_dark_settings($saved_
 
   $primary_options = array_merge($primary_options, menu_get_menus());
   $roles = user_roles(FALSE);
+  $max_weight = 0;
   foreach ($roles as $rid => $role) {
     if (empty($settings['rootcandy_navigation_source_'. $rid])) $settings['rootcandy_navigation_source_'. $rid] = '';
 
@@ -120,6 +121,13 @@ function rootcandy_dark_settings($saved_
       '#options' => $primary_options,
       '#tree' => FALSE,
     );
+
+    // check the highest weight for later use
+    if (isset($settings['role-weight-'. $rid])) {
+      if ($max_weight < $settings['role-weight-'. $rid]) {
+        $max_weight = $settings['role-weight-'. $rid];
+      }
+    }
   }
 
   $form['navigation']['custom-icons'] = array(
@@ -152,11 +160,11 @@ function rootcandy_dark_settings($saved_
     '#default_value' => $settings['rootcandy_help_display'],
   );
 
-  $i = 100;
+  $max_weight = (isset($max_weight)) ? $max_weight : 100;
   foreach ($roles as $rid => $role) {
     if (empty($settings['role-weight-'. $rid])) $settings['role-weight-'. $rid] = '';
     if (!$weight = $settings['role-weight-'. $rid]) {
-      $weight = $i++;
+      $weight = ++$max_weight;
     }
     $data = array($role);
     $form['rows'][$rid]['data'] = array('#type' => 'value', '#value' => $data);
Index: rootcandy_fixed/theme-settings.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/themes/rootcandy/rootcandy_fixed/Attic/theme-settings.php,v
retrieving revision 1.1.2.9
diff -u -p -r1.1.2.9 theme-settings.php
--- rootcandy_fixed/theme-settings.php	20 Jun 2009 16:53:26 -0000	1.1.2.9
+++ rootcandy_fixed/theme-settings.php	10 Sep 2009 19:22:59 -0000
@@ -111,6 +111,7 @@ function rootcandy_fixed_settings($saved
 
   $primary_options = array_merge($primary_options, menu_get_menus());
   $roles = user_roles(FALSE);
+  $max_weight = 0;
   foreach ($roles as $rid => $role) {
     if (empty($settings['rootcandy_navigation_source_'. $rid])) $settings['rootcandy_navigation_source_'. $rid] = '';
 
@@ -120,6 +121,13 @@ function rootcandy_fixed_settings($saved
       '#options' => $primary_options,
       '#tree' => FALSE,
     );
+
+    // check the highest weight for later use
+    if (isset($settings['role-weight-'. $rid])) {
+      if ($max_weight < $settings['role-weight-'. $rid]) {
+        $max_weight = $settings['role-weight-'. $rid];
+      }
+    }
   }
 
   $form['navigation']['custom-icons'] = array(
@@ -152,11 +160,11 @@ function rootcandy_fixed_settings($saved
     '#default_value' => $settings['rootcandy_help_display'],
   );
 
-  $i = 100;
+  $max_weight = (isset($max_weight)) ? $max_weight : 100;
   foreach ($roles as $rid => $role) {
     if (empty($settings['role-weight-'. $rid])) $settings['role-weight-'. $rid] = '';
     if (!$weight = $settings['role-weight-'. $rid]) {
-      $weight = $i++;
+      $weight = ++$max_weight;
     }
     $data = array($role);
     $form['rows'][$rid]['data'] = array('#type' => 'value', '#value' => $data);
