Index: skinr_ui.admin.inc
===================================================================
--- skinr_ui.admin.inc	(revision 4571)
+++ skinr_ui.admin.inc	(working copy)
@@ -400,8 +400,12 @@
   // Store module list for use in the theme function.
   $form['skinsets'] = array('#type' => 'value', '#value' => $skinsets);
 
+  // Create storage for disabled skinsets as browser will disable checkboxes.
+  $form['disabled_skinsets'] = array('#type' => 'value', '#value' => array());
+
   $options = array();
   $status = array();
+  $disabled_skinsets = array();
   $incompatible_core = array();
   $incompatible_php = array();
 
@@ -433,6 +437,11 @@
         $incompatible_php[$skinset->name] = $skinset->info['php'];
       }
     }
+    
+    if ($skinset->type == 'theme') {
+      $disabled_skinsets[] = $skinset->name;
+      $form['disabled_skinsets']['#value'][$skinset->name] = TRUE;
+    }
 
     $form[$skinset->name]['operations'] = array(
       '#value' => l('configure', 'admin/build/skinr/skins/settings/'. $skinset->name),
@@ -443,6 +452,7 @@
     '#type' => 'checkboxes',
     '#options' => $options,
     '#default_value' => $status,
+    '#disabled_skinsets' => drupal_map_assoc($disabled_skinsets),
     '#incompatible_skinsets_core' => drupal_map_assoc($incompatible_core),
     '#incompatible_skinsets_php' => $incompatible_php,
   );
