Index: panelsblock.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/panelsblock/panelsblock.module,v
retrieving revision 1.4
diff -u -p -r1.4 panelsblock.module
--- panelsblock.module	30 May 2007 22:46:20 -0000	1.4
+++ panelsblock.module	31 May 2007 00:20:08 -0000
@@ -33,7 +33,7 @@ function panelsblock_form_alter($form_id
       '#title' => t('Display area'),
       '#default_value' => $blocks[$form['did']['#value']] && $blocks[$form['did']['#value']]['area'] ? $blocks[$form['did']['#value']]['area'] : (array_key_exists(PANELSBLOCK_DEFAULT_AREA, $options) ? PANELSBLOCK_DEFAULT_AREA : ''),
       '#options' => $options,
-      '#description' => t('Select the area that will be displayed.'),
+      '#description' => t('Select the area that will be displayed. Note that if you chose tabs, <em>all</em> areas will be displayed as tabs.'),
     );
     $form['panelsblock']['expose_style'] = array(
       '#type' => 'radios',
@@ -107,15 +107,29 @@ function panelsblock_get_block($did) {
   $content = array();
   panelsblock_load_content_types();
 
-  $display_area = !empty($blocks[$did]['area']) ? $blocks[$did]['area'] : PANELSBLOCK_DEFAULT_AREA;
+  // We only want to display a specific area if we're not using tabs.
+  if ($blocks[$did]['style'] == 'default') {
+    $display_area = !empty($blocks[$did]['area']) ? $blocks[$did]['area'] : PANELSBLOCK_DEFAULT_AREA;
+  }
 
   foreach ($panels->content as $location => $list) {
     foreach ($list as $area) {
-      if ($area->area == $display_area) {
-        $function = $content_types[$area->type]['callback'] .'_block';
-        if (function_exists($function)) {
-          $content[] = $function($area->configuration);
-        }
+      switch ($blocks[$did]['style']) {
+        case 'default':
+          if ($area->area == $display_area) {
+            $function = $content_types[$area->type]['callback'] .'_block';
+            if (function_exists($function)) {
+              $content[] = $function($area->configuration);
+            }
+          }
+          break;
+        case 'tabs':
+          $function = $content_types[$area->type]['callback'] .'_block';
+          if (function_exists($function)) {
+            $content[] = $function($area->configuration);
+          }
+          drupal_add_css(drupal_get_path('module', 'panelsblock') .'/panelsblock.css');
+          break;
       }
     }
   }
