Index: ctools_plugin_example/ctools_plugin_example.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ctools/ctools_plugin_example/ctools_plugin_example.info,v
retrieving revision 1.1
diff -u -p -r1.1 ctools_plugin_example.info
--- ctools_plugin_example/ctools_plugin_example.info	17 Aug 2009 22:07:14 -0000	1.1
+++ ctools_plugin_example/ctools_plugin_example.info	23 Oct 2010 17:08:51 -0000
@@ -2,7 +2,5 @@ name = Chaos Tools (CTools) Plugin Examp
 description = Shows how an external module can provide ctools plugins (for Panels, etc.).
 package = Chaos tool suite
 dependencies[] = ctools
-dependencies[] = panels
-dependencies[] = page_manager
 dependencies[] = advanced_help
 core = 6.x
Index: ctools_plugin_example/ctools_plugin_example.install
===================================================================
RCS file: ctools_plugin_example/ctools_plugin_example.install
diff -N ctools_plugin_example/ctools_plugin_example.install
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ctools_plugin_example/ctools_plugin_example.install	23 Oct 2010 17:08:52 -0000
@@ -0,0 +1,121 @@
+<?php
+// $Id$
+
+/**
+ * Implementation of hook_schema().
+ */
+function ctools_plugin_example_schema() {
+  $schema = array();
+
+  $schema['ctools_plugin_example_object'] = array(
+    'description' => 'Base table holding example objects.',
+    'export' => array(
+      'api' => array(
+        'owner' => 'ctools_plugin_example',
+        'api' => 'ctools_plugin_example_object_default',
+        'minimum_version' => 1,
+        'current_version' => 1,
+      ),
+      'key' => 'machine_name',
+      'key name' => 'Machine name',
+      'primary key' => 'oid',
+      'identifier' => 'object',
+      'default hook' => 'ctools_plugin_example_object_default',
+      'load callback' => 'ctools_plugin_example_object_load',
+      'delete callback' => 'ctools_plugin_example_object_delete',
+    ),
+    'join' => array(
+      'term' => array(
+        'table' => 'ctools_plugin_example_object_term',
+        'left_key' => 'oid',
+        'right_key' => 'oid',
+        // One-to-many relationships must define 'array_key'. Can be either
+        // EXPORT_NUMERIC_ARRAY or a field name from the joined table.
+        'array_key' => EXPORT_NUMERIC_ARRAY,
+        'load' => array(
+          'name',
+          'synonym',
+        ),
+      ),
+    ),
+    'fields' => array(
+      'oid' => array(
+        'description' => 'Serial id for this object. Only used for internal lookups.',
+        'type' => 'serial',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'no export' => TRUE,
+      ),
+      'machine_name' => array(
+        'description' => 'Machine-readable name for this object.',
+        'type' => 'varchar',
+        'length' => 128,
+        'not null' => TRUE,
+      ),
+      'title' => array(
+        'description' => 'Title for this object.',
+        'type' => 'varchar',
+        'length' => 128,
+        'not null' => TRUE,
+      ),
+      'body' => array(
+        'description' => 'Body for this object.',
+        'type' => 'text',
+        'not null' => TRUE,
+        'default' => '',
+        'size' => 'medium',
+      ),
+    ),
+    'primary key' => array('oid', 'machine_name'),
+  );
+
+  $schema['ctools_plugin_example_object_term'] = array(
+    'description' => 'Table holding definition of object terms.',
+    'fields' => array(
+      'tid' => array(
+        'description' => 'Serial id for this term. Only used for internal lookups.',
+        'type' => 'serial',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'no export' => TRUE,
+      ),
+      'oid' => array(
+        'description' => 'Object id which this term belongs to. Only used for internal lookups.',
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'no export' => TRUE,
+      ),
+      'name' => array(
+        'description' => 'Title for this term.',
+        'type' => 'varchar',
+        'length' => 128,
+        'not null' => TRUE,
+      ),
+      'synonym' => array(
+        'description' => 'Synonym for this term.',
+        'type' => 'text',
+        'not null' => TRUE,
+        'default' => '',
+        'size' => 'medium',
+      ),
+    ),
+    'primary key' => array('tid', 'oid'),
+  );
+
+  return $schema;
+}
+
+/**
+ * Implementation of hook_install().
+ */
+function ctools_plugin_example_install() {
+  drupal_install_schema('ctools_plugin_example');
+}
+
+/**
+ * Implementation of hook_uninstall().
+ */
+function ctools_plugin_example_uninstall() {
+  drupal_uninstall_schema('ctools_plugin_example');
+}
Index: ctools_plugin_example/ctools_plugin_example.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ctools/ctools_plugin_example/ctools_plugin_example.module,v
retrieving revision 1.1
diff -u -p -r1.1 ctools_plugin_example.module
--- ctools_plugin_example/ctools_plugin_example.module	17 Aug 2009 22:07:14 -0000	1.1
+++ ctools_plugin_example/ctools_plugin_example.module	23 Oct 2010 17:08:52 -0000
@@ -69,6 +69,9 @@ function ctools_plugin_example_ctools_pl
   if ($module == 'page_manager' && $api == 'pages_default') {
     return array('version' => 1);
   }
