Index: magic_tabs.example.inc
===================================================================
RCS file: magic_tabs.example.inc
diff -N magic_tabs.example.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ magic_tabs.example.inc	10 Oct 2008 18:14:09 -0000
@@ -0,0 +1,46 @@
+<?php
+//$Id$
+
+/**
+ * Example callback function
+ */
+function magic_tabs_example_callback($active = 0, $a1, $a2) {
+  $tabs[] = array(
+    'title' => t('First magic tab'),
+    'content' => t('%param: Content of first magic tab', array('%param' => $a1)),
+  );
+  $tabs[] = array(
+    'title' => t('Second magic tab'),
+    'content' => t('%param: Content of the second magic tab', array('%param' => $a2)),
+  );
+  $tabs[] = array(
+    'title' => t('Third magic tab'),
+    'content' => ($active == 2 || $active == -1) ? magic_tabs_get('magic_tabs_inline_callback') : '',
+  );
+  /*
+   ** Uncomment to display a custom block with $bid==2
+   */
+  /*
+  $bid = 2;
+  $block = (object)module_invoke('block', 'block', 'view', $bid);
+  $block->module = 'block';
+  $block->delta = $bid;
+  $tabs[] = array(
+    'title' => t('Display a custom block'),
+    'content' => theme('block', $block),
+  );
+  */
+  return $tabs;
+}
+
+function magic_tabs_inline_callback() {
+  $tabs[] = array(
+    'title' => t('First nested magic tab'),
+    'content' => t('Content of first nested magic tab'),
+  );
+  $tabs[] = array(
+    'title' => t('2nd nested magic tab'),
+    'content' => t('Content of the second nested magic tab'),
+  );
+  return $tabs;
+}
Index: magic_tabs.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/magic_tabs/Attic/magic_tabs.module,v
retrieving revision 1.3.2.11.2.1
diff -u -p -r1.3.2.11.2.1 magic_tabs.module
--- magic_tabs.module	5 Oct 2008 20:36:07 -0000	1.3.2.11.2.1
+++ magic_tabs.module	10 Oct 2008 18:14:09 -0000
@@ -25,6 +25,8 @@
 function magic_tabs_get($callback, $active = 'first') {
   global $theme;
   global $user;
+  // include once the pages.inc file
+  include_once(drupal_get_path('module', 'magic_tabs') .'/magic_tabs.pages.inc');
 
   if (!isset($theme)) {
     init_theme();
@@ -158,6 +160,7 @@ function magic_tabs_get($callback, $acti
   return $output;
 }
 
+
 /**
  * Implementation of hook_menu().
  */
@@ -172,65 +175,6 @@ function magic_tabs_menu() {
   return $items;
 }
 
-function magic_tabs_ajax($callback) {
-  global $theme;
-  $args = array();
-  if ($_GET['args']) {
-    $args = unserialize($_GET['args']);
-  }
-  array_unshift($args, $callback, 'first');
-  
-  /**
-   * need to initialize the theme engine first, otherwise, $callback might not
-   * be in the function list
-   */
-  if (!isset($theme)) {
-    init_theme();
-  }
-
-  _magic_tabs_menu_callback(TRUE);
-  
-  if (function_exists($callback)) {
-    print call_user_func_array('magic_tabs_get', $args);
-    exit();
-  }
-}
-
-function _magic_tabs_menu_callback($value = NULL) {
-  static $menu_callback;
-  if (isset($value)) {
-    $menu_callback = $value;
-  }
-  return $menu_callback;
-}
-
-function magic_tabs_query($params = array()) {
-  $q = array_merge($_GET, $params);
-  unset($q['q']);
-  return $q;
-}
-
-function magic_tabs_register_callback($callback) {
-  // register a callback in the cache. This is not to benefit performance, but to allow saving a temporary state
-  // other solutions considered where:
-  // 1. $_SESSION - not good due to page_cache,
-  // 2. variable table - entries might get stored for too long and provide security risk
-  $callbacks = array();
-  if (($cache = cache_get('magic_tabs_callbacks')) && !empty($cache->data)) {
-    $callbacks = $cache->data;
-  }
-  $callbacks[$callback] = TRUE; //<== REFACTOR: consider using a simple array here
-  cache_set('magic_tabs_callbacks', $callbacks, 'cache', CACHE_TEMPORARY);
-}
-
-function magic_tabs_check_callback($callback) {
-  // check if the callback is in the list of allowed callbacks
-  if (($cache = cache_get('magic_tabs_callbacks')) && !empty($cache->data)) {
-    $callbacks = $cache->data;
-    return $callbacks[$callback];
-  }
-}
-
 /**
  * Implementation of hook_theme().
  */ 
@@ -246,54 +190,3 @@ function magic_tabs_theme($existing, $ty
     ),
   );
 }
