? LICENSE.txt
? views_tabs.patch
Index: views_tabs.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views_tabs/views_tabs.info,v
retrieving revision 1.1
diff -u -p -r1.1 views_tabs.info
--- views_tabs.info	7 Aug 2007 16:40:56 -0000	1.1
+++ views_tabs.info	13 Nov 2008 22:14:51 -0000
@@ -1,5 +1,7 @@
-; $Id $
-name = Views Tabs
-description = Enables the presentation of views through tabs.
-package = Views
-dependencies = views tabs
+; $Id $
+name = Views Tabs
+description = Enables the presentation of views through tabs.
+package = Views
+dependencies[] = views 
+dependencies[] = tabs
+core = 6.x
Index: views_tabs.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views_tabs/views_tabs.module,v
retrieving revision 1.2
diff -u -p -r1.2 views_tabs.module
--- views_tabs.module	7 Aug 2007 17:59:43 -0000	1.2
+++ views_tabs.module	13 Nov 2008 22:14:51 -0000
@@ -9,19 +9,15 @@
 /**
  * Implementation of hook_menu()
  */
-function views_tabs_menu($may_cache) {
+function views_tabs_menu() {
   $items = array();
-
-  if ($may_cache) {
-    $items[] = array(
-      'path' => 'admin/settings/views-tabs',
-      'title' => t('Views Tabs'),
-      'description' => t('Set display options.'),
-      'callback' => 'drupal_get_form',
-      'callback arguments' => array('views_tabs_admin_settings'),
-      'access' => user_access('administer site configuration'),
-    );
-  }
+  $items['admin/settings/viewstabs'] = array(
+    'title' => 'Views Tabs',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('views_tabs_admin_settings'),
+    'access arguments' => array('administer site configuration'),
+    'type' => MENU_LOCAL_TASK,
+  );
 
   return $items;
 }
@@ -46,38 +42,10 @@ function views_tabs_admin_settings() {
 }
 
 /**
- *  Implementation of hook_views_style_plugins()
- */
-function views_tabs_views_style_plugins() {
-  $plugins = array();
-
-  $plugins['tabs_fields'] = array(
-    'name' => t('Tabs - Fields'),
-    'theme' => 'views_tabs_display',
-    // Reuse the validation for lists as this covers
-    // the needed functionality.
-    'validate' => 'views_ui_plugin_validate_list',
-    'needs_fields' => TRUE,
-    'needs_table_header' => FALSE,
-  );
-  $plugins['tabs_teaser'] = array(
-    'name' => t('Tabs - Teaser List'),
-    'theme' => 'views_tabs_display',
-  );
-  $plugins['tabs_node'] = array(
-    'name' => t('Tabs - Full Nodes'),
-    'theme' => 'views_tabs_display',
-  );
-
-  return $plugins;
-}
-
-/**
  * Display the nodes of a view on tabs.
  */
 function theme_views_tabs_display($view, $nodes, $type, $teasers = FALSE, $links = TRUE) {
-  $fields = _views_get_fields();
-
+  // $fields = _views_get_fields();
   $tabset = array(
     '#type' => 'tabset',
   );
@@ -119,3 +87,18 @@ function theme_views_tabs_display($view,
     return tabs_render($tabset);
   }
 }
+
+function views_tabs_display_theme() {
+  return array(
+    'views_tabs_display_format' => array(
+      'arguments' => array('view', 'nodes', 'type', 'teasers', 'links'),
+    ),
+  );
+}
+
+function views_tabs_views_api() {
+  return array(
+    'api' => 2,
+    'path' => drupal_get_path('module', 'views_tabs') .'/includes',
+  );
+}
Index: includes/views_tabs.views.inc
===================================================================
RCS file: includes/views_tabs.views.inc
diff -N includes/views_tabs.views.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ includes/views_tabs.views.inc	13 Nov 2008 22:14:51 -0000
@@ -0,0 +1,36 @@
+<?php
+
+function views_tabs_views_handlers() {
+  return array(
+    'info' => array(
+      'path' => drupal_get_path('module', 'views_tabs') .'/includes',
+    ),
+    'handlers' => array(
+      'views_tabs_plugin_style' => array(
+        'parent' => 'views_plugin_style',
+      ),
+    ),
+  );
+}
+
+/**
+ *  Implementation of hook_views_style_plugins()
+ */
+function views_tabs_views_plugins() {
+  $plugins = array(
+    'style' => array(
+      'tabs_fields' => array(
+        'title' => t('Tabs fields'),
+        'help' => t('Output fields to a tabs'),
+        'handler' => 'views_tabs_plugin_style',
+        'path' => drupal_get_path('module', 'views_tabs') . '/includes',
+        'theme' => 'views_view_fields',
+        'uses row plugin' => TRUE,
+        'uses options' => TRUE,
+        'uses grouping' => FALSE,
+        'type' => 'normal',
+      ),
+    ),
+  );
+  return $plugins;
+}
Index: includes/views_tabs_plugin_style.inc
===================================================================
RCS file: includes/views_tabs_plugin_style.inc
diff -N includes/views_tabs_plugin_style.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ includes/views_tabs_plugin_style.inc	13 Nov 2008 22:14:51 -0000
@@ -0,0 +1,27 @@
+<?php
+
+class views_tabs_plugin_style extends views_plugin_style {
+
+  function options(&$options) {
+    parent::options($options);
+  }
+  
+  function render() {
+    $tabset = array(
+      '#type' => 'tabset',
+    );
+ 
+    foreach ($this->view->result as $row) {
+      $content = theme($this->theme_functions(), $this->view, $this->options, $row);
+      $tab = $row->node_title;
+      $tabset[$tab] = array(
+        '#type' => 'tabpage',
+        '#content' => $content,
+        '#title' => $tab,
+        '#attributes' => array('class' => 'node-'. $row->nid),
+      );
+    }
+     // print_r($tabset); die;
+    return tabs_render($tabset); 
+  }
+}
