? 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 @@ -' - . 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.") - . '
' - . 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.") - . '
'; - } break; - default: { - $output = NULL; - } - } - $output .= '';
+ $output .= 'Sponsored by: Give-Me-An-Offer.com
';
+ $output .= 'Tool: ' . $tool . '
';
+ $output .= 'Module: ' . $module . '
';
+ $output .= 'Form: ' . $form . '
';
+ $output .= 'Build: ' . $build . '
';
+ $output .= '
' . theme('item_list', array('#message' => print_r($mspForm->get(),true))) . '
'; + // $output = drupal_render($mspForm->id, $mspForm->get()); + } break; + case 'merchants': { + } break; + case 'webs': { + } break; + default: { + $output = t(''. theme('item_list', $links) . '
'; + } + } + 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 @@ + 'markup', + '#value' => '' + . 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.") + . '
'; +$pubout = pub_module_hook_call_all('help', $what); +if (isset($pubout)) { + $output .= '+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. +
'); + +// 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 @@ + +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. ++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. +
'); + +// 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 @@ + +You can\'t publish online without a website and this is about online publishing. ++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. +
'); + +// 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 @@ +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 "Module $module status is not given!
"; + } +} + +/** * 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 @@ +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': {