-
-/**
- * Themeable functions
- */
-function theme_magic_tabs($callback, $items, $content) {
-  return theme('item_list', $items, NULL, 'ul', array('class' => 'tabs')) .'<div class="magic_content">'. $content .'</div>';
-}
-
-/**
- * Example callback function
- */
-function magic_tabs_example_callback($active = 0, $a1, $a2) {
-  $tabs[] = array(
-    'title' => t('First magic tab'),
-    'content' => t('%param: Content of first magic tab', array('%param' => $a1)),
-  );
-  $tabs[] = array(
-    'title' => t('Second magic tab'),
-    'content' => t('%param: Content of the second magic tab', array('%param' => $a2)),
-  );
-  $tabs[] = array(
-    'title' => t('Third magic tab'),
-    'content' => ($active == 2 || $active == -1) ? magic_tabs_get('magic_tabs_inline_callback') : '',
-  );
-  /*
-   ** Uncomment to display a custom block with $bid==2
-   */
-  /*
-  $bid = 2;
-  $block = (object)module_invoke('block', 'block', 'view', $bid);
-  $block->module = 'block';
-  $block->delta = $bid;
-  $tabs[] = array(
-    'title' => t('Display a custom block'),
-    'content' => theme('block', $block),
-  );
-  */
-  return $tabs;
-}
-
-function magic_tabs_inline_callback() {
-  $tabs[] = array(
-    'title' => t('First nested magic tab'),
-    'content' => t('Content of first nested magic tab'),
-  );
-  $tabs[] = array(
-    'title' => t('2nd nested magic tab'),
-    'content' => t('Content of the second nested magic tab'),
-  );
-  return $tabs;
-}
Index: magic_tabs.pages.inc
===================================================================
RCS file: magic_tabs.pages.inc
diff -N magic_tabs.pages.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ magic_tabs.pages.inc	10 Oct 2008 18:14:09 -0000
@@ -0,0 +1,68 @@
+<?php
+//$Id$
+
+function magic_tabs_ajax($callback) {
+  global $theme;
+  $args = array();
+  if ($_GET['args']) {
+    $args = unserialize($_GET['args']);
+  }
+  array_unshift($args, $callback, 'first');
+  
+  /**
+   * need to initialize the theme engine first, otherwise, $callback might not
+   * be in the function list
+   */
+  if (!isset($theme)) {
+    init_theme();
+  }
+
+  _magic_tabs_menu_callback(TRUE);
+  
+  if (function_exists($callback)) {
+    print call_user_func_array('magic_tabs_get', $args);
+    exit();
+  }
+}
+
+function _magic_tabs_menu_callback($value = NULL) {
+  static $menu_callback;
+  if (isset($value)) {
+    $menu_callback = $value;
+  }
+  return $menu_callback;
+}
+
+function magic_tabs_query($params = array()) {
+  $q = array_merge($_GET, $params);
+  unset($q['q']);
+  return $q;
+}
+
+function magic_tabs_register_callback($callback) {
+  // register a callback in the cache. This is not to benefit performance, but to allow saving a temporary state
+  // other solutions considered where:
+  // 1. $_SESSION - not good due to page_cache,
+  // 2. variable table - entries might get stored for too long and provide security risk
+  $callbacks = array();
+  if (($cache = cache_get('magic_tabs_callbacks')) && !empty($cache->data)) {
+    $callbacks = $cache->data;
+  }
+  $callbacks[$callback] = TRUE; //<== REFACTOR: consider using a simple array here
+  cache_set('magic_tabs_callbacks', $callbacks, 'cache', CACHE_TEMPORARY);
+}
+
+function magic_tabs_check_callback($callback) {
+  // check if the callback is in the list of allowed callbacks
+  if (($cache = cache_get('magic_tabs_callbacks')) && !empty($cache->data)) {
+    $callbacks = $cache->data;
+    return $callbacks[$callback];
+  }
+}
+
+/**
+ * Themeable functions
+ */
+function theme_magic_tabs($callback, $items, $content) {
+  return theme('item_list', $items, NULL, 'ul', array('class' => 'tabs')) .'<div class="magic_content">'. $content .'</div>';
+}
