Index: contributions/modules/panels_tabs/panels_tabs.info
--- contributions/modules/panels_tabs/panels_tabs.info Base (1.1)
+++ contributions/modules/panels_tabs/panels_tabs.info Locally Modified (Based On 1.1)
@@ -2,4 +2,6 @@
 name = Tabs Panel Style
 description = Tabs Panel style.
 package = Panel Styles
-dependencies = panels tabs
+dependencies[] = panels
+dependencies[] = tabs
+dependencies[] = ctools
Index: contributions/modules/panels_tabs/panels_tabs.module
--- contributions/modules/panels_tabs/panels_tabs.module Base (1.1)
+++ contributions/modules/panels_tabs/panels_tabs.module Locally Modified (Based On 1.1)
@@ -1,50 +1,10 @@
 <?php
-// $Id $
 
 /**
- * @file
- * This module provides a configurable "tabs" panel style that can be used
- * by any Panels module.
+  * Implementation of hook_ctools_plugin_directory().
  */
-
-//----------------------------------------------------------------------------
-// Panels hooks.
-
-/**
- * Implementation of hook_panels_panel_style_info().
- */
-function panels_tabs_panels_panel_style_info() {
-  return array(
-    'tabs' => array(
-      'label' => t('Tabs'),
-      'panels implementations' => array(),
-    ),
-  );
+function panels_tabs_ctools_plugin_directory($module, $plugin) {
+  if ($module == 'panels' && $plugin == 'styles') {
+    return 'plugins/' . $plugin;
 }
-
-/**
- * Implementation of hook_panels_panel_style_render().
- */
-function panels_tabs_panels_panel_style_render($display, $style, $panel_id, $panes) {
-  $output = '';
-
-  switch ($style) {
-    case 'tabs':
-      $tabs = array();
-
-      $tabs["panels-mini-$panel_id"] = array(
-        '#type' => 'tabset',
-      );
-      foreach ($panes as $pos => $pane) {
-        $tabs["panels-mini-$panel_id"]["tab_$pos"] = array(
-          '#type' => 'tabpage',
-          '#title' => $pane->subject,
-          '#content' => $pane->content,
-        );
       }
-      $output = tabs_render($tabs);
-      break;
-  }
-  
-  return $output;
-}
Index: contributions/modules/panels_tabs/plugins/styles/tabs.inc
--- contributions/modules/panels_tabs/plugins/styles/tabs.inc No Base Revision
+++ contributions/modules/panels_tabs/plugins/styles/tabs.inc Locally New
@@ -0,0 +1,133 @@
+<?php
+
+/**
+ * Implementation of hook_panels_style_info().
+ */
+function panels_tabs_tabs_panels_styles() {
+  return array(
+    'title'             => t('Tabs'),
+    'description'       => t('Presents the panes in tabs.'),
+    'render panel'      => 'panels_tabs_style_render_panel',
+    'settings form'     => 'panels_tabs_style_settings_form',
+    'settings validate' => 'panels_tabs_style_settings_validate',
+    'hook theme' => array(
+      'panels_tabs_style_render_panel' => array(
+        'arguments' => array('content' => NULL),
+      ),
+    ),
+  );
+}
+
+//----------------------------------------------------------------------------
+// Panels style plugin callbacks.
+
+/**
+ * Render callback.
+ */
+function theme_panels_tabs_style_render_panel($display, $owner_id, $panes, $settings) {
+  $output = '';
+
+  // Generate a unique id based on the CSS ID and the name of the panel in the
+  // layout.
+  $pane_id = reset(array_keys($panes));
+  $panel = $display->content[$pane_id]->panel;
+  $id = "$display->css_id-$panel";
+
+  // Add the Javascript to the page, and save the settings for this panel.
+  _panels_tabs_add_js($id, $settings['filling_tabs']);
+
+  $tabs = array();
+  $tabs[$id] = array(
+    '#type' => 'tabset',
+  );
+  $index = 0;
+  foreach ($panes as $pane_id => $content) {
+    // Remove the title from the content. We don't want titles in both the tab
+    // and the content associated with the tab.
+    if ($content->content) {
+      $content_without_title = drupal_clone($content);
+      unset($content_without_title->title);
+
+      $tabs[$id][$pane_id] = array(
+        '#type'    => 'tabpage',
+        '#title'   => $content->title,
+        '#content' => theme('panels_pane', $content_without_title, $display->content[$pane_id], $display),
+        '#weight'  => $index,
+      );
+      $index++;
+    }
+  }
+  $output = tabs_render($tabs);
+
+  return $output;
+}
+
+/**
+ * Settings form callback.
+ */
+function panels_tabs_style_settings_form($settings) {
+  $form['filling_tabs'] = array(
+    '#type' => 'radios',
+    '#title' => t('Horizontally filling tabs'),
+    '#options' => array(
+      'disabled' => t('Disabled'),
+      'equal' => t('Equal width tabs'),
+      'smart' => t('Equal width scaling tabs'),
+    ),
+    '#description' => t(
+      "Horizontally filling tabs make sure the tabs consume all available
+      horizontal space.<br />
+      Equal width tabs: sets the <em>width</em> property, forcing each tab
+      to be equally wide. If the text doesn't fit in the tab, the overflow
+      will be hidden.<br />
+      Horizontally filling, smart width tabs: calculates the length of the
+      text in each tab and compares this to the total length of the text on
+      all tabs. It then sets the width property of each tab according to the
+      percentage of text the tab contains."
+    ),
+    '#default_value' => (isset($settings['filling_tabs'])) ? $settings['filling_tabs'] : 'disabled',
+  );
+  return $form;
+}
+
+/**
+ * Settings form validation callback.
+ */
+function panels_tabs_style_settings_validate($form, &$form_state) {
+  if (!in_array($form_state['values']['filling_tabs'], array('disabled', 'equal', 'smart'))) {
+    form_error($form_state['values']['filling_tabs'], t('Invalid value detected.'));
+  }
+}
+
+
+//----------------------------------------------------------------------------
+// Private functions.
+
+/**
+ * Adds the .js file only once per page load.
+ */
+function _panels_tabs_add_js($id, $filling_tabs) {
+  static $added = FALSE;
+  static $settings_added;
+
+  // Include the JavaScript once per page.
+  if (!$added) {
+    drupal_add_js(drupal_get_path('module', 'panels_tabs') .'/panels_tabs.js');
+    $added = TRUE;
+  }
+
+  // Store the JavaScript settings for every panel that uses this style.
+  if (!isset($settings_added[$id])) {
+    drupal_add_js(
+      array(
+        'panelsTabs' => array(
+          $id => array(
+            'fillingTabs' => (isset($filling_tabs)) ? $filling_tabs : 'disabled',
+          ),
+        )
+      ),
+      'setting'
+    );
+    $settings_added[$id] = TRUE;
+  }
+}