@@ -458,6 +468,24 @@
 }
 
 /**
+ * Form process callback function to disable check boxes.
+ *
+ * @param $form
+ *   The form structure.
+ * @param $edit
+ *   Not used.
+ * @ingroup forms
+ * @return
+ *   The form structure.
+ */
+function skinr_ui_skinsets_disable($form, $edit) {
+  foreach ($form['#disabled_skinsets'] as $key) {
+    $form[$key]['#attributes']['disabled'] = 'disabled';
+  }
+  return $form;
+}
+
+/**
  * Menu callback; displays a listing of all skins in a skinsets, allowing you
  * to enable or disable them individually for each theme.
  *
@@ -475,6 +503,7 @@
   }
 
   $themes = list_themes();
+  $use_themes = array();
   ksort($themes);
 
   foreach ($skinset->skins as $skin_name => $skin) {
@@ -486,10 +515,11 @@
     $status = array();
     $options = array();
     foreach ($themes as $theme) {
-      if (!$theme->status) {
+      if (!$theme->status || ($skinset->type == 'theme' && $skinset->name != $theme->name)) {
         continue;
       }
-
+      
+      $use_themes[$theme->name] = $theme->info['name'];
       $options[$theme->name] = '';
 
       if (!empty($skin['status'][$theme->name])) {
@@ -504,6 +534,7 @@
     );
   }
 
+  $form['#themes'] = $use_themes;
   $form['skinset'] = array(
     '#type' => 'value',
     '#value' => $skinset_name,
@@ -913,7 +944,10 @@
   $skinsets = $form['skinsets']['#value'];
   $packages = array();
   foreach ($skinsets as $skinset) {
-    if (!isset($skinset->info['package']) || !$skinset->info['package']) {
+    if ($skinset->type == 'theme') {
+      $skinset->info['package'] = t('Themes');
+    }
+    elseif (!isset($skinset->info['package']) || !$skinset->info['package']) {
       $skinset->info['package'] = t('Other');
     }
     $packages[$skinset->info['package']][$skinset->name] = $skinset->info;
@@ -950,6 +984,10 @@
         }
         $description .= '<div class="incompatible">'. t('This skinset requires PHP version @php_required and is incompatible with PHP version !php_version.', array('@php_required' => $php_required, '!php_version' => phpversion())) .'</div>';
       }
+      elseif (isset($form['status']['#disabled_skinsets'][$key])) {
+        $form['status'][$key]['#attributes']['disabled'] = 'disabled';
+        $status = drupal_render($form['status'][$key]);
+      }
       else {
         $status = drupal_render($form['status'][$key]);
       }
@@ -1000,11 +1038,7 @@
   $themes = list_themes();
   ksort($themes);
 
-  foreach ($themes as $theme) {
-    if (!$theme->status) {
-      continue;
-    }
-
+  foreach ($form['#themes'] as $theme_name => $theme_title) {
     $rows = array();
     foreach ($form as $key => $skin) {
       // Only look for skins.
@@ -1025,7 +1059,7 @@
       }
       $features = t('Used by: !features', array('!features' => implode(', ', $features)));
 
-      $status = drupal_render($form[$key]['status'][$theme->name]);
+      $status = drupal_render($form[$key]['status'][$theme_name]);
 
       // Style theme info
       $content = '<div class="skin-info"><h2>'. $title .'</h2><div class="description">'. $description .'</div><div class="features">'. $features .'</div></div>';
@@ -1039,14 +1073,17 @@
     }
 
     $fieldset = array(
-      '#title' => t($theme->info['name']),
+      '#title' => t($theme_title),
       '#collapsible' => TRUE,
-      '#collapsed' => $theme->name == $current_theme ? FALSE : TRUE,
+      '#collapsed' => $theme_name == $current_theme ? FALSE : TRUE,
       '#value' => theme('table', $header, $rows, array('class' => 'theme')),
     );
     $output .= theme('fieldset', $fieldset);
   }
 
+  if (empty($output)) {
+    $output .= t('This theme is disabled.');
+  }
   $output .= drupal_render($form);
   return $output;
 }
Index: docs/docs.php
===================================================================
--- docs/docs.php	(revision 4571)
+++ docs/docs.php	(working copy)
@@ -102,6 +102,7 @@
   return array(
     'api' => 1,
     'path' => drupal_get_path('module', 'modulename'),
+    'skins' => FALSE,
   );
 }
Index: skinr.module
===================================================================
--- skinr.module	(revision 4571)
+++ skinr.module	(working copy)
@@ -625,32 +625,7 @@
 }
 
 /**
- * Retrieves all the Skinr skins from theme parents. Theme skins
- * will override any skins of the same name from its parents.
- */
-function skinr_inherited_skins($theme) {
-  $themes = _system_theme_data();
-
-  $all_skins = $skins = array();
-  $base_theme = (!empty($themes[$theme]->info['base theme'])) ? $themes[$theme]->info['base theme'] : '';
-  while ($base_theme) {
-    // Add in path info here.
-    $base_skins = (!empty($themes[$base_theme]->info['skinr'])) ? (array)$themes[$base_theme]->info['skinr'] : array();
-    $base_path  = $path_root = dirname($themes[$base_theme]->filename);
-    _skinr_add_paths_to_files($base_skins, $base_path);
-
-    $all_skins[] = $base_skins;
-    $base_theme = (!empty($themes[$base_theme]->info['base theme'])) ? $themes[$base_theme]->info['base theme'] : '';
-  }
-  array_reverse($all_skins);
-  foreach ($all_skins as $new_skin) {
-    $skins = array_merge($skins, $new_skin);
-  }
-  return $skins;
-}
-
-/**
- * Helper function to scan and collect skin .info data.
+ * Helper function to scan and collect skin .skinr data.
  *
  * @return
  *   An associative array of skins information.
@@ -660,16 +635,25 @@
 
   if (empty($skins_info)) {
     // Find skins.
-    $mask = '\.info$';
+    $mask = '\.skinr$';
     $directory = 'skins';
     $skinsets = drupal_system_listing($mask, $directory);
 
     // Find skins in theme folders.
     $themes = _system_theme_data();
     foreach ($themes as $theme) {
-      $dir = dirname($theme->filename) .'/'. $directory;
-      $skinsets = array_merge($skinsets, file_scan_directory($dir, $mask, array('.', '..', 'CVS'), 0, TRUE, 'name', 1));
+      $dir = dirname($theme->filename);
+      $skinsets = array_merge($skinsets, file_scan_directory($dir, $mask, array('.', '..', 'CVS'), 0, TRUE, 'name'));
+      // @todo Need to set a boolean marking that this skinset is disabled if the theme is disabled.
     }
+ 
+    // Find skins in module folders.
+    foreach (skinr_get_module_apis() as $module => $info) {
+      if (!empty($info['skins'])) {
+        $dir = dirname($info['path']);
+        $skinsets = array_merge($skinsets, file_scan_directory($dir, $mask, array('.', '..', 'CVS'), 0, TRUE, 'name'));
+      }
+    }
 
     $defaults = skinr_skins_default();
 
@@ -680,9 +664,12 @@
       if (!empty($skinsets[$key]->info['screenshot'])) {
         $skinsets[$key]->info['screenshot'] = dirname($skinsets[$key]->filename) .'/'. $skinsets[$key]->info['screenshot'];
       }
-
+      
+      // Give all css and js files proper path information.
+      _skinr_add_paths_to_files($skinsets[$key]->info['skinr'], dirname($skinsets[$key]->filename));
+      
       // Invoke hook_skinr_info_alter() to give installed modules a chance to
-      // modify the data in the .info files if necessary.
+      // modify the data in the .skinr files if necessary.
       drupal_alter('skinr_info', $skinsets[$key]->info, $skinsets[$key]);
     }
 
@@ -693,7 +680,7 @@
 }
 
 /**
- * Helper function to process a skin or theme .info file.
+ * Helper function to process a .skinr file.
  *
  * @return
  *    A skinset.
@@ -726,16 +713,6 @@
       }
     }
 
-    // Inherit skins from parent theme, if inherit_skins is set to true.
-    if (!empty($skinset['options']['inherit_skins'])) {
-      // Add paths to $skinr_info.
-      _skinr_add_paths_to_files($skinr_info, $path_root);
-      // Paths get automatically added to base theme info.
-      $base_info  = skinr_inherited_skins($info->name);
-      // Merge base theme and current.
-      $skinr_info = array_merge($base_info, $skinr_info);
-    }
-
     $defaults = skinr_skin_default();
 
     foreach ($skinr_info as $id => $skin) {
@@ -789,7 +766,7 @@
 }
 
 /**
- * Helper function to prepend a path to an array of stylesheets or scripts in a .info file.
+ * Helper function to prepend a path to an array of stylesheets or scripts in a .skinr file.
  *
  * @param $files
  *   A an array of filenames that need the path prepended.
@@ -824,7 +801,7 @@
 }
 
 /**
- * Helper function to process an array of skins or themes .info files.
+ * Helper function to process an array of skins or themes .skinr files.
  *
  * @param $type
  *   Either 'theme' or 'skinset'.
@@ -841,39 +818,51 @@
     $skinsets[$type] = array();
   }
 
-  $themes = _system_theme_data();
+  $themes = list_themes();
 
   if (empty($list[$type])) {
-    if ($type == 'theme') {
-      foreach ($themes as $theme) {
-        $skinset = new StdClass();
-        $skinset->filename = $theme->filename;
-        $skinset->name = $theme->name;
-        $skinset->status = $theme->status ? 1 : 0;
-        $skinset->info = $theme->info;
+    $result = db_query("SELECT * FROM {skinr_skinsets}");
+    while ($skinset = db_fetch_object($result)) {
+      if (file_exists($skinset->filename)) {
+        $skinset->info = unserialize($skinset->info);
 
         $skinsets[$type][$skinset->name] = $skinset;
       }
     }
-    elseif ($type == 'skinset') {
-      $result = db_query("SELECT * FROM {skinr_skinsets}");
-      while ($skinset = db_fetch_object($result)) {
-        if (file_exists($skinset->filename)) {
-          $skinset->info = unserialize($skinset->info);
 
-          $skinsets[$type][$skinset->name] = $skinset;
-        }
-      }
-    }
-
     $default_status = array();
     foreach ($themes as $theme) {
       $default_status[$theme->name] = $theme->name;
     }
 
     foreach ($skinsets[$type] as $key => $skinset) {
-      $skinset->type = $type;
+      if (isset($themes[$key])) {
+        $skinset->type = 'theme';
+        $skinset->status = $theme->status ? 1 : 0;
+      }
+      else {
+        $skinset->type = 'skinset';
+      }
 
+      // Inherit skins from base theme, if inherit_skins is set to true.
+      if (!empty($skinset->info['skinr']['options']['inherit_skins'])) {
+        // Merge base theme and current.
+        $inheriting = TRUE;
+        $merged_skins = array();
+        $current_skinset = $skinset;
+        while ($inheriting) {
+          $inheriting = FALSE;
+          if (!empty($current_skinset->info['base theme'])) {
+            if (!empty($skinsets[$type][$current_skinset->info['base theme']])) {
+              $current_skinset = $skinsets[$type][$current_skinset->info['base theme']];
+              $merged_skins = array_merge($current_skinset->info['skinr'], $merged_skins);
+              $inheriting = TRUE;
+            }
+          }
+        }
+        $skinset->info['skinr'] = array_merge($merged_skins, $skinset->info['skinr']);
+      }
+
       $additional = _skinr_skinset($skinset);
       $skinset->options = $additional['options'];
       $skinset->skins = $additional['skins'];
@@ -926,6 +915,17 @@
   $skinsets = _skinr_skins_data();
   skinr_get_files_database($skinsets);
 
+  $themes = list_themes();
+  foreach ($skinsets as $key => $skinset) {
+    if (isset($themes[$key])) {
+      $skinset->status = $themes[$key]->status ? 1 : 0;
+      $skinset->type = 'theme';
+    }
+    else {
+      $skinset->type = 'skinset';
+    }
+  }
+
   db_query("DELETE FROM {skinr_skinsets}");
 
   foreach ($skinsets as $skinset) {
@@ -976,20 +976,21 @@
   static $cache = NULL;
 
   if (is_null($cache)) {
-    $skins_skinsets  = skinr_skinsets('skinset');
-    $themes_skinsets = skinr_skinsets('theme');
+    $skinsets = skinr_skinsets('skinset');
 
     // Need to merge all skins skinsets into a single list of skins.
     // Also merge in the groups information.
     $additional_skins = array();
     $groups = array();
-    foreach ($skins_skinsets as $key => $skinset) {
-      if (!empty($skinset->skins) && $skinset->status == 1) {
-        $additional_skins += $skinset->skins;
+    foreach ($skinsets as $key => $skinset) {
+      if ($skinset->type == 'skinset') {
+        if (!empty($skinset->skins) && $skinset->status == 1) {
+          $additional_skins += $skinset->skins;
+        }
+        if (!empty($skinset->options['groups'])) {
+          $groups += $skinset->options['groups'];
+        }
       }
-      if (!empty($skinset->options['groups'])) {
-        $groups += $skinset->options['groups'];
-      }
     }
 
     // Merge the additional skins into each theme, even if that theme has no
@@ -1000,16 +1001,18 @@
         continue;
       }
 
-      if (isset($themes_skinsets[$theme->name])) {
-        $cache[$theme->name] = $themes_skinsets[$theme->name];
+      if (!empty($skinsets[$theme->name])) {
+        $cache[$theme->name] = $skinsets[$theme->name];
         $cache[$theme->name]->skins += $additional_skins;
         $cache[$theme->name]->options['groups'] += $groups;
       }
       else {
-        $cache[$theme->name] = array(
-          'options' => array('groups' => $groups),
-          'skins' => $additional_skins,
-        );
+        $cache[$theme->name] = new StdClass();
+        $cache[$theme->name]->name = $theme->name;
+        $cache[$theme->name]->status = 1;
+        $cache[$theme->name]->type = 'theme';
+        $cache[$theme->name]->skins = $additional_skins;
+        $cache[$theme->name]->options = array('groups' => $groups);
       }
     }
   }