+  if ($module == 'ctools_plugin_example' && $api == 'ctools_plugin_example_object_default') {
+    return array('version' => 1);
+  }
 }
 
 /**
@@ -93,3 +96,39 @@ function ctools_plugin_example_explanati
 
   return $content;
 }
+
+/**
+ * Load a single example object.
+ */
+function ctools_plugin_example_object_load($name) {
+  ctools_include('export');
+  $result = ctools_export_load_object('ctools_plugin_example_object', 'names', array($name));
+  if (isset($result[$name])) {
+    return $result[$name];
+  }
+}
+
+/**
+ * Implementation of hook_ctools_plugin_example_object_default().
+ */
+function ctools_plugin_example_ctools_plugin_example_object_default() {
+  $objects = array();
+
+  $object = new stdClass;
+  $object->disabled = FALSE; /* Edit this to true to make a default object disabled initially */
+  $object->api_version = 1;
+  $object->machine_name = 'example';
+  $object->title = 'Example';
+  $object->body = 'Hello world';
+    $term = new stdClass;
+    $term->name = 'Lorem';
+    $term->synonym = '';
+  $object->term[] = $term;
+    $term = new stdClass;
+    $term->name = 'Ipsum';
+    $term->synonym = '';
+  $object->term[] = $term;
+  $objects[] = $object;
+
+  return $objects;
+}
Index: ctools_plugin_example/plugins/export_ui/example_object.inc
===================================================================
RCS file: ctools_plugin_example/plugins/export_ui/example_object.inc
diff -N ctools_plugin_example/plugins/export_ui/example_object.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ctools_plugin_example/plugins/export_ui/example_object.inc	23 Oct 2010 17:08:52 -0000
@@ -0,0 +1,27 @@
+<?php
+// $Id$
+
+$plugin = array(
+  'schema' => 'ctools_plugin_example_object',
+  'menu' => array(
+    'menu item' => 'example-object',
+    'menu title' => 'Exportable example',
+    'menu description' => 'Administer exportable example objects.',
+  ),
+  'title singular' => t('object'),
+  'title plural' => t('objects'),
+  'title singular proper' => t('Example object'),
+  'title plural proper' => t('Example objects'),
+  'form' => array(
+    'settings' => 'ctools_plugin_example_object_form',
+    'submit' => 'dctools_plugin_example_object_form_submit',
+  ),
+);
+
+function ctools_plugin_example_object_form(&$form, &$form_state) {
+
+}
+
+function ctools_plugin_example_object_form_submit(&$form, &$form_state) {
+
+}

