Index: skinr_ui.rules.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/skinr/skinr_ui.rules.inc,v
retrieving revision 1.6
diff -u -p -F '^f' -r1.6 skinr_ui.rules.inc
--- skinr_ui.rules.inc	27 May 2010 14:07:17 -0000	1.6
+++ skinr_ui.rules.inc	23 Oct 2010 17:09:44 -0000
@@ -57,13 +57,7 @@ function skinr_rules() {
  */
 function skinr_rule_add($form, &$form_state) {
   $form = array();
-  $form['rule'] = array(
-    '#type' => 'fieldset',
-    '#title' => t('Skinr rule visibility'),
-    '#collapsible' => TRUE,
-    '#weight' => -1,
-  );
-  $form['rule']['title'] = array(
+  $form['title'] = array(
     '#type' => 'textfield',
     '#title' => t('Title'),
     '#default_value' => !empty($form_state['values']['title']) ? $form_state['values']['title'] : '',
@@ -71,15 +65,20 @@ function skinr_rule_add($form, &$form_st
     '#required' => TRUE,
   );
   
-  $regions = array();
-  foreach (list_themes() as $key => $theme) {
-    $regions += system_region_list($key);
-  }
   $options = array('page' => t('Page'));
-  foreach ($regions as $key => $region) {
-    $options['region__' . $key] = t('Region') . ': ' . $region;
+  foreach (list_themes() as $key => $theme) {
+    if (empty($theme->status)) {
+      continue;
+    }
+    $options_region = array();
+    // Create a list options containing visible regions of enabled themes.
+    foreach (system_region_list($key, REGIONS_VISIBLE) as $rkey => $region) {
+      $options_region['region__' . $rkey] = $region;
+    }
+    // Group the list of options by theme.
+    $options[$theme->info['name'] . ' ' . t('Regions')] = $options_region;
   }
-  $form['rule']['rule_type'] = array(
+  $form['rule_type'] = array(
     '#type' => 'select',
     '#title' => t('Type'),
     '#default_value' => !empty($form_state['values']['rule_type']) ? $form_state['values']['rule_type'] : '',
