? tools/lib/publisher.drupal_elements.cls
? tools/lib/publisher.form.cls
? tools/lib/publisher.form2.cls
? tools/lib/publisher.msp_db.cls
Index: publisher.inc
===================================================================
RCS file: publisher.inc
diff -N publisher.inc
--- publisher.inc	15 Mar 2008 19:48:38 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,12 +0,0 @@
-<?php
-  /**
-   * @file
-   * @copyright 2008 Sieb Unlimited, LLC
-   * @license @see(LICENSE.txt)
-   * $Id: publisher.inc,v 1.2 2008/03/15 19:48:38 earnie Exp $
-   **/
-
-require_once 'tools/include/pcommon.inc';
-require_once 'tools/lib/publisher.lib';
-
-// vim:ft=php:sts=2:sw=2:ts=2:et:ai:sta:ff=unix
Index: publisher.info
===================================================================
RCS file: publisher.info
diff -N publisher.info
--- publisher.info	2 Apr 2008 18:10:25 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,8 +0,0 @@
-;$Id: publisher.info,v 1.2 2008/04/02 18:10:25 earnie Exp $
-name = Publisher
-description = "A collection of tools common to publishing data.  Enabling this
-               module will also enable &quot;required Publisher core tools&quot;
-	       as noted in the Publisher tool modules."
-package = Publisher
-
-;// vim:ft=php:sts=2:sw=2:ts=2:et:ai:sta:ff=unix
Index: publisher.install
===================================================================
RCS file: publisher.install
diff -N publisher.install
--- publisher.install	2 Apr 2008 18:10:25 -0000	1.3
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,74 +0,0 @@
-<?php
-/**
- * @file
- * @copyright 2008 Sieb Unlimited, LLC
- * @license @see(LICENSE.txt);
- * $Id: publisher.install,v 1.3 2008/04/02 18:10:25 earnie Exp $
- */
-
-/**
- * DB Version control
- * @const PUBLISHER_DB_VERSION
- */
-define ('PUBLISHER_DB_VERSION', '0.1');
-
-/**
- * @includes
- */
-require_once 'tools/include/publisher.inc';
-
-/**
- * Install the database tables via a hook_install implementation.
- * @see(http://api.drupal.org/api/function/hook_install)
- */
-function publisher_install() {
-  $db_type = register_get('db_type');
-  $publisher_db_version = variable_get('publisher_db_version', NULL);
-  $state = isset($publisher_db_version) ? 'upgrade' : 'install';
-
-  require_once "publisher.${state}.${db_type}";
-
-  $hook = "publisher_${state}_${db_type}";
-  $hook($publisher_db_version);
-
-  variable_set('publisher_db_version', PUBLISHER_DB_VERSION);
-  pub_core_modules(TRUE); // Register the required core modules.
-  pub_module_hook_call_all('install');
-}
-
-/**
- * Uninstall the database tables and saved variables via hook_uninstall.
- * @see(http://api.drupal.org/api/function/hook_uninstall)
- */
-function publisher_uninstall () {
-  $db_type = register_get('db_type');
-  require_once "publisher.uninstall.${db_type}";
-  $hook = "publisher_uninstall_${db_type}";
-  $hook();
-  variable_del('publisher_db_version');
-  pub_module_hook_call_all('uninstall');
-  variable_del('publisher_module_registry');
-}
-
-/**
- * Enable the core publisher tool modules.
- */
-function publisher_enable() {
-  module_enable(pub_core_modules());
-  foreach (pub_core_modules() as $module) {
-    pub_module_enable($module);
-  }
-}
-
-/**
- * Disable the registered modules via hook_disable.
- */
-function publisher_disable () {
-  $pub_modules = pub_module_registry();
-  foreach (array_keys($pub_modules) as $module) {
-    pub_module_disable($module);
-  }
-  module_disable(array_keys($pub_modules));
-}
-
-// vim:ft=php:sts=2:sw=2:ts=2:et:ai:sta:ff=unix
Index: publisher.install.mysql
===================================================================
RCS file: publisher.install.mysql
diff -N publisher.install.mysql
--- publisher.install.mysql	2 Apr 2008 18:10:25 -0000	1.3
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,105 +0,0 @@
-<?php
-/**
- * @file
- * @copyright 2008 Sieb Unlimited, LLC
- * @license @see(LICENSE.txt)
- * $Id: publisher.install.mysql,v 1.3 2008/04/02 18:10:25 earnie Exp $
- */
-
-/**
- * @includes
- */
-require_once 'tools/include/publisher.inc';
-
-/**
- * Version 0.1
- */
-function publisher_install_mysql() {
-  /**
-   * Publisher Marketing Service Provider
-   * @table pub_msp
-   * @col unsigned int id               // PRIMARY KEY
-   * @col varchar(32) controlName       // UNIQUE KEY
-   * @col varchar(128) displayName      // The user eye value.
-   * @col int enabled                   // Are we in production yet?
-   * @col timestamp created             // Time this row was created.
-   * @col timestamp lastUpdated         // Time this row was last updated.
-   */
-  pub_db_query("CREATE TABLE {pub_msp} (
-    id int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
-    controlName varchar(32) NOT NULL,
-    displayName varchar(128) NOT NULL,
-    enabled int(1) UNSIGNED NOT NULL DEFAULT 0,
-    created timestamp NOT NULL DEFAULT 0,
-    lastUpdated timestamp NOT NULL DEFAULT 0 ON UPDATE CURRENT_TIMESTAMP,
-    PRIMARY KEY (id),
-    UNIQUE KEY (controlName)
-  ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
-
-  /**
-   * Publisher Web Sites
-   * @table pub_webs
-   * @col unsigned int id               // PRIMARY KEY
-   * @col varchar(32) controlName       // UNIQUE KEY
-   * @col varchar(128) displayName      // User eye value.
-   * @col varchar(255) siteURL          // The URI for the site home
-   * @col unsigned int enabled          // Are we in production?
-   * @col timestamp created             // Time the row is created.
-   * @col timestamp lastUpdated         // Time the row was last updated.
-   */
-  pub_db_query("CREATE TABLE {pub_webs} (
-    id int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
-    controlName varchar(32) NOT NULL,
-    displayName varchar(128) NOT NULL,
-    siteURL varchar(255) NOT NULL,
-    enabled int(1) UNSIGNED NOT NULL DEFAULT 0,
-    created timestamp NOT NULL DEFAULT 0,
-    lastUpdated timestamp NOT NULL DEFAULT 0 ON UPDATE CURRENT_TIMESTAMP,
-    PRIMARY KEY (id),
-    UNIQUE KEY (controlName)
-  ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
-
-  /**
-   * Publisher Merchants
-   * @table pub_merchants
-   * @col unsigned int id               // PRIMARY KEY
-   * @col varchar(32) controlName       // UNIQUE KEY
-   * @col varchar(128) displayName      // User eye value.
-   * @col unsigned int enabled          // Are we in production?
-   * @col timestamp created             // Time the row is created.
-   * @col timestamp lastUpdated         // Time the row was last updated.
-   */
-  pub_db_query("CREATE TABLE {pub_merchants} (
-    id int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
-    controlName varchar(32) NOT NULL,
-    displayName varchar(128) NOT NULL,
-    enabled int(1) UNSIGNED NOT NULL DEFAULT 0,
-    created timestamp NOT NULL DEFAULT 0,
-    lastUpdated timestamp NOT NULL DEFAULT 0 ON UPDATE CURRENT_TIMESTAMP,
-    PRIMARY KEY (id),
-    UNIQUE KEY (controlName)
-  ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
-
-  /**
-   * Publisher Relationships
-   * @table pub_relationships
-   * @col unsigned int id               // PRIMARY KEY
-   * @col unsigned int msp_id           // FOREIGN KEY
-   *                                    // Relation to table pub_msp.
-   * @col unsigned int merchants_id     // FOREIGN KEY
-   *                                    // Relation to table pub_merchants.
-   * @col unsigned int webs_id          // FOREIGN KEY
-   *                                    // Relation to table pub_webs.
-   */
-  pub_db_query("CREATE TABLE {pub_relationships} (
-    id int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
-    msp_id int(10) UNSIGNED NOT NULL,
-    merchants_id int(10) UNSIGNED NOT NULL,
-    webs_id int(10) UNSIGNED NOT NULL,
-    PRIMARY KEY (id),
-    UNIQUE KEY (msp_id, merchants_id, webs_id)
-  ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
-
-}
-
-// vim:ft=php:sts=2:sw=2:ts=2:et:ai:sta:ff=unix
Index: publisher.module
===================================================================
RCS file: publisher.module
diff -N publisher.module
--- publisher.module	2 Apr 2008 18:10:25 -0000	1.4
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,91 +0,0 @@
-<?php
-/**
- * @file
- * @copyright 2008 Sieb Unlimited, LLC
- * @license @see(LICENSE.txt)
- * $Id: publisher.module,v 1.4 2008/04/02 18:10:25 earnie Exp $
- */
-
-/**
- * @includes
- */
-require_once "tools/include/publisher.inc";
-
-/**
- * Define publisher user permission controls via hook_perm API
- */
-function publisher_perm() {
-  return array_merge(array(t('administer publisher')), _publisher_perm());
-}
-
-/**
- * Find hooked permission in publisher modules.
- *
- * @return array           // The list of publisher permissions.
- */
-function _publisher_perm() {
-  $ret = array();
-  foreach(array_keys(pub_module_registry()) as $module) {
-    $ret = array_merge($ret, pub_module_hook_call($module, 'perm'));
-  }
-  return $ret;
-}
-
-/**
- * Define publisher help function via hook_help API
- */
-function publisher_help($what) {
-  switch ($what) {
-    case 'admin/help#publisher': {
-      $output = '<p>'
-              . t("Publisher provides a set of tools that are common to 
-                   publishing data in batch mode.  Some of the tools are
-                   third party tools and are interfaced to the Drupal module
-                   via glue magic.  The publisher module considers these tools
-                   as plugins and can be found in the tools directory.")
-              . '</p><p>'
-              . t("The tools directory provides a hierarchy for include files,
-                   libraries and executables.  So within the tools directory
-                   you will find directories named bin/, etc/, include/, lib/
-                   and modules/.  I suggest that the bin/, etc/, include/ and
-                   lib/ directories be copied to DRUPALROOT/local/ to make it 
-                   easier to execute.  The bin/ directory contains batch 
-                   executables that will normally be executed by cron.  The 
-                   modules/ directory provides the Drupal glue for controlling 
-                   installation and access.")
-              . '</p>';
-    } break;
-    default: {
-      $output = NULL;
-    }
-  }
-  $output .= '<div class="pub_tools">'."\n"
-          .  pub_module_hook_call_all('help', $what)."\n"
-          .  '</div>'."\n";
-  return $output;
-}
-
-function publisher_menu($may_cache) {
-  $menu = array();
-  if ($may_cache) {
-    $menu[] = array(
-      'path'    => 'admin/publisher',
-      'title'   => t('Pubisher'),
-    );
-    $menu[] = array(
-      'path'    => 'admin/publisher/msp',
-      'title'   => t('Merchant Service Provider'),
-    );
-    $menu[] = array(
-      'path'    => 'admin/publisher/merchants',
-      'title'   => t('Merchants'),
-    );
-    $menu[] = array(
-      'path'    => 'admin/publisher/webs',
-      'title'   => t('Websites'),
-    );
-  }
-  return $menu;
-}
-
-// vim:ft=php:sts=2:sw=2:ts=2:et:ai:sta:ff=unix
Index: publisher.uninstall.mysql
===================================================================
RCS file: publisher.uninstall.mysql
diff -N publisher.uninstall.mysql
--- publisher.uninstall.mysql	2 Apr 2008 18:10:25 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,22 +0,0 @@
-<?php
-/**
- * @file
- * @copyright 2008 Sieb Unlimited, LLC
- * @license @see(LICENSE.txt)
- * $Id: publisher.uninstall.mysql,v 1.2 2008/04/02 18:10:25 earnie Exp $
- */
-
-/**
- * @includes
- */
-require_once 'tools/include/publisher.inc';
-
-/**
- * Version 0.1
- */
-function publisher_uninstall_mysql() {
-  pub_db_query("DROP TABLE {pub_msp}");
-  pub_db_query("DROP TABLE {pub_webs}");
-  pub_db_query("DROP TABLE {pub_merchants}");
-  pub_db_query("DROP TABLE {pub_relationships}");
-}
Index: module/publisher.inc
===================================================================
RCS file: module/publisher.inc
diff -N module/publisher.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ module/publisher.inc	25 Apr 2008 18:22:47 -0000
@@ -0,0 +1,12 @@
+<?php
+/**
+ * @file
+ * @copyright 2008 Sieb Unlimited, LLC
+ * @license @see(LICENSE.txt)
+ * $Id: publisher.inc,v 1.2 2008/03/15 19:48:38 earnie Exp $
+ */
+
+require_once 'tools/include/pcommon.inc';
+require_once 'tools/lib/publisher.lib';
+
+// vim:ft=php:sts=2:sw=2:ts=2:et:ai:sta:ff=unix
Index: module/publisher.info
===================================================================
RCS file: module/publisher.info
diff -N module/publisher.info
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ module/publisher.info	25 Apr 2008 18:22:47 -0000
@@ -0,0 +1,8 @@
+;$Id: publisher.info,v 1.2 2008/04/02 18:10:25 earnie Exp $
+name = Publisher
+description = "A collection of tools common to publishing data.  Enabling this
+               module will also enable &quot;required Publisher core tools&quot;
+	       as noted in the Publisher tool modules."
+package = Publisher
+
+;// vim:ft=php:sts=2:sw=2:ts=2:et:ai:sta:ff=unix
Index: module/publisher.install
===================================================================
RCS file: module/publisher.install
diff -N module/publisher.install
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ module/publisher.install	25 Apr 2008 18:22:47 -0000
@@ -0,0 +1,80 @@
+<?php
+/**
+ * @file
+ * @copyright 2008 Sieb Unlimited, LLC
+ * @license @see(LICENSE.txt);
+ * $Id: publisher.install,v 1.3 2008/04/02 18:10:25 earnie Exp $
+ */
+
+/**
+ * DB Version control
+ * @const PUBLISHER_DB_VERSION
+ */
+define ('PUBLISHER_DB_VERSION', '0.1');
+
+/**
+ *
+ */
+$publisherBase = variable_get('publisher_basedir', dirname(dirname(__FILE__)));
+
+/**
+ * @includes
+ */
+require_once $publisherBase . '/tools/include/publisher.inc';
+
+/**
+ * Install the database tables via a hook_install implementation.
+ * @see(http://api.drupal.org/api/function/hook_install)
+ */
+function publisher_install() {
+  $db_type = register_get('db_type');
+  $publisher_db_version = variable_get('publisher_db_version', NULL);
+  $state = isset($publisher_db_version) ? 'upgrade' : 'install';
+
+  require_once "publisher.${state}.${db_type}";
+
+  $hook = "publisher_${state}_${db_type}";
+  $hook($publisher_db_version);
+
+  variable_set('publisher_db_version', PUBLISHER_DB_VERSION);
+  variable_set('publisher_basedir', dirname(dirname(__FILE__)));
+  pub_core_modules(TRUE); // Register the required core modules.
+  pub_module_hook_call_all('install');
+}
+
+/**
+ * Uninstall the database tables and saved variables via hook_uninstall.
+ * @see(http://api.drupal.org/api/function/hook_uninstall)
+ */
+function publisher_uninstall () {
+  $db_type = register_get('db_type');
+  require_once "publisher.uninstall.${db_type}";
+  $hook = "publisher_uninstall_${db_type}";
+  $hook();
+  variable_del('publisher_db_version');
+  pub_module_hook_call_all('uninstall');
+  variable_del('publisher_module_registry');
+}
+
+/**
+ * Enable the core publisher tool modules.
+ */
+function publisher_enable() {
+  module_enable(pub_core_modules());
+  foreach (pub_core_modules() as $module) {
+    pub_module_enable($module);
+  }
+}
+
+/**
+ * Disable the registered modules via hook_disable.
+ */
+function publisher_disable () {
+  $pub_modules = pub_module_registry();
+  foreach (array_keys($pub_modules) as $module) {
+    pub_module_disable($module);
+  }
+  module_disable(array_keys($pub_modules));
+}
+
+// vim:ft=php:sts=2:sw=2:ts=2:et:ai:sta:ff=unix
Index: module/publisher.install.mysql
===================================================================
RCS file: module/publisher.install.mysql
diff -N module/publisher.install.mysql
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ module/publisher.install.mysql	25 Apr 2008 18:22:48 -0000
@@ -0,0 +1,116 @@
+<?php
+/**
+ * @file
+ * @copyright 2008 Sieb Unlimited, LLC
+ * @license @see(LICENSE.txt)
+ * $Id: publisher.install.mysql,v 1.3 2008/04/02 18:10:25 earnie Exp $
+ */
+
+$publisherBase = variable_get('publisher_basedir', dirname(dirname(__FILE__)));
+
+/**
+ * @includes
+ */
+require_once $publisherBase . '/tools/include/publisher.inc';
+
+/**
+ * Version 0.1
+ */
+function publisher_install_mysql() {
+  /**
+   * Publisher Marketing Service Provider
+   * @table pub_msp
+   * @col unsigned int id               // PRIMARY KEY
+   * @col varchar(32) controlName       // UNIQUE KEY
+   * @col varchar(128) displayName      // The user eye value.
+   * @col varchar(255) mspHomeURL       // The URL for the MSP home page.
+   * @col varchar(255) mspLoginURL      // The URL for the associate login page.
+   * @col varchar(32) userName          // The user id for the login page.
+   * @col varchar(255) userPass         // The user password for the login page.
+   * @col int enabled                   // Are we in production yet?
+   * @col timestamp created             // Time this row was created.
+   * @col timestamp lastUpdated         // Time this row was last updated.
+   */
+  pub_db_query("CREATE TABLE {pub_msp} (
+    id int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+    controlName varchar(32) NOT NULL,
+    displayName varchar(128) NOT NULL,
+    mspHomeURL varchar(255) NOT NULL,
+    mspLoginURL varchar(255) NOT NULL,
+    userName varchar(32) NOT NULL,
+    userPass varchar(32) NOT NULL,
+    enabled int(1) UNSIGNED NOT NULL DEFAULT 0,
+    deleted int(1) UNSIGNED NOT NULL DEFAULT 0,
+    created timestamp NOT NULL DEFAULT 0,
+    lastUpdated timestamp NOT NULL DEFAULT 0 ON UPDATE CURRENT_TIMESTAMP,
+    PRIMARY KEY (id),
+    UNIQUE KEY (controlName)
+  ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+  /**
+   * Publisher Web Sites
+   * @table pub_webs
+   * @col unsigned int id               // PRIMARY KEY
+   * @col varchar(32) controlName       // UNIQUE KEY
+   * @col varchar(128) displayName      // User eye value.
+   * @col varchar(255) siteURL          // The URI for the site home
+   * @col unsigned int enabled          // Are we in production?
+   * @col timestamp created             // Time the row is created.
+   * @col timestamp lastUpdated         // Time the row was last updated.
+   */
+  pub_db_query("CREATE TABLE {pub_webs} (
+    id int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+    controlName varchar(32) NOT NULL,
+    displayName varchar(128) NOT NULL,
+    siteURL varchar(255) NOT NULL,
+    enabled int(1) UNSIGNED NOT NULL DEFAULT 0,
+    created timestamp NOT NULL DEFAULT 0,
+    lastUpdated timestamp NOT NULL DEFAULT 0 ON UPDATE CURRENT_TIMESTAMP,
+    PRIMARY KEY (id),
+    UNIQUE KEY (controlName)
+  ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+  /**
+   * Publisher Merchants
+   * @table pub_merchants
+   * @col unsigned int id               // PRIMARY KEY
+   * @col varchar(32) controlName       // UNIQUE KEY
+   * @col varchar(128) displayName      // User eye value.
+   * @col unsigned int enabled          // Are we in production?
+   * @col timestamp created             // Time the row is created.
+   * @col timestamp lastUpdated         // Time the row was last updated.
+   */
+  pub_db_query("CREATE TABLE {pub_merchants} (
+    id int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+    controlName varchar(32) NOT NULL,
+    displayName varchar(128) NOT NULL,
+    enabled int(1) UNSIGNED NOT NULL DEFAULT 0,
+    created timestamp NOT NULL DEFAULT 0,
+    lastUpdated timestamp NOT NULL DEFAULT 0 ON UPDATE CURRENT_TIMESTAMP,
+    PRIMARY KEY (id),
+    UNIQUE KEY (controlName)
+  ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+  /**
+   * Publisher Relationships
+   * @table pub_relationships
+   * @col unsigned int id               // PRIMARY KEY
+   * @col unsigned int msp_id           // FOREIGN KEY
+   *                                    // Relation to table pub_msp.
+   * @col unsigned int merchants_id     // FOREIGN KEY
+   *                                    // Relation to table pub_merchants.
+   * @col unsigned int webs_id          // FOREIGN KEY
+   *                                    // Relation to table pub_webs.
+   */
+  pub_db_query("CREATE TABLE {pub_relationships} (
+    id int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+    msp_id int(10) UNSIGNED NOT NULL,
+    merchants_id int(10) UNSIGNED NOT NULL,
+    webs_id int(10) UNSIGNED NOT NULL,
+    PRIMARY KEY (id),
+    UNIQUE KEY (msp_id, merchants_id, webs_id)
+  ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+}
+
+// vim:ft=php:sts=2:sw=2:ts=2:et:ai:sta:ff=unix
Index: module/publisher.module
===================================================================
RCS file: module/publisher.module
diff -N module/publisher.module
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ module/publisher.module	25 Apr 2008 18:22:48 -0000
@@ -0,0 +1,209 @@
+<?php
+/**
+ * @file
+ * @copyright 2008 Sieb Unlimited, LLC
+ * @license @see(LICENSE.txt)
+ * $Id: publisher.module,v 1.4 2008/04/02 18:10:25 earnie Exp $
+ */
+
+global $publisherBuild, $publisherBase;
+$publisherBuild = '$Id: $';
+$publisherBase = variable_get('publisher_basedir', dirname(dirname(__FILE__)));
+
+/**
+ * @includes
+ */
+require_once $publisherBase . "/tools/include/publisher.inc";
+
+/**
+ * Define publisher user permission controls via hook_perm API
+ */
+function publisher_perm() {
+  return array_merge(array(t('administer publisher')), _publisher_perm());
+}
+
+/**
+ * Find hooked permission in publisher tool modules.
+ *
+ * @return array           // The list of publisher permissions.
+ */
+function _publisher_perm() {
+  $ret = array();
+  foreach(array_keys(pub_module_registry()) as $module) {
+    $ret = array_merge($ret, pub_module_hook_call($module, 'perm'));
+  }
+  return $ret;
+}
+
+function pub_publisher_status() {
+  return t('
+<p><strong><em>Module Status:</em> This module version is considered 
+<em>ALPHA</em> development and not functioning.</strong>  This module version 
+should be used for evaluation of development only.  Released versions of this 
+module will be announced on the developer and support lists.</p>
+  ');
+}
+
+function pub_publisher_header($form, $tool = 'Publisher', $module = 'Publisher', $build = NULL) {
+  global $publisherBuild;
+  if (!isset($build)) {
+    $build = $publisherBuild;
+  }
+  $output = '<p>';
+  $output .= '<em>Sponsored by:</em> <a href="http://give-me-an-offer.com" target="_blank">Give-Me-An-Offer.com</a><br/>';
+  $output .= '<em>Tool:</em> ' . $tool . '<br/>';
+  $output .= '<em>Module:</em> ' . $module . '<br/>';
+  $output .= '<em>Form:</em> ' . $form . '<br/>';
+  $output .= '<em>Build:</em> ' . $build . '<br/>';
+  $output .= '</p>';
+  $output .= pub_module_status('publisher');
+  return t($output);
+}
+
+/**
+ * Define publisher help function via hook_help API
+ */
+function publisher_help($what) {
+  switch ($what) {
+    case 'admin/help#publisher': {
+      require 'help/publisher.help';
+    } break;
+
+    default: {
+      switch (arg(1)) {
+        case 'help':
+        case 'publisher': {
+          switch (arg(2)) {
+            case 'msp': {
+              require 'help/publisher.msp.help';
+            } break;
+
+            case 'merchants': {
+              require 'help/publisher.merchants.help';
+            } break;
+
+            case 'webs': {
+              require 'help/publisher.webs.help';
+            } break;
+
+            default: {
+              require 'help/publisher.default.help';
+            } break;
+          }
+        } break;
+        default: {
+          $output = NULL;
+        } break;
+      }
+    }
+  }
+  return $output;
+}
+
+function publisher_menu($may_cache) {
+  static $pub_menu;
+  if (!isset($pub_menu)) {
+    require 'menu/publisher.menu';
+  }
+
+  return $pub_menu->get();
+}
+
+
+function admin_publisher() {
+  $admin_tool = arg(2);
+  $op = arg(3);
+  $output = '';
+  switch ($admin_tool) {
+    case 'msp': {
+      require 'form/publisher.msp.form';
+      $output = '<p>' . theme('item_list', array('#message' => print_r($mspForm->get(),true))) . '</p>';
+    //  $output = drupal_render($mspForm->id, $mspForm->get());
+    } break;
+    case 'merchants': {
+    } break;
+    case 'webs': {
+    } break;
+    default: {
+      $output = t('<p><h3>Available tools:</h3></p>');
+      $links = array();
+      require 'menu/publisher.menu';
+      $links[] = $pub_menu->link('msp');
+      $links[] = $pub_menu->link('merchants');
+      $links[] = $pub_menu->link('websites');
+      $output .= '<p>'. theme('item_list', $links) . '</p>';
+    }
+  }
+  return $output;
+}
+
+function admin_publisher_msp_add_form() {
+  require 'form/publisher.msp_add.form';
+  return $mspForm;
+}
+
+function admin_publisher_msp_add_form_submit($formId, $formValues) {
+  require 'form/submit/publisher.msp_add.submit';
+}
+
+function admin_publisher_msp_add_form_validate($formId, $formValues) {
+  require 'form/validate/publisher.msp_add.validate';
+}
+
+function theme_admin_publisher_msp_add_form($form) {
+  require 'form/publisher.msp_add.form';
+  return drupal_render($form);
+}
+
+function admin_publisher_msp_list_form() {
+  require 'form/publisher.msp_list.form';
+  return $mspForm;
+}
+
+function admin_publisher_msp_list_form_submit($formId, $formValues) {
+  require 'form/submit/publisher.msp_list.submit';
+}
+
+function admin_publisher_msp_list_form_validate($formId, $formValues) {
+  require 'form/validate/publisher.msp_list.validate';
+}
+
+function theme_admin_publisher_msp_list_form($form) {
+  require 'form/theme/publisher.msp_list.theme';
+  return $theme;
+}
+
+function _publisher_msp_get($args) {
+  static $sql = 'SELECT * FROM {pub_msp} WHERE id IN (%s)';
+  if (is_array($args)) {
+    $args = implode(', ', $args);
+  }
+  $result = db_query($sql, $args);
+  $msps = array();
+  while ($msp = db_fetch_object($result)) {
+    $msps[] = $msp;
+  }
+  return $msps;
+}
+
+function _publisher_msp_enable($args) {
+  static $sql = 'UPDATE {pub_msp} SET enabled = 1 WHERE id = %d';
+  db_query($sql, $args);
+}
+
+function _publisher_msp_disable($args) {
+  static $sql = 'UPDATE {pub_msp} SET enabled = 0 WHERE id = %d';
+  db_query($sql, $args);
+}
+
+function _publisher_msp_delete($args) {
+  static $sql = 'UPDATE {pub_msp} SET deleted = 1, enabled = 0 WHERE id = %d';
+  db_query($sql, $args);
+}
+
+function _publisher_msp_undelete($args) {
+  static $sql = 'UPDATE {pub_msp} SET deleted = 0 WHERE id = %d';
+  db_query($sql, $args);
+}
+
+// vim:ft=php:sts=2:sw=2:ts=2:et:ai:sta:ff=unix
Index: module/publisher.uninstall.mysql
===================================================================
RCS file: module/publisher.uninstall.mysql
diff -N module/publisher.uninstall.mysql
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ module/publisher.uninstall.mysql	25 Apr 2008 18:22:48 -0000
@@ -0,0 +1,24 @@
+<?php
+/**
+ * @file
+ * @copyright 2008 Sieb Unlimited, LLC
+ * @license @see(LICENSE.txt)
+ * $Id: publisher.uninstall.mysql,v 1.2 2008/04/02 18:10:25 earnie Exp $
+ */
+
+$publisherBase = variable_get('publisher_basedir', dirname(dirname(__FILE__)));
+
+/**
+ * @includes
+ */
+require_once $publisherBase . '/tools/include/publisher.inc';
+
+/**
+ * Version 0.1
+ */
+function publisher_uninstall_mysql() {
+  pub_db_query("DROP TABLE {pub_msp}");
+  pub_db_query("DROP TABLE {pub_webs}");
+  pub_db_query("DROP TABLE {pub_merchants}");
+  pub_db_query("DROP TABLE {pub_relationships}");
+}
Index: module/form/publisher.msp_add.form
===================================================================
RCS file: module/form/publisher.msp_add.form
diff -N module/form/publisher.msp_add.form
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ module/form/publisher.msp_add.form	25 Apr 2008 18:22:48 -0000
@@ -0,0 +1,76 @@
+<?php
+/**
+ * @file
+ * @copyright 2008 Sieb Unlimited, LLC
+ * @license @see(LICENSE.txt)
+ * $Id: $
+ */
+
+global $mspForm;
+if (!isset($mspForm)) {
+  $mspForm = array();
+  $mspForm['markup-1'] = array(
+    '#type' => 'markup',
+    '#value' => '<div class="publisher_msp_add_form">',
+  );
+  $mspForm['controlName'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Control Name'),
+    '#description' => t('Automation control value for this record.'),
+    '#required' => TRUE,
+    '#size' => 32,
+    '#maxsize' => 32,
+  );
+  $mspForm['displayName'] = array(
+   '#type' => 'textfield',
+   '#title' => t('Display Name'),
+   '#description' => t('The user eye value for the controlName.'),
+   '#required' => TRUE,
+    '#size' => 64,
+    '#maxsize' => 128,
+  );
+  $mspForm['mspHomeURL'] = array(
+    '#type' => 'textfield',
+    '#title' => t('MSP Home URL'),
+    '#description' => t('The URL of the MSP Home page.'),
+    '#required' => FALSE,
+    '#maxsize' => 255,
+  );
+  $mspForm['mspLoginURL'] = array(
+    '#type' => 'textfield',
+    '#title' => t('MSP Login URL'),
+    '#description' => t('The URL that presents you with the MSP login form.'),
+    '#required' => FALSE,
+    '#maxsize' => 255,
+  );
+  $mspForm['userName'] = array(
+    '#type' => 'textfield',
+    '#title' => t('MSP Affiliate User Name'),
+    '#description' => t('The user id you use authenticate to the MSP.'),
+    '#required' => FALSE,
+    '#size' => 32,
+    '#maxsize' => 32,
+  );
+  $mspForm['userPass'] = array(
+    '#type' => 'password',
+    '#title' => t('MSP Affiliate User Password'),
+    '#description' => t('The password you use to authenticate to the MSP.'),
+    '#required' => FALSE,
+    '#size' => 12,
+    '#maxsize' => 32,
+  );
+  $mspForm['enabled'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Enabled'),
+    '#description' => t('Leave the MSP disabled if you\'re not ready to use it.'),
+    '#required' => FALSE,
+  );
+  $mspForm['save'] = array(
+    '#type' => 'submit',
+    '#title' => t('Save'),
+    '#description' => t('Save'),
+    '#value' => t('Save'),
+  );
+}
+
+// vim:ft=php:sts=2:sw=2:ts=2:et:ai:sta:ff=unix
Index: module/form/publisher.msp_list.form
===================================================================
RCS file: module/form/publisher.msp_list.form
diff -N module/form/publisher.msp_list.form
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ module/form/publisher.msp_list.form	25 Apr 2008 18:22:48 -0000
@@ -0,0 +1,64 @@
+<?php
+/**
+ * @file
+ * @copyright 2008 Sieb Unlimited, LLC
+ * @license @see(LICENSE.txt)
+ * $Id: $
+ */
+
+// Used elsewhere
+global $mspForm, $hdr, $pageRows;
+
+// Only set the form once.
+if (!isset($mspForm)) {
+  $pageRows = 50;
+  $mspForm = array();
+  $mspForm['markup-1'] = array(
+    '#type' => 'markup',
+    '#value' => '<div class="publisher_msp_list_form">',
+  );
+  $sql = 'SELECT id, displayName, enabled, deleted, created, lastUpdated FROM {pub_msp} ';
+  $cnt = 'SELECT COUNT(DISTINCT id) FROM {pub_msp} ';
+  $hdr = array(
+    theme('table_select_header_cell'),
+    array('data' => t('Row ID'), 'field' => 'id'),
+    array('data' => t('MSP'), 'field' => 'displayName'),
+    array('data' => t('Enabled'), 'field' => 'enabled'),
+    array('data' => t('Deleted'), 'field' => 'deleted'),
+    array('data' => t('Created'), 'field' => 'created'),
+    array('data' => t('Updated'), 'field' => 'lastUpdated'),
+  );
+  $sql .= tablesort_sql($hdr);
+  $result = pager_query($sql, $pageRows, 0, $cnt);
+  $mspForm['options']['operations'] = array(
+    '#type' => 'select',
+    '#options' => array(
+      t('--- Choose Action ---'),
+      t('Enable'),
+      t('Disable'),
+      t('Delete'),
+      t('Undelete'),
+    ),
+    '#default_value' => 'enable',
+  );
+  $mspForm['options']['submit'] = array(
+    '#type' => 'submit',
+    '#value' => t('Submit'),
+  );
+  while ($data = db_fetch_array($result)) {
+    $id = $data['id'];
+    $checks[$id] = '';
+    $mspForm['id'][$id] = array('#value' => $data['id']);
+    $mspForm['displayName'][$id] = array('#value' => $data['displayName']);
+    $mspForm['enabled'][$id] = array('#value' => $data['enabled']);
+    $mspForm['deleted'][$id] = array('#value' => $data['deleted']);
+    $mspForm['created'][$id] = array('#value' => $data['created']);
+    $mspForm['lastUpdated'][$id] = array('#value' => $data['lastUpdated']);
+  }
+  $mspForm['checks'] = array(
+    '#type' => 'checkboxes',
+    '#options' => $checks,
+  );
+}
+
+// vim:ft=php:sts=2:sw=2:ts=2:et:ai:sta:ff=unix
Index: module/form/submit/publisher.msp_add.submit
===================================================================
RCS file: module/form/submit/publisher.msp_add.submit
diff -N module/form/submit/publisher.msp_add.submit
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ module/form/submit/publisher.msp_add.submit	25 Apr 2008 18:22:48 -0000
@@ -0,0 +1,18 @@
+<?php
+/**
+ * @file
+ * @copyright 2008 Sieb Unlimited, LLC
+ * @license @see(LICENSE.txt)
+ * $Id: $
+ */
+
+$sql = "INSERT INTO {pub_msp} (controlName, displayName, mspHomeURL, mspLoginURL, userName, userPass, enabled, created) VALUES ('%s', '%s', '%s', '%s', '%s', '%s', %d, NOW())";
+$result = db_query($sql, $formValues);
+if ($result === FALSE) {
+  drupal_set_message(t('ERROR: Database Insert Failure - Check the watchdog log for details.'));
+}
+else {
+  drupal_set_message(t('MSP "'.$formValues['displayName'].'" has been added.'));
+}
+
+// vim:ft=php:sts=2:sw=2:ts=2:et:ai:sta:ff=unix
Index: module/form/submit/publisher.msp_list.submit
===================================================================
RCS file: module/form/submit/publisher.msp_list.submit
diff -N module/form/submit/publisher.msp_list.submit
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ module/form/submit/publisher.msp_list.submit	25 Apr 2008 18:22:48 -0000
@@ -0,0 +1,25 @@
+<?php
+/**
+ * @file
+ * @copyright 2008 Sieb Unlimited, LLC
+ * @license @see(LICENSE.txt)
+ * $Id: $
+ */
+
+$callbacks = array(
+  'publisher_msp_list_form',    // --- Choose Action ---
+  '_publisher_msp_enable',
+  '_publisher_msp_disable',
+  '_publisher_msp_delete',
+  '_publisher_msp_undelete',
+);
+
+$callback = $callbacks[$formValues['operations']];
+
+foreach ($_POST['checks'] as $key => $checked) {
+  if ($checked) {
+    call_user_func_array($callback, array($key));
+  }
+}
+
+// vim:ft=php:sts=2:sw=2:ts=2:et:ai:sta:ff=unix
Index: module/form/theme/publisher.msp_list.theme
===================================================================
RCS file: module/form/theme/publisher.msp_list.theme
diff -N module/form/theme/publisher.msp_list.theme
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ module/form/theme/publisher.msp_list.theme	25 Apr 2008 18:22:48 -0000
@@ -0,0 +1,28 @@
+<?php
+/**
+ * @file
+ * @copyright 2008 Sieb Unlimited, LLC
+ * @license @see(LICENSE.txt)
+ * $Id: $
+ */
+
+global $hdr, $pageRows;
+if (isset($form) && isset($form['checks'])) {
+  foreach (element_children($form['checks']) as $key) {
+    $row = array(
+      drupal_render($form['checks'][$key]),
+      drupal_render($form['id'][$key]),
+      drupal_render($form['displayName'][$key]),
+      drupal_render($form['enabled'][$key]),
+      drupal_render($form['deleted'][$key]),
+      drupal_render($form['created'][$key]),
+      drupal_render($form['lastUpdated'][$key]),
+    );
+    $mspRows[] = $row;
+  }
+} 
+$theme .= theme('table', $hdr, $mspRows);
+$theme .= theme('pager', NULL, $pageRows, 0);
+$theme .= drupal_render($form);
+
+// vim:ft=php:sts=2:sw=2:ts=2:et:ai:sta:ff=unix
Index: module/form/validate/publisher.msp_add.validate
===================================================================
RCS file: module/form/validate/publisher.msp_add.validate
diff -N module/form/validate/publisher.msp_add.validate
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ module/form/validate/publisher.msp_add.validate	25 Apr 2008 18:22:48 -0000
@@ -0,0 +1,28 @@
+<?php
+/**
+ * @file
+ * @copyright 2008 Sieb Unlimited, LLC
+ * @license @see(LICENSE.txt)
+ * $Id: $
+ */
+
+if (!empty($formValues['mspHomeURL'])) {
+  if (!valid_url($formValues['mspHomeURL'], TRUE)) {
+    form_set_error('mspHomeURL', t('MSP Home URL is an invalid URL pattern.'));
+  }
+}
+
+if (!empty($formValues['mspLoginURL'])) {
+  if (!valid_url($formValues['mspLoginURL'], TRUE)) {
+    form_set_error('mspLoginURL', t('MSP Login URL is an invalid URL pattern.'));
+  }
+
+  if (empty($formValues['userName'])) {
+    form_set_error('userName', t('Login URL given without a user name.'));
+  }
+
+  if (empty($formValues['userPass'])) {
+    form_set_error('userPass', t('Login URL given without a user password.'));
+  }
+}
+// vim:ft=php:sts=2:sw=2:ts=2:et:ai:sta:ff=unix
Index: module/form/validate/publisher.msp_list.validate
===================================================================
RCS file: module/form/validate/publisher.msp_list.validate
diff -N module/form/validate/publisher.msp_list.validate
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ module/form/validate/publisher.msp_list.validate	25 Apr 2008 18:22:48 -0000
@@ -0,0 +1,25 @@
+<?php
+/**
+ * @file
+ * @copyright 2008 Sieb Unlimited, LLC
+ * @license @see(LICENSE.txt)
+ * $Id: $
+ */
+
+if (!count(array_filter($formValues['checks']))) {
+  form_set_error('checks', t('You must select at list one row in the list.'));
+}
+if (!$formValues['operations']) {
+  form_set_error('operations', t('You must select an action.'));
+}
+if ($formValues['operations'] == 1) {
+  $msps = _publisher_msp_get(array_keys(array_filter($formValues['checks'])));
+  foreach ($msps as $msp) {
+    if ($msp->deleted) {
+      form_set_error('operations', t('You cannot enable a deleted MSP.'));
+      break;
+    }
+  }
+}
+
+// vim:ft=php:sts=2:sw=2:ts=2:et:ai:sta:ff=unix
Index: module/help/publisher.default.help
===================================================================
RCS file: module/help/publisher.default.help
diff -N module/help/publisher.default.help
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ module/help/publisher.default.help	25 Apr 2008 18:22:48 -0000
@@ -0,0 +1,20 @@
+<?php
+/**
+ * @file
+ * @copyright 2008 Sieb Unlimited, LLC
+ * @license @see(LICENSE.txt)
+ * $Id: $
+ */
+
+global $publisherBuild;
+
+$output = pub_publisher_header('Publisher Module Welcome') . t("<p>
+The Publisher set of tools provides you with the means to control your 
+associations to merchant service providers, the merchants themselves and your
+online web site publishing.  You will be able to use tools to
+provide data either by RSS/ATOM, XML, CSV, TSV and other delimited data files.
+You will be able to batch the data import and node creation as well as control
+the node activation, deactivation and deletion of the node and data control set.
+</p>");
+
+// vim:ft=php:sts=2:sw=2:ts=2:et:ai:sta:ff=unix
Index: module/help/publisher.help
===================================================================
RCS file: module/help/publisher.help
diff -N module/help/publisher.help
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ module/help/publisher.help	25 Apr 2008 18:22:48 -0000
@@ -0,0 +1,33 @@
+<?php
+/**
+ * @file
+ * @copyright 2008 Sieb Unlimited, LLC
+ * @license @see(LICENSE.txt)
+ * $Id: $
+ */
+
+$output = '<p>'
+        . t("Publisher provides a set of tools that are common to 
+             publishing data in batch mode.  Some of the tools are
+             third party tools and are interfaced to the Drupal module
+             via glue magic.  The publisher module considers these tools
+             as plugins and can be found in the tools directory.")
+        . '</p><p>'
+        . t("The tools directory provides a hierarchy for include files,
+             libraries and executables.  So within the tools directory
+             you will find directories named bin/, etc/, include/, lib/
+             and modules/.  I suggest that the bin/, etc/, include/ and
+             lib/ directories be copied to DRUPALROOT/local/ to make it 
+             easier to execute.  The bin/ directory contains batch 
+             executables that will normally be executed by cron.  The 
+             modules/ directory provides the Drupal glue for controlling 
+             installation and access.")
+        . '</p>';
+$pubout = pub_module_hook_call_all('help', $what);
+if (isset($pubout)) {
+  $output .= '<div class="pub_tools">'."\n"
+          .  "$pubout\n"
+          .  '</div>'."\n";
+}
+
+// vim:ft=php:sts=2:sw=2:ts=2:et:ai:sta:ff=unix
Index: module/help/publisher.merchants.help
===================================================================
RCS file: module/help/publisher.merchants.help
diff -N module/help/publisher.merchants.help
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ module/help/publisher.merchants.help	25 Apr 2008 18:22:48 -0000
@@ -0,0 +1,26 @@
+<?php
+/**
+ * @file
+ * @copyright 2008 Sieb Unlimited, LLC
+ * @license @see(LICENSE.txt)
+ * $Id: $
+ */
+
+$output = pub_publisher_header('Merchants Maintenance') . t('<p>
+Merchants are those that provide goods for retail and give you a percentage of
+the sale for delivering someone to their door.  The merchants are picky about
+the content on your sites and provide you with data for you.  They give you
+URL to pictures and text for titles and descriptions.  They also provide the
+current retail price and maybe a ``on-sale\'\' price.  You are free to format
+the data however you choose.  Merchants choose which ever MSP they feel will
+provide them with the best service.  Some merchants use more than one MSP
+because they want to give you the best opportunity to serve them.
+</p><p>
+The goal of this module tool is to provide you with the means to control your
+association to merchants.  You will be able to list, add, edit and delete data
+relevant to your associatino to the merchant.  You need to have each of the MSP
+entered into the MSP control data before you enter the merchants so that you
+can associate the merchants to the appropriate MSP.
+</p>');
+
+// vim:ft=php:sts=2:sw=2:ts=2:et:ai:sta:ff=unix
Index: module/help/publisher.msp.help
===================================================================
RCS file: module/help/publisher.msp.help
diff -N module/help/publisher.msp.help
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ module/help/publisher.msp.help	25 Apr 2008 18:22:48 -0000
@@ -0,0 +1,24 @@
+<?php
+/**
+ * @file
+ * @copyright 2008 Sieb Unlimited, LLC
+ * @license @see(LICENSE.txt)
+ * $Id: $
+ */
+
+$output = pub_publisher_header('Merchant Service Provider (MSP) Maintenance');
+$output .= t('<p>
+The merchant service provider (MSP) provides the merchants with the abilitiy to
+control the relationship of the affiliate and the products and/or services that
+the merchants offer for retail sales.  There are many various MSP and the
+requirements of each MSP are quite different from each other.  The common thing
+for most MSP are an ID for the merchant, an ID for the affiliate and a
+redirection URI for the product item and/or service.
+</p><p>
+The goal of this module tool is to provide you the means to control your
+association to the MSP.  You may be a member of many of the MSP already.  With
+this tool you will be able to list, add, edit and delete data relevant to your
+association to the MSP.
+</p>');
+
+// vim:ft=php:sts=2:sw=2:ts=2:et:ai:sta:ff=unix
Index: module/help/publisher.webs.help
===================================================================
RCS file: module/help/publisher.webs.help
diff -N module/help/publisher.webs.help
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ module/help/publisher.webs.help	25 Apr 2008 18:22:48 -0000
@@ -0,0 +1,18 @@
+<?php
+/**
+ * @file
+ * @copyright 2008 Sieb Unlimited, LLC
+ * @license @see(LICENSE.txt)
+ * $Id: $
+ */
+
+$output = pub_publisher_header('Web Site Maintenance') . t('<p>
+You can\'t publish online without a website and this is about online publishing.
+</p><p>
+The goal of this module tool is to provide you with the means to control your
+web site data and to tie the web presence to each merchant and MSP.  You will be
+able to list, add edit and delete data relevant to each web site and the
+relationship between each merchant and MSP.
+</p>');
+
+// vim:ft=php:sts=2:sw=2:ts=2:et:ai:sta:ff=unix
Index: module/menu/publisher.menu
===================================================================
RCS file: module/menu/publisher.menu
diff -N module/menu/publisher.menu
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ module/menu/publisher.menu	25 Apr 2008 18:22:48 -0000
@@ -0,0 +1,64 @@
+<?php
+/**
+ * @file
+ * @copyright 2008 Sieb Unlimited, LLC
+ * @license @see(LICENSE.txt)
+ * $Id: $
+ */
+
+$publisherBase = variable_get('publisher_basedir', dirname(dirname(dirname(__FILE__))));
+require $publisherBase . '/tools/lib/publisher.menu.cls';
+
+global $pub_menu;
+
+/**
+ * Define pub_menu object.
+ */
+if (!isset($pub_menu)) {
+  $pub_menu = new pub_menu;
+  $pub_menu->item('publisher');
+  $pub_menu->description('Publisher Maintenance'); 
+  $pub_menu->title('Publisher');
+  $pub_menu->path('admin/publisher');
+  $pub_menu->access('administer publisher');
+  $pub_menu->callback('admin_publisher');
+  $pub_menu->type(MENU_NORMAL_ITEM);
+
+  $pub_menu->item('msp');
+  $pub_menu->description('Publisher MSP Maintenance');
+  $pub_menu->title('Merchant Service Provider');
+  $pub_menu->path('admin/publisher/msp');
+  $pub_menu->access('administer publisher msp');
+  $pub_menu->callback('drupal_get_form', 'admin_publisher_msp_list_form');
+  $pub_menu->type(MENU_NORMAL_ITEM);
+
+  $pub_menu->item('msp_list');
+  $pub_menu->description('Publisher MSP List');
+  $pub_menu->title('MSP List');
+  $pub_menu->path('admin/publisher/msp/list');
+  $pub_menu->access('view publisher msp');
+  $pub_menu->callback('drupal_get_form', 'admin_publisher_msp_list_form');
+  $pub_menu->type(MENU_DEFAULT_LOCAL_TASK);
+
+  $pub_menu->item('msp_add');
+  $pub_menu->description('Publisher MSP Add');
+  $pub_menu->title('MSP Add');
+  $pub_menu->path('admin/publisher/msp/add');
+  $pub_menu->access('administer publisher msp');
+  $pub_menu->callback('drupal_get_form', 'admin_publisher_msp_add_form');
+  $pub_menu->type(MENU_LOCAL_TASK);
+
+  $pub_menu->item('merchants');
+  $pub_menu->description('Publisher Merchants Maintenance');
+  $pub_menu->title('Merchants');
+  $pub_menu->path('admin/publisher/merchants');
+  $pub_menu->access('administer publisher merchants');
+
+  $pub_menu->item('websites');
+  $pub_menu->description('Publisher Web Sites Maintenance');
+  $pub_menu->title('Web Sites');
+  $pub_menu->path('admin/publisher/webs');
+  $pub_menu->access('administer publisher webs');
+}
+
+// vim:ft=php:sts=2:sw=2:ts=2:et:ai:sta:ff=unix
Index: tools/lib/publisher.lib
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/publisher/tools/lib/publisher.lib,v
retrieving revision 1.3
diff -u -p -r1.3 publisher.lib
--- tools/lib/publisher.lib	2 Apr 2008 18:10:25 -0000	1.3
+++ tools/lib/publisher.lib	25 Apr 2008 18:22:48 -0000
@@ -174,12 +174,9 @@ function pub_module_hook_exists ($module
 function pub_module_hook_call ($module, $hook/*, ...*/) {
   $args = func_get_args();
   array_shift($args); array_shift($args);
-  $ret = array();
+  $ret = NULL;
   if (pub_module_hook_exists($module, $hook)) {
     $ret = call_user_func_array(pub_module_hook_name($module, $hook), $args);
-    if (!is_array($ret)) {
-      $ret = array();
-    }
   }
   return $ret;
 }
@@ -266,6 +263,18 @@ function pub_module_unregister($module) 
 }
 
 /**
+ * TODO:
+ */
+function pub_module_status($module) {
+  if (pub_module_hook_exists($module, 'status')) {
+    return pub_module_hook_call($module, 'status');
+  }
+  else {
+    return "<p><strong>Module $module status is not given!</strong></p>";
+  }
+}
+
+/**
  * Disable a publisher tool module.
  *
  * @param string $module      // Name of disabled
Index: tools/lib/publisher.menu.cls
===================================================================
RCS file: tools/lib/publisher.menu.cls
diff -N tools/lib/publisher.menu.cls
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tools/lib/publisher.menu.cls	25 Apr 2008 18:22:48 -0000
@@ -0,0 +1,119 @@
+<?php
+/**
+ * @file
+ * @copyright 2008 Sieb Unlimited, LLC
+ * @license @see(LICENSE.txt)
+ * $Id: $
+ **/
+
+/**
+ * Build the Publisher menu class
+ **/
+if (!class_exists('pub_menu')) {
+  class pub_menu {
+    /** 
+     * @var array $menu
+     * Contains the items of the menu with Drupal requirements.
+     */
+    var $menu = array();
+    var $autoWeight = 0;
+    var $currentItem = NULL;
+
+    /**
+     * Initialzation
+     */
+    function pub_menu() {
+      $this->menu = array();
+    }
+
+    function item($item, $title=NULL, $path=NULL, $desc=NULL) {
+      $this->currentItem = $item;
+      $this->menu[$item] = array();
+      if (isset($title)) {
+        $this->title($title);
+      }
+      if (isset($path)) {
+        $this->path($path);
+      }
+      if (isset($desc)) {
+        $this->description($desc);
+      }
+      $this->type(MENU_NORMAL_ITEM);
+      $this->weight($this->autoWeight);
+    }
+
+    function access($access) {
+      $this->menu[$this->currentItem]['access'] = is_string($access)
+                                                ? user_access($access)
+                                                : $access
+                                                ;
+    }
+
+    function callback($func, $func_args=NULL) {
+      $this->menu[$this->currentItem]['callback'] = $func;
+      $this->type(MENU_CALLBACK);
+      $this->callbackArguments($func_args);
+    }
+
+    function callbackArguments($args) {
+      if (isset($args)) {
+        if (!is_array($args)) {
+          $args = array($args);
+        }
+        $this->menu[$this->currentItem]['callback arguments'] = $args;
+      }
+    }
+
+    function description($desc) {
+      $this->menu[$this->currentItem]['description'] = t($desc);
+    }
+
+    function path($path) {
+      $this->menu[$this->currentItem]['path'] = $path;
+    }
+
+    function title($title) {
+      $this->menu[$this->currentItem]['title'] = t($title);
+    }
+
+    function type($type) {
+      $this->menu[$this->currentItem]['type'] = $type;
+    }
+
+    function weight($weight) {
+      $this->menu[$this->currentItem]['weight'] = $weight;
+      $this->autoWeight = ++$weight;
+    }
+
+    /**
+     * Return the menu array
+     */
+    function get() {
+      return $this->menu;
+    }
+
+    /**
+     * Return a link for the given menu id or an array of links based on the
+     * full set of menu items.
+     *
+     * @return mixed
+     */
+    function link($id = NULL) {
+      if (isset($id)) {
+        return l($this->menu[$id]['title'], 
+                 $this->menu[$id]['path'], 
+                 array('title' => $this->menu[$id]['description'])
+                );
+      }
+      else {
+        $links = array();
+        foreach ($this->menu as $id) {
+          $links[] = $this->link($id);
+        }
+        return $links;
+      }
+    }
+  }
+}
+
+// vim:ft=php:sts=2:sw=2:ts=2:et:ai:sta:ff=unix
Index: tools/modules/datafeed/datafeed.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/publisher/tools/modules/datafeed/datafeed.module,v
retrieving revision 1.2
diff -u -p -r1.2 datafeed.module
--- tools/modules/datafeed/datafeed.module	2 Apr 2008 18:10:25 -0000	1.2
+++ tools/modules/datafeed/datafeed.module	25 Apr 2008 18:22:48 -0000
@@ -17,6 +17,7 @@ function pub_datafeed_perm() {
  * Define publisher datafeed help function via hook_help API.
  */
 function pub_datafeed_help($what) {
+  $output = NULL;
   switch ($what) {
     case 'admin/help#publisher':
     case 'admin/help#datafeed': {
