=== modified file 'payment/uc_2checkout/uc_2checkout.module' --- payment/uc_2checkout/uc_2checkout.module 2010-01-25 16:37:01 +0000 +++ payment/uc_2checkout/uc_2checkout.module 2010-02-11 17:43:02 +0000 @@ -75,11 +75,11 @@ } /** - * Implementation of hook_payment_method(). + * Implementation of hook_uc_payment_method(). * * @see uc_payment_method_2checkout() */ -function uc_2checkout_payment_method() { +function uc_2checkout_uc_payment_method() { $path = base_path() . drupal_get_path('module', 'uc_2checkout'); $title = variable_get('uc_2checkout_method_title', t('Credit card on a secure server:')); $title .= '
'; === modified file 'payment/uc_authorizenet/uc_authorizenet.module' --- payment/uc_authorizenet/uc_authorizenet.module 2010-02-04 21:52:20 +0000 +++ payment/uc_authorizenet/uc_authorizenet.module 2010-02-11 17:42:41 +0000 @@ -71,9 +71,9 @@ } /** - * Implementation of hook_payment_gateway(). + * Implementation of hook_uc_payment_gateway(). */ -function uc_authorizenet_payment_gateway() { +function uc_authorizenet_uc_payment_gateway() { $gateways[] = array( 'id' => 'authorizenet', 'title' => t('Authorize.net'), === modified file 'payment/uc_credit/test_gateway.module' --- payment/uc_credit/test_gateway.module 2009-07-11 19:04:32 +0000 +++ payment/uc_credit/test_gateway.module 2010-02-11 17:42:20 +0000 @@ -12,7 +12,7 @@ * Hook Functions (Ubercart) ******************************************************************************/ -function test_gateway_payment_gateway() { +function test_gateway_uc_payment_gateway() { $gateways[] = array( 'id' => 'test_gateway', 'title' => t('Test Gateway'), === modified file 'payment/uc_credit/uc_credit.module' --- payment/uc_credit/uc_credit.module 2010-02-08 20:07:51 +0000 +++ payment/uc_credit/uc_credit.module 2010-02-11 17:42:03 +0000 @@ -263,9 +263,9 @@ ******************************************************************************/ /** - * Implementation of hook_store_status(). + * Implementation of hook_uc_store_status(). */ -function uc_credit_store_status() { +function uc_credit_uc_store_status() { // Throw up an error row if encryption has not been set up yet. if ($key = uc_credit_encryption_key()) { $statuses[] = array( @@ -294,9 +294,9 @@ } /** - * Implementation of hook_order(). + * Implementation of hook_uc_order(). */ -function uc_credit_order($op, &$arg1, $arg2) { +function uc_credit_uc_order($op, &$arg1, $arg2) { // Set up the encryption key and object for saving and loading. if ($arg1->payment_method == 'credit' && ($op == 'save' || $op == 'load')) { // Log an error if encryption isn't configured properly. @@ -1431,7 +1431,7 @@ // Save it again. db_update('uc_orders') ->fields(array('data' => serialize($data))) - ->condition('order_id' => $order_id) + ->condition('order_id', $order_id) ->execute(); } === modified file 'payment/uc_cybersource/uc_cybersource.module' --- payment/uc_cybersource/uc_cybersource.module 2010-02-04 21:52:20 +0000 +++ payment/uc_cybersource/uc_cybersource.module 2010-02-11 17:41:11 +0000 @@ -68,9 +68,9 @@ ******************************************************************************/ /** - * Implementation of hook_payment_gateway(). + * Implementation of hook_uc_payment_gateway(). */ -function uc_cybersource_payment_gateway() { +function uc_cybersource_uc_payment_gateway() { $gateways[] = array( 'id' => 'cybersource', 'title' => t('CyberSource'), === modified file 'payment/uc_google_checkout/uc_google_checkout.module' --- payment/uc_google_checkout/uc_google_checkout.module 2010-02-04 21:52:20 +0000 +++ payment/uc_google_checkout/uc_google_checkout.module 2010-02-11 17:40:30 +0000 @@ -187,7 +187,7 @@ * Hook Functions (Ubercart) * ******************************************************************************/ -function uc_google_checkout_cart_pane() { +function uc_google_checkout_uc_cart_pane() { $panes[] = array( 'id' => 'uc_google_checkout', 'title' => t('Google Checkout'), @@ -198,7 +198,7 @@ return $panes; } -function uc_google_checkout_order_pane() { +function uc_google_checkout_uc_order_pane() { $panes[] = array( 'id' => 'email_allowed', 'callback' => 'uc_google_checkout_pane_email_allowed', @@ -212,7 +212,7 @@ return $panes; } -function uc_google_checkout_line_item() { +function uc_google_checkout_uc_line_item() { $items[] = array( 'id' => 'gc_coupon', 'title' => t('Google Checkout Coupon'), @@ -231,7 +231,7 @@ return $items; } -function uc_google_checkout_order($op, &$arg1, $arg2) { +function uc_google_checkout_uc_order($op, &$arg1, $arg2) { switch ($op) { case 'load': $result = db_query("SELECT * FROM {uc_gc_orders} WHERE order_id = %d", $arg1->order_id); @@ -261,9 +261,9 @@ } /** - * Implementation of hook_payment_method(). + * Implementation of hook_uc_payment_method(). */ -function uc_google_checkout_payment_method() { +function uc_google_checkout_uc_payment_method() { $methods[] = array( 'id' => 'google_checkout', 'name' => t('Google Checkout'), @@ -277,7 +277,7 @@ return $methods; } -function uc_google_checkout_payment_gateway() { +function uc_google_checkout_uc_payment_gateway() { $gateways[] = array( 'id' => 'google_checkout', 'title' => t('Google Checkout'), @@ -287,7 +287,7 @@ return $gateways; } -function uc_google_checkout_shipment($op, $shipment) { +function uc_google_checkout_uc_shipment($op, $shipment) { switch ($op) { case 'save': $google_order_number = uc_google_checkout_get_google_number($shipment->order_id); === modified file 'payment/uc_payment/uc_payment.api.php' --- payment/uc_payment/uc_payment.api.php 2010-02-02 16:01:30 +0000 +++ payment/uc_payment/uc_payment.api.php 2010-02-12 14:11:44 +0000 @@ -12,6 +12,35 @@ */ /** + * Take action when a payment is entered for an order. + * + * @param $order + * The order object. + * @param $method + * The name of the payment method used. + * @param $amount + * The value of the payment. + * @param $account + * The user account that entered the order. When the payment is entered + * during checkout, this is probably the order's user. Otherwise, it is + * likely a store administrator. + * @param $data + * Extra data associated with the transaction. + * @param $comment + * Any comments from the user about the transaction. + */ +function hook_uc_payment_entered($order, $method, $amount, $account, $data, $comment) { + drupal_set_message(t('User @uid entered a @method payment of @amount for order @order_id.', + array( + '@uid' => $account->uid, + '@method' => $method, + '@amount' => uc_price($amount, array('location' => 'hook-payment', 'revision' => 'formatted-original')), + '@order_id' => $order->order_id, + )) + ); +} + +/** * Register payment gateway callbacks. * * @see @link http://www.ubercart.org/docs/api/hook_payment_gateway @endlink @@ -33,7 +62,7 @@ * - value: The name of a function that returns an array of settings form * elements for the gateway. */ -function hook_payment_gateway() { +function hook_uc_payment_gateway() { $gateways[] = array( 'id' => 'test_gateway', 'title' => t('Test Gateway'), @@ -55,7 +84,7 @@ * @return * An array of payment methods. */ -function hook_payment_method() { +function hook_uc_payment_method() { $methods[] = array( 'id' => 'check', 'name' => t('Check'), @@ -69,35 +98,6 @@ } /** - * Take action when a payment is entered for an order. - * - * @param $order - * The order object. - * @param $method - * The name of the payment method used. - * @param $amount - * The value of the payment. - * @param $account - * The user account that entered the order. When the payment is entered - * during checkout, this is probably the order's user. Otherwise, it is - * likely a store administrator. - * @param $data - * Extra data associated with the transaction. - * @param $comment - * Any comments from the user about the transaction. - */ -function hook_uc_payment_entered($order, $method, $amount, $account, $data, $comment) { - drupal_set_message(t('User @uid entered a @method payment of @amount for order @order_id.', - array( - '@uid' => $account->uid, - '@method' => $method, - '@amount' => uc_price($amount, array('location' => 'hook-payment', 'revision' => 'formatted-original')), - '@order_id' => $order->order_id, - )) - ); -} - -/** * @} End of "addtogroup hooks". */ === modified file 'payment/uc_payment/uc_payment.module' --- payment/uc_payment/uc_payment.module 2010-02-08 20:07:51 +0000 +++ payment/uc_payment/uc_payment.module 2010-02-11 17:39:11 +0000 @@ -240,9 +240,9 @@ ******************************************************************************/ /** - * Implementation of hook_order(). + * Implementation of hook_uc_order(). */ -function uc_payment_order($op, &$arg1) { +function uc_payment_uc_order($op, &$arg1) { switch ($op) { case 'submit': $func = _payment_method_data($arg1->payment_method, 'callback'); @@ -289,9 +289,9 @@ } /** - * Implementation of hook_checkout_pane(). + * Implementation of hook_uc_checkout_pane(). */ -function uc_payment_checkout_pane() { +function uc_payment_uc_checkout_pane() { $panes[] = array( 'id' => 'payment', 'title' => t('Payment method'), @@ -304,9 +304,9 @@ } /** - * Implementation of hook_order_pane(). + * Implementation of hook_uc_order_pane(). */ -function uc_payment_order_pane() { +function uc_payment_uc_order_pane() { $panes[] = array( 'id' => 'payment', 'callback' => 'uc_order_pane_payment', @@ -321,9 +321,9 @@ } /** - * Implementation of hook_order_state(). + * Implementation of hook_uc_order_state(). */ -function uc_payment_order_state() { +function uc_payment_uc_order_state() { $states[] = array( 'id' => 'payment_received', 'title' => t('Payment received'), @@ -738,7 +738,7 @@ return $methods; } - $methods = module_invoke_all('payment_method'); + $methods = module_invoke_all('uc_payment_method'); foreach ($methods as $i => $value) { $methods[$i]['checkout'] = variable_get('uc_payment_method_'. $methods[$i]['id'] .'_checkout', $methods[$i]['checkout']); $methods[$i]['weight'] = variable_get('uc_payment_method_'. $methods[$i]['id'] .'_weight', $methods[$i]['weight']); @@ -764,7 +764,7 @@ * Build a list of payment gateways defined in the enabled modules. */ function _payment_gateway_list($filter = NULL, $enabled_only = FALSE) { - $gateways = module_invoke_all('payment_gateway'); + $gateways = module_invoke_all('uc_payment_gateway'); foreach ($gateways as $i => $value) { $gateways[$i]['enabled'] = variable_get('uc_pg_'. $gateways[$i]['id'] .'_enabled', TRUE); === modified file 'payment/uc_payment_pack/uc_payment_pack.module' --- payment/uc_payment_pack/uc_payment_pack.module 2010-02-04 21:52:20 +0000 +++ payment/uc_payment_pack/uc_payment_pack.module 2010-02-11 17:38:12 +0000 @@ -44,9 +44,9 @@ } /** - * Implementation of hook_payment_method(). + * Implementation of hook_uc_payment_method(). */ -function uc_payment_pack_payment_method() { +function uc_payment_pack_uc_payment_method() { $methods[] = array( 'id' => 'check', 'name' => t('Check'), === modified file 'payment/uc_paypal/uc_paypal.module' --- payment/uc_paypal/uc_paypal.module 2010-02-08 20:07:51 +0000 +++ payment/uc_paypal/uc_paypal.module 2010-02-11 17:38:01 +0000 @@ -131,9 +131,9 @@ ******************************************************************************/ /** - * Implementation of hook_cart_pane(). + * Implementation of hook_uc_cart_pane(). */ -function uc_paypal_cart_pane() { +function uc_paypal_uc_cart_pane() { $panes[] = array( 'id' => 'uc_paypal_ec', 'title' => t('PayPal Express Checkout'), @@ -146,9 +146,9 @@ } /** - * Implementation of hook_payment_gateway(). + * Implementation of hook_uc_payment_gateway(). */ -function uc_paypal_payment_gateway() { +function uc_paypal_uc_payment_gateway() { $gateways[] = array( 'id' => 'paypal_wpp', 'title' => t('PayPal Website Payments Pro'), @@ -162,9 +162,9 @@ } /** - * Implementation of hook_payment_method(). + * Implementation of hook_uc_payment_method(). */ -function uc_paypal_payment_method() { +function uc_paypal_uc_payment_method() { $path = base_path() . drupal_get_path('module', 'uc_credit'); $title1 = '' . t('PayPal - pay without sharing your financial information.'); === modified file 'payment/uc_paypal/uc_paypal.pages.inc' --- payment/uc_paypal/uc_paypal.pages.inc 2010-02-08 21:59:21 +0000 +++ payment/uc_paypal/uc_paypal.pages.inc 2010-02-11 17:02:49 +0000 @@ -342,7 +342,7 @@ $order->quote['rate'] = $_POST['rate'][isset($_POST['quote-option']) ? strval($_POST['quote-option']) : 0]; $order->quote['quote_form'] = rawurldecode($_POST['quote-form']); - $methods = module_invoke_all('shipping_method'); + $methods = module_invoke_all('uc_shipping_method'); $method = $methods[$order->quote['method']]; $label = is_null($_POST['quote-option']) ? t('Error calculating shipping') : $method['quote']['accessorials'][$order->quote['accessorials']]; $result = db_query("SELECT line_item_id FROM {uc_order_line_items} WHERE order_id = :id AND type = :type", array(':id' => $order->order_id, ':type' => 'shipping')); === modified file 'shipping/uc_flatrate/uc_flatrate.module' --- shipping/uc_flatrate/uc_flatrate.module 2010-02-05 20:22:05 +0000 +++ shipping/uc_flatrate/uc_flatrate.module 2010-02-11 17:27:49 +0000 @@ -173,9 +173,9 @@ } /** - * Implementation of Ubercart's hook_shipping_method(). + * Implementation of Ubercart's hook_uc_shipping_method(). */ -function uc_flatrate_shipping_method() { +function uc_flatrate_uc_shipping_method() { $methods = array(); $enabled = variable_get('uc_quote_enabled', array()); === modified file 'shipping/uc_quote/uc_quote.admin.inc' --- shipping/uc_quote/uc_quote.admin.inc 2010-02-03 21:38:09 +0000 +++ shipping/uc_quote/uc_quote.admin.inc 2010-02-11 17:02:49 +0000 @@ -216,7 +216,7 @@ '#tree' => TRUE, ); $weight = variable_get('uc_quote_type_weight', array()); - $shipping_methods = module_invoke_all('shipping_method'); + $shipping_methods = module_invoke_all('uc_shipping_method'); $method_types = array(); foreach ($shipping_methods as $method) { $method_types[$method['quote']['type']][] = $method['title']; === modified file 'shipping/uc_quote/uc_quote.api.php' --- shipping/uc_quote/uc_quote.api.php 2010-02-10 18:54:01 +0000 +++ shipping/uc_quote/uc_quote.api.php 2010-02-12 14:10:56 +0000 @@ -52,7 +52,7 @@ * output this array so the method doesn't need to be found just for the * package types. */ -function hook_shipping_method() { +function hook_uc_shipping_method() { $methods = array(); $enabled = variable_get('uc_quote_enabled', array('ups' => TRUE)); @@ -109,7 +109,7 @@ * @return * An array of shipping types keyed by a machine-readable name. */ -function hook_shipping_type() { +function hook_uc_shipping_type() { $weight = variable_get('uc_quote_type_weight', array('small_package' => 0)); $types = array(); === modified file 'shipping/uc_quote/uc_quote.module' --- shipping/uc_quote/uc_quote.module 2010-02-08 21:59:21 +0000 +++ shipping/uc_quote/uc_quote.module 2010-02-11 17:27:33 +0000 @@ -275,7 +275,7 @@ * configurations. */ function uc_quote_ca_trigger() { - $methods = module_invoke_all('shipping_method'); + $methods = module_invoke_all('uc_shipping_method'); $triggers = array(); foreach ($methods as $id => $method) { $triggers['get_quote_from_'. $id] = array( @@ -367,7 +367,7 @@ } // Otherwise, look harder. if (is_array($order->line_items)) { - $methods = module_invoke_all('shipping_method'); + $methods = module_invoke_all('uc_shipping_method'); $accessorials = $methods[$settings['method']]['quote']['accessorials']; foreach ($order->line_items as $line_item) { @@ -385,7 +385,7 @@ */ function uc_quote_condition_order_shipping_method_form($form_state, $settings = array()) { $form = array(); - $methods = module_invoke_all('shipping_method'); + $methods = module_invoke_all('uc_shipping_method'); $enabled = variable_get('uc_quote_enabled', array()); $options = array(); @@ -475,9 +475,9 @@ ******************************************************************************/ /** - * Implementation of hook_cart_pane(). + * Implementation of hook_uc_cart_pane(). */ -function uc_quote_cart_pane($items) { +function uc_quote_uc_cart_pane($items) { if (arg(0) == 'cart') { if (!variable_get('uc_cap_quotes_enabled', FALSE) || (variable_get('uc_cart_delivery_not_shippable', TRUE) && !uc_cart_is_shippable())) { return array(); @@ -496,7 +496,7 @@ /** * Define the shipping quote checkout pane. */ -function uc_quote_checkout_pane() { +function uc_quote_uc_checkout_pane() { $panes[] = array('id' => 'quotes', 'callback' => 'uc_checkout_pane_quotes', 'title' => t('Calculate shipping cost'), @@ -510,7 +510,7 @@ /** * Defines the shipping quote order pane. */ -function uc_quote_order_pane() { +function uc_quote_uc_order_pane() { $panes = array(); $panes[] = array( @@ -527,23 +527,23 @@ } /** - * Implementation of hook_add_to_cart(). - */ -function uc_quote_add_to_cart() { - unset($_SESSION['quote']); -} - -/** - * Implementation of hook_update_cart_item(). - */ -function uc_quote_update_cart_item() { - unset($_SESSION['quote']); -} - -/** - * Implementation of hook_order(). - */ -function uc_quote_order($op, &$arg1, $arg2) { + * Implementation of hook_uc_add_to_cart(). + */ +function uc_quote_uc_add_to_cart() { + unset($_SESSION['quote']); +} + +/** + * Implementation of hook_uc_update_cart_item(). + */ +function uc_quote_uc_update_cart_item() { + unset($_SESSION['quote']); +} + +/** + * Implementation of hook_uc_order(). + */ +function uc_quote_uc_order($op, &$arg1, $arg2) { switch ($op) { case 'submit': unset($_SESSION['quote']); @@ -573,9 +573,9 @@ } /** - * Implementation of hook_line_item(). + * Implementation of hook_uc_line_item(). */ -function uc_quote_line_item() { +function uc_quote_uc_line_item() { $items[] = array( 'id' => 'shipping', 'title' => t('Shipping'), @@ -590,9 +590,9 @@ } /** - * Implementation of hook_shipping_type(). + * Implementation of hook_uc_shipping_type(). */ -function uc_quote_shipping_type() { +function uc_quote_uc_shipping_type() { $weight = variable_get('uc_quote_type_weight', array('small_package' => 0)); $types = array(); @@ -718,7 +718,7 @@ $type_weight = $all_types[$type]['weight']; } } - $methods = array_filter(module_invoke_all('shipping_method'), '_uc_quote_method_enabled'); + $methods = array_filter(module_invoke_all('uc_shipping_method'), '_uc_quote_method_enabled'); uasort($methods, '_uc_quote_type_sort'); $method_choices = array(); foreach ($methods as $method) { @@ -913,7 +913,7 @@ $arg1->quote['method'] = $quote_option[0]; $arg1->quote['accessorials'] = $quote_option[1]; $_SESSION['quote']['quote_form'] = rawurldecode($_POST['quote-form']); - $methods = array_filter(module_invoke_all('shipping_method'), '_uc_quote_method_enabled'); + $methods = array_filter(module_invoke_all('uc_shipping_method'), '_uc_quote_method_enabled'); $method = $methods[$quote_option[0]]; $quote_data = array(); @@ -1066,7 +1066,7 @@ $order->quote['method'] = $quote_option[0]; $order->quote['accessorials'] = $quote_option[1]; $order->quote['quote_form'] = rawurldecode($_POST['quote-form']); - $methods = array_filter(module_invoke_all('shipping_method'), '_uc_quote_method_enabled'); + $methods = array_filter(module_invoke_all('uc_shipping_method'), '_uc_quote_method_enabled'); $method = $methods[$quote_option[0]]; $quote_data = array(); @@ -1147,7 +1147,7 @@ '#value' => '
'. rawurldecode($_SESSION['quote']['quote_form']) .'
', '#weight' => 1, ); - $methods = module_invoke_all('shipping_method'); + $methods = module_invoke_all('uc_shipping_method'); $method = $methods[$quote['method']]; drupal_add_js('jQuery(document).ready(function() { @@ -1215,7 +1215,7 @@ * Return an array of quote types to be selected in a form. */ function uc_quote_type_options() { - $methods = module_invoke_all('shipping_method'); + $methods = module_invoke_all('uc_shipping_method'); foreach ($methods as $method) { if (isset($method['quote'])) { $types[$method['id']] = $method['title']; @@ -1249,7 +1249,7 @@ */ function uc_quote_get_shipping_types() { $args = array(); - $hook = 'shipping_type'; + $hook = 'uc_shipping_type'; $return = array(); foreach (module_implements($hook) as $module) { $function = $module .'_'. $hook; @@ -1269,7 +1269,7 @@ * Return an options array of shipping methods. */ function uc_quote_shipping_method_options() { - $methods = module_invoke_all('shipping_method'); + $methods = module_invoke_all('uc_shipping_method'); uasort($methods, '_uc_quote_type_sort'); $types = array(); foreach ($methods as $method) { === modified file 'shipping/uc_quote/uc_quote.pages.inc' --- shipping/uc_quote/uc_quote.pages.inc 2009-09-21 14:13:04 +0000 +++ shipping/uc_quote/uc_quote.pages.inc 2010-02-11 17:02:49 +0000 @@ -100,7 +100,7 @@ $type_weight = $all_types[$type]['weight']; } } - $methods = array_filter(module_invoke_all('shipping_method'), '_uc_quote_method_enabled'); + $methods = array_filter(module_invoke_all('uc_shipping_method'), '_uc_quote_method_enabled'); uasort($methods, '_uc_quote_type_sort'); foreach ($methods as $id => $method) { if ($method['quote']['type'] != 'order' && $method['quote']['type'] != $shipping_type) { === modified file 'shipping/uc_shipping/uc_shipping.admin.inc' --- shipping/uc_shipping/uc_shipping.admin.inc 2010-02-05 22:49:53 +0000 +++ shipping/uc_shipping/uc_shipping.admin.inc 2010-02-11 17:02:49 +0000 @@ -387,7 +387,7 @@ function uc_shipping_package_cancel_confirm_submit($form, &$form_state) { $package = uc_shipping_package_load($form_state['values']['package_id']); $shipment = uc_shipping_shipment_load($package->sid); - $methods = module_invoke_all('shipping_method'); + $methods = module_invoke_all('uc_shipping_method'); if (function_exists($methods[$shipment->shipping_method]['cancel'])) { $result = call_user_func($methods[$shipment->shipping_method]['cancel'], $shipment->tracking_number, array($package->tracking_number)); if ($result) { @@ -511,7 +511,7 @@ } $option_methods = array(); $shipping_types = uc_quote_get_shipping_types(); - $shipping_methods = module_invoke_all('shipping_method'); + $shipping_methods = module_invoke_all('uc_shipping_method'); $shipping_methods_by_type = array(); foreach ($shipping_methods as $method) { if (isset($method['ship'])) { @@ -641,7 +641,7 @@ if ($shipment->tracking_number) { $rows[] = array(t('Tracking Number:'), check_plain($shipment->tracking_number)); } - $methods = module_invoke_all('shipping_method'); + $methods = module_invoke_all('uc_shipping_method'); $method = $methods[$shipment->shipping_method]; if (isset($method['quote']['accessorials'][$shipment->accessorials])) { $rows[] = array(t('Services:'), $method['quote']['accessorials'][$shipment->accessorials]); @@ -677,7 +677,7 @@ $form['order_id'] = array('#type' => 'value', '#value' => $order->order_id); if (isset($shipment->sid)) { $form['sid'] = array('#type' => 'value', '#value' => $shipment->sid); - $methods = module_invoke_all('shipping_method'); + $methods = module_invoke_all('uc_shipping_method'); $method = $methods[$shipment->shipping_method]; } $addresses = array(); @@ -967,7 +967,7 @@ */ function uc_shipping_shipment_delete_confirm_submit($form, &$form_state) { $shipment = uc_shipping_shipment_load($form_state['values']['sid']); - $methods = module_invoke_all('shipping_method'); + $methods = module_invoke_all('uc_shipping_method'); if ($shipment->tracking_number && function_exists($methods[$shipment->shipping_method]['cancel'])) { $result = call_user_func($methods[$shipment->shipping_method]['cancel'], $shipment->tracking_number); if ($result) { @@ -994,7 +994,7 @@ $order = array_shift($args); $method_id = array_shift($args); $package_ids = $args; - $methods = module_invoke_all('shipping_method'); + $methods = module_invoke_all('uc_shipping_method'); $method = $methods[$method_id]; if (isset($method)) { $inc_file = drupal_get_path('module', $method['module']) .'/'. $method['ship']['file']; === modified file 'shipping/uc_shipping/uc_shipping.api.php' --- shipping/uc_shipping/uc_shipping.api.php 2010-02-02 16:01:30 +0000 +++ shipping/uc_shipping/uc_shipping.api.php 2010-02-11 17:25:56 +0000 @@ -26,7 +26,7 @@ * Only given when $op is "load". An array of extra data to be added to the * shipment object. */ -function hook_shipment($op, &$shipment) { +function hook_uc_shipment($op, &$shipment) { switch ($op) { case 'save': $google_order_number = uc_google_checkout_get_google_number($shipment->order_id); === modified file 'shipping/uc_shipping/uc_shipping.module' --- shipping/uc_shipping/uc_shipping.module 2010-02-10 18:54:01 +0000 +++ shipping/uc_shipping/uc_shipping.module 2010-02-11 17:25:41 +0000 @@ -233,9 +233,9 @@ ******************************************************************************/ /** - * Implementation of hook_order_pane(). + * Implementation of hook_uc_order_pane(). */ -function uc_shipping_order_pane() { +function uc_shipping_uc_order_pane() { $panes[] = array( 'id' => 'packages', 'callback' => 'uc_shipping_order_pane_packages', @@ -250,9 +250,9 @@ } /** - * Implemenation of hook_order_actions(). + * Implemenation of hook_uc_order_actions(). */ -function uc_shipping_order_actions($order) { +function uc_shipping_uc_order_actions($order) { $actions = array(); $module_path = base_path() . drupal_get_path('module', 'uc_shipping'); if (user_access('fulfill orders')) { @@ -295,7 +295,7 @@ $output .= '
'. t('Package %id:', array('%id' => $package->package_id)) .'
'; $rows[] = array(t('Contents:'), filter_xss_admin($package->description)); if ($shipment) { - $methods = module_invoke_all('shipping_method'); + $methods = module_invoke_all('uc_shipping_method'); $method = $methods[$shipment->shipping_method]; $pkg_type = $method['ship']['pkg_types'][$package->pkg_type]; } @@ -529,7 +529,7 @@ } $shipment->packages = $packages; - $extra = module_invoke_all('shipment', 'load', $shipment); + $extra = module_invoke_all('uc_shipment', 'load', $shipment); if (is_array($extra)) { foreach ($extra as $key => $value) { $shipment->$key = $value; @@ -580,7 +580,7 @@ } } - module_invoke_all('shipment', 'save', $shipment); + module_invoke_all('uc_shipment', 'save', $shipment); $order = uc_order_load($shipment->order_id); ca_pull_trigger('uc_shipment_save', $order, $shipment); } @@ -609,7 +609,7 @@ ->condition('sid', $shipment_id) ->execute(); - module_invoke_all('shipment', 'delete', $shipment); + module_invoke_all('uc_shipment', 'delete', $shipment); } /** === modified file 'shipping/uc_ups/uc_ups.module' --- shipping/uc_ups/uc_ups.module 2010-02-08 20:07:51 +0000 +++ shipping/uc_ups/uc_ups.module 2010-02-11 17:25:15 +0000 @@ -201,9 +201,9 @@ ******************************************************************************/ /** - * Implementation of hook_shipping_type(). + * Implementation of hook_uc_shipping_type(). */ -function uc_ups_shipping_type() { +function uc_ups_uc_shipping_type() { $weight = variable_get('uc_quote_type_weight', array('small_package' => 0)); $types = array(); @@ -217,9 +217,9 @@ } /** - * Implementation of hook_shipping_method(). + * Implementation of hook_uc_shipping_method(). */ -function uc_ups_shipping_method() { +function uc_ups_uc_shipping_method() { $methods = array(); $enabled = variable_get('uc_quote_enabled', array()); @@ -247,12 +247,12 @@ } /** - * Implementation of hook_store_status(). + * Implementation of hook_uc_store_status(). * * Let the administrator know that the UPS account information has not been * filled out. */ -function uc_ups_store_status() { +function uc_ups_uc_store_status() { $messages = array(); $access = variable_get('uc_ups_access_license', '') != ''; $account = variable_get('uc_ups_shipper_number', '') != ''; === modified file 'shipping/uc_usps/uc_usps.module' --- shipping/uc_usps/uc_usps.module 2010-02-08 20:07:51 +0000 +++ shipping/uc_usps/uc_usps.module 2010-02-11 17:24:35 +0000 @@ -243,9 +243,9 @@ ******************************************************************************/ /** - * Implementation of hook_shipping_type(). + * Implementation of hook_uc_shipping_type(). */ -function uc_usps_shipping_type() { +function uc_usps_uc_shipping_type() { $weight = variable_get('uc_quote_type_weight', array('envelope' => -1, 'small_package' => 0)); $types = array( @@ -265,9 +265,9 @@ } /** - * Implementation of hook_shipping_method(). + * Implementation of hook_uc_shipping_method(). */ -function uc_usps_shipping_method() { +function uc_usps_uc_shipping_method() { $enabled = variable_get('uc_quote_enabled', array()); $weight = variable_get('uc_quote_method_weight', array( 'usps_env' => 0, === modified file 'shipping/uc_weightquote/uc_weightquote.module' --- shipping/uc_weightquote/uc_weightquote.module 2010-02-05 20:22:05 +0000 +++ shipping/uc_weightquote/uc_weightquote.module 2010-02-11 17:24:07 +0000 @@ -175,9 +175,9 @@ } /** - * Implementation of hook_shipping_method(). + * Implementation of hook_uc_shipping_method(). */ -function uc_weightquote_shipping_method() { +function uc_weightquote_uc_shipping_method() { $methods = array(); $enabled = variable_get('uc_quote_enabled', array()); === modified file 'uc_attribute/uc_attribute.module' --- uc_attribute/uc_attribute.module 2010-02-08 20:07:51 +0000 +++ uc_attribute/uc_attribute.module 2010-02-11 17:23:50 +0000 @@ -439,7 +439,7 @@ /** * Store the customer's choices in the cart. */ -function uc_attribute_add_to_cart_data($form_values) { +function uc_attribute_uc_add_to_cart_data($form_values) { if (isset($form_values['attributes'])) { return array('attributes' => $form_values['attributes']); } @@ -449,9 +449,9 @@ } /** - * Implemenation of hook_order_product_alter(). + * Implemenation of hook_uc_order_product_alter(). */ -function uc_attribute_order_product_alter(&$product, $order) { +function uc_attribute_uc_order_product_alter(&$product, $order) { // Convert the attribute and option ids to their current names. This // preserves the important data in case the attributes or options are // changed later. @@ -466,9 +466,9 @@ } /** - * Implementation of hook_product_class(). + * Implementation of hook_uc_product_class(). */ -function uc_attribute_product_class($type, $op) { +function uc_attribute_uc_product_class($type, $op) { switch ($op) { case 'delete': db_delete('uc_class_attributes') @@ -484,9 +484,9 @@ } /** - * Implementation of hook_cart_item(). + * Implementation of hook_uc_cart_item(). */ -function uc_attribute_cart_item($op, &$item) { +function uc_attribute_uc_cart_item($op, &$item) { switch ($op) { case 'load': $options = _uc_cart_product_get_options($item); @@ -525,9 +525,9 @@ } /** - * Implementation of hook_product_description(). + * Implementation of hook_uc_product_description(). */ -function uc_attribute_product_description($product) { +function uc_attribute_uc_product_description($product) { $description = array( 'attributes' => array( '#product' => array( === modified file 'uc_cart/uc_cart.api.php' --- uc_cart/uc_cart.api.php 2010-02-02 16:01:30 +0000 +++ uc_cart/uc_cart.api.php 2010-02-12 14:13:58 +0000 @@ -43,7 +43,7 @@ * when a module simply needs to do some other processing during an add to * cart or fail silently. */ -function hook_add_to_cart($nid, $qty, $data) { +function hook_uc_add_to_cart($nid, $qty, $data) { if ($qty > 1) { $result[] = array( 'success' => FALSE, @@ -65,7 +65,7 @@ * @return * An array of data to be merged into the item added to the cart. */ -function hook_add_to_cart_data($form_values) { +function hook_uc_add_to_cart_data($form_values) { $node = node_load($form_values['nid']); return array('module' => 'uc_product', 'shippable' => $node->shippable); } @@ -110,7 +110,7 @@ * - #value: The quantity of $item in the cart. When "Update cart" is clicked, * the customer's input is saved to the cart. */ -function hook_cart_display($item) { +function hook_uc_cart_display($item) { $node = node_load($item->nid); $element = array(); $element['nid'] = array('#type' => 'value', '#value' => $node->nid); @@ -181,7 +181,7 @@ * No return value for load. * TRUE or FALSE for can_ship. */ -function hook_cart_item($op, &$item) { +function hook_uc_cart_item($op, &$item) { switch ($op) { case 'load': $term = array_shift(taxonomy_node_get_terms_by_vocabulary($item->nid, variable_get('uc_manufacturer_vid', 0))); @@ -224,7 +224,7 @@ * settings page, the body field is ignored. You may want your function to check * for a NULL argument before processing any queries or foreach() loops. */ -function hook_cart_pane($items) { +function hook_uc_cart_pane($items) { $panes[] = array( 'id' => 'cart_form', 'title' => t('Default cart form'), @@ -237,6 +237,38 @@ } /** + * Take action when checkout is completed. + * + * @param $order + * The resulting order object from the completed checkout. + * @param $account + * The customer that completed checkout, either the current user, or the + * account created for an anonymous customer. + */ +function hook_uc_checkout_complete($order, $account) { + // Get previous records of customer purchases. + $nids = array(); + $result = db_query("SELECT uid, nid, qty FROM {uc_customer_purchases} WHERE uid = %d", $account->uid); + while ($record = db_fetch_object($result)) { + $nids[$record->nid] = $record->qty; + } + + // Update records with new data. + $record = array('uid' => $account->uid); + foreach ($order->products as $product) { + $record['nid'] = $product->nid; + if (isset($nids[$product->nid])) { + $record['qty'] = $nids[$product->nid] + $product->qty; + db_write_record($record, 'uc_customer_purchases', array('uid', 'nid')); + } + else { + $record['qty'] = $product->qty; + db_write_record($record, 'uc_customer_purchases'); + } + } +} + +/** * Register callbacks for a checkout pane. * * The checkout screen for Ubercart is a compilation of enabled checkout panes. @@ -284,7 +316,7 @@ * - value: Optional. Whether or not this pane is displayed as a collapsible * fieldset. Defaults to TRUE. */ -function hook_checkout_pane() { +function hook_uc_checkout_pane() { $panes[] = array( 'id' => 'cart', 'callback' => 'uc_checkout_pane_cart', @@ -298,68 +330,6 @@ } /** - * Give clearance to a user to download a file. - * - * By default the uc_file module can implement 3 restrictions on downloads: by - * number of IP addresses downloaded from, by number of downloads, and by a set - * expiration date. Developers wishing to add further restrictions can do so by - * implementing this hook. After the 3 aforementioned restrictions are checked, - * the uc_file module will check for implementations of this hook. - * - * @param $user - * The drupal user object that has requested the download - * @param $file_download - * The file download object as defined as a row from the uc_file_users table - * that grants the user the download - * @return - * TRUE or FALSE depending on whether the user is to be permitted download of - * the requested files. When a implementation returns FALSE it should set an - * error message in Drupal using drupal_set_message() to inform customers of - * what is going on. - */ -function hook_download_authorize($user, $file_download) { - if (!$user->status) { - drupal_set_message(t("This account has been banned and can't download files anymore. "),'error'); - return FALSE; - } - else { - return TRUE; - } -} - -/** - * Take action when checkout is completed. - * - * @param $order - * The resulting order object from the completed checkout. - * @param $account - * The customer that completed checkout, either the current user, or the - * account created for an anonymous customer. - */ -function hook_uc_checkout_complete($order, $account) { - // Get previous records of customer purchases. - $nids = array(); - $result = db_query("SELECT uid, nid, qty FROM {uc_customer_purchases} WHERE uid = %d", $account->uid); - while ($record = db_fetch_object($result)) { - $nids[$record->nid] = $record->qty; - } - - // Update records with new data. - $record = array('uid' => $account->uid); - foreach ($order->products as $product) { - $record['nid'] = $product->nid; - if (isset($nids[$product->nid])) { - $record['qty'] = $nids[$product->nid] + $product->qty; - db_write_record($record, 'uc_customer_purchases', array('uid', 'nid')); - } - else { - $record['qty'] = $product->qty; - db_write_record($record, 'uc_customer_purchases'); - } - } -} - -/** * Handle requests to update a cart item. * * @param $nid @@ -372,7 +342,7 @@ * The cart id. Defaults to NULL, which indicates that the current user's cart * should be retrieved with uc_cart_get_id(). */ -function hook_update_cart_item($nid, $data = array(), $qty, $cid = NULL) { +function hook_uc_update_cart_item($nid, $data = array(), $qty, $cid = NULL) { if (!$nid) return NULL; $cid = !(is_null($cid) || empty($cid)) ? $cid : uc_cart_get_id(); if ($qty < 1) { === modified file 'uc_cart/uc_cart.module' --- uc_cart/uc_cart.module 2010-02-08 16:45:32 +0000 +++ uc_cart/uc_cart.module 2010-02-12 14:00:06 +0000 @@ -493,7 +493,7 @@ if ($product_count) { foreach (uc_cart_get_contents() as $item) { - $display_item = module_invoke($item->module, 'cart_display', $item); + $display_item = module_invoke($item->module, 'uc_cart_display', $item); if (!empty($display_item)) { $items[] = array( @@ -828,9 +828,9 @@ } /** - * Implementation of hook_cart_pane(). + * Implementation of hook_uc_cart_pane(). */ -function uc_cart_cart_pane($items) { +function uc_cart_uc_cart_pane($items) { $panes[] = array( 'id' => 'cart_form', 'title' => t('Default cart form'), @@ -843,9 +843,9 @@ } /** - * Implementation of hook_checkout_pane(). + * Implementation of hook_uc_checkout_pane(). */ -function uc_cart_checkout_pane() { +function uc_cart_uc_checkout_pane() { $panes[] = array( 'id' => 'cart', 'callback' => 'uc_checkout_pane_cart', @@ -976,7 +976,7 @@ ); $i = 0; foreach ($items as $item) { - $display_item = module_invoke($item->module, 'cart_display', $item); + $display_item = module_invoke($item->module, 'uc_cart_display', $item); if (!empty($display_item)) { $form['items'][$i] = $display_item; $form['items'][$i]['image']['#value'] = uc_product_get_picture($display_item['nid']['#value'], 'cart'); @@ -1338,7 +1338,7 @@ // Clear our the session variables used to force the cart workflow. unset($_SESSION['cart_order'], $_SESSION['do_complete'], $_SESSION['new_user']); - module_invoke_all('uc_checkout_complete', $order, $account); + module_invoke_all('uc_uc_checkout_complete', $order, $account); ca_pull_trigger('uc_checkout_complete', $order, $account); return array('#markup' => $themed_output); @@ -1405,8 +1405,8 @@ $item->model = $product->model; // Invoke hook_cart_item() with $op = 'load' in enabled modules. - foreach (module_implements('cart_item') as $module) { - $func = $module .'_cart_item'; + foreach (module_implements('uc_cart_item') as $module) { + $func = $module .'_uc_cart_item'; if (function_exists($func)) { // $item must be passed by reference. $func('load', $item); @@ -1474,8 +1474,8 @@ $item->model = $product->model; // Invoke hook_cart_item() with $op = 'load' in enabled modules. - foreach (module_implements('cart_item') as $module) { - $func = $module .'_cart_item'; + foreach (module_implements('uc_cart_item') as $module) { + $func = $module .'_uc_cart_item'; if (function_exists($func)) { // $item must be passed by reference. $func('load', $item); @@ -1526,7 +1526,7 @@ return; } - $result = module_invoke_all('add_to_cart', $nid, $qty, $data); + $result = module_invoke_all('uc_add_to_cart', $nid, $qty, $data); if (is_array($result) && !empty($result)) { foreach ($result as $row) { if ($row['success'] === FALSE) { @@ -1582,7 +1582,7 @@ drupal_set_message(t('Your item(s) have been updated.')); } $qty += $item->qty; - module_invoke($data['module'], 'update_cart_item', $node->nid, $data, min($qty, 999999), $cid); + module_invoke($data['module'], 'uc_update_cart_item', $node->nid, $data, min($qty, 999999), $cid); } // If specified, rebuild the cached cart items array. @@ -1619,8 +1619,8 @@ // Invoke hook_cart_item() with $op = 'remove' in enabled modules. $result = db_query("SELECT c.*, n.title, n.vid FROM {node} n INNER JOIN {uc_cart_products} c ON n.nid = c.nid WHERE c.cart_id = :cart_id AND c.nid = :nid", array(':cart_id' => $cart_id, ':nid' => $nid)); if ($item = $result->fetchObject()) { - foreach (module_implements('cart_item') as $module) { - $func = $module .'_cart_item'; + foreach (module_implements('uc_cart_item') as $module) { + $func = $module .'_uc_cart_item'; if (function_exists($func)) { // $item must be passed by reference. $func('remove', $item); @@ -1642,10 +1642,10 @@ if (is_object($cart)) { foreach ($cart->items as $item) { if ($item['remove']) { - module_invoke($item['module'], 'update_cart_item', $item['nid'], unserialize($item['data']), 0); + module_invoke($item['module'], 'uc_update_cart_item', $item['nid'], unserialize($item['data']), 0); } else { - module_invoke($item['module'], 'update_cart_item', $item['nid'], unserialize($item['data']), $item['qty']); + module_invoke($item['module'], 'uc_update_cart_item', $item['nid'], unserialize($item['data']), $item['qty']); } } @@ -1692,7 +1692,7 @@ return $panes; } - $panes = module_invoke_all('cart_pane', $items); + $panes = module_invoke_all('uc_cart_pane', $items); if (!is_array($panes) || count($panes) == 0) { return array(); } @@ -1748,8 +1748,8 @@ $result = array(); // See if any other modules have a say in the matter... - foreach (module_implements('cart_item') as $module) { - $func = $module .'_cart_item'; + foreach (module_implements('uc_cart_item') as $module) { + $func = $module .'_uc_cart_item'; if (function_exists($func)) { // $product must be passed by reference. $return = $func('can_ship', $product); === modified file 'uc_cart/uc_cart.pages.inc' --- uc_cart/uc_cart.pages.inc 2010-02-03 21:38:09 +0000 +++ uc_cart/uc_cart.pages.inc 2010-02-12 14:00:06 +0000 @@ -75,7 +75,7 @@ $subtotal = 0; if (is_array($items) && count($items) > 0) { foreach ($items as $item) { - $data = module_invoke($item->module, 'cart_display', $item); + $data = module_invoke($item->module, 'uc_cart_display', $item); if (!empty($data)) { $subtotal += $data['#total']; } @@ -509,8 +509,8 @@ $error = FALSE; // Invoke it on a per-module basis instead of all at once. - foreach (module_implements('order') as $module) { - $function = $module .'_order'; + foreach (module_implements('uc_order') as $module) { + $function = $module .'_uc_order'; if (function_exists($function)) { // $order must be passed by reference. $result = $function('submit', $order, NULL); === modified file 'uc_cart/uc_cart_checkout_pane.inc' --- uc_cart/uc_cart_checkout_pane.inc 2010-02-03 21:38:09 +0000 +++ uc_cart/uc_cart_checkout_pane.inc 2010-02-11 17:02:49 +0000 @@ -533,7 +533,7 @@ return $panes; } - $panes = module_invoke_all('checkout_pane', NULL); + $panes = module_invoke_all('uc_checkout_pane', NULL); foreach ($panes as $i => $value) { $panes[$i]['enabled'] = variable_get('uc_pane_'. $panes[$i]['id'] .'_enabled', (!isset($panes[$i]['enabled']) ? TRUE : $panes[$i]['enabled'])); $panes[$i]['weight'] = variable_get('uc_pane_'. $panes[$i]['id'] .'_weight', (!isset($panes[$i]['weight']) ? 0 : $panes[$i]['weight'])); === modified file 'uc_cart_links/uc_cart_links.module' --- uc_cart_links/uc_cart_links.module 2010-02-08 17:16:26 +0000 +++ uc_cart_links/uc_cart_links.module 2010-02-11 17:18:32 +0000 @@ -70,9 +70,9 @@ } /** - * Implementation of hook_add_to_cart(). + * Implementation of hook_uc_add_to_cart(). */ -function uc_cart_links_add_to_cart($nid, $qty, $data) { +function uc_cart_links_uc_add_to_cart($nid, $qty, $data) { if (user_access('administer cart links') && variable_get('uc_cart_links_add_show', FALSE)) { $cart_link = 'p'. $nid .'_q'. $qty; === modified file 'uc_cart_links/uc_cart_links.pages.inc' --- uc_cart_links/uc_cart_links.pages.inc 2010-02-05 20:39:09 +0000 +++ uc_cart_links/uc_cart_links.pages.inc 2010-02-11 17:02:49 +0000 @@ -84,7 +84,7 @@ ); } } - uc_cart_add_item($p['nid'], $p['qty'], $p['data'] + module_invoke_all('add_to_cart_data', $p), NULL, $msg, FALSE, FALSE); + uc_cart_add_item($p['nid'], $p['qty'], $p['data'] + module_invoke_all('uc_add_to_cart_data', $p), NULL, $msg, FALSE, FALSE); $rebuild_cart = TRUE; } break; === modified file 'uc_catalog/uc_catalog.module' --- uc_catalog/uc_catalog.module 2010-02-08 20:07:51 +0000 +++ uc_catalog/uc_catalog.module 2010-02-11 17:18:16 +0000 @@ -573,12 +573,12 @@ ******************************************************************************/ /** - * Implementation of hook_store_status(). + * Implementation of hook_uc_store_status(). * * Provide status information about the "Product Catalog" and products not * listed in the catalog. */ -function uc_catalog_store_status() { +function uc_catalog_uc_store_status() { $statuses = array(); $cat_id = variable_get('uc_catalog_vid', 0); $catalog = taxonomy_vocabulary_load($cat_id); @@ -617,12 +617,12 @@ } /** - * Implementation of hook_product_class(). + * Implementation of hook_uc_product_class(). * * Add and remove product node types to the catalog vocabulary as they are * created and deleted. */ -function uc_catalog_product_class($type, $op) { +function uc_catalog_uc_product_class($type, $op) { $vid = variable_get('uc_catalog_vid', 0); switch ($op) { case 'insert': === modified file 'uc_file/uc_file.api.php' --- uc_file/uc_file.api.php 2010-02-02 16:01:30 +0000 +++ uc_file/uc_file.api.php 2010-02-12 14:13:56 +0000 @@ -12,6 +12,36 @@ */ /** + * Give clearance to a user to download a file. + * + * By default the uc_file module can implement 3 restrictions on downloads: by + * number of IP addresses downloaded from, by number of downloads, and by a set + * expiration date. Developers wishing to add further restrictions can do so by + * implementing this hook. After the 3 aforementioned restrictions are checked, + * the uc_file module will check for implementations of this hook. + * + * @param $user + * The drupal user object that has requested the download + * @param $file_download + * The file download object as defined as a row from the uc_file_users table + * that grants the user the download + * @return + * TRUE or FALSE depending on whether the user is to be permitted download of + * the requested files. When a implementation returns FALSE it should set an + * error message in Drupal using drupal_set_message() to inform customers of + * what is going on. + */ +function hook_uc_download_authorize($user, $file_download) { + if (!$user->status) { + drupal_set_message(t("This account has been banned and can't download files anymore. "),'error'); + return FALSE; + } + else { + return TRUE; + } +} + +/** * Perform actions on file products. * * The uc_file module comes with a file manager (found at Administer » Store @@ -86,7 +116,7 @@ * - 'validate': None * - 'submit': None */ -function hook_file_action($op, $args) { +function hook_uc_file_action($op, $args) { switch ($op) { case 'info': return array('uc_image_watermark_add_mark' => 'Add Watermark'); @@ -156,7 +186,7 @@ * @return * The path of the new file to transfer to customer. */ -function hook_file_transfer_alter($file_user, $ip, $fid, $file) { +function hook_uc_file_transfer_alter($file_user, $ip, $fid, $file) { $file_data = file_get_contents($file)." [insert personalized data]"; //for large files this might be too memory intensive $new_file = tempnam(file_directory_temp(),'tmp'); file_put_contents($new_file,$file_data); === modified file 'uc_file/uc_file.module' --- uc_file/uc_file.module 2010-02-08 21:59:21 +0000 +++ uc_file/uc_file.module 2010-02-11 17:17:01 +0000 @@ -551,12 +551,12 @@ ******************************************************************************/ /** - * Implementation of hook_add_to_cart(). + * Implementation of hook_uc_add_to_cart(). * * If specified in the administration interface, notify a customer when * downloading a duplicate file. Calculate and show the new limits. */ -function uc_file_add_to_cart($nid, $qty, $data) { +function uc_file_uc_add_to_cart($nid, $qty, $data) { // Only warn if it's set in the product admin interface. if (!variable_get('uc_file_duplicate_warning', TRUE)) { @@ -605,9 +605,9 @@ } /** - * Implementation of hook_cart_item(). + * Implementation of hook_uc_cart_item(). */ -function uc_file_cart_item($op, &$item) { +function uc_file_uc_cart_item($op, &$item) { switch ($op) { @@ -635,9 +635,9 @@ } /** - * Implementation of hook_product_feature(). + * Implementation of hook_uc_product_feature(). */ -function uc_file_product_feature() { +function uc_file_uc_product_feature() { $features[] = array( 'id' => 'file', 'title' => t('File download'), @@ -650,9 +650,9 @@ } /** - * Implementation of hook_store_status(). + * Implementation of hook_uc_store_status(). */ -function uc_file_store_status() { +function uc_file_uc_store_status() { $message = array(); if (!is_dir(variable_get('uc_file_base_dir', NULL))) { $message[] = array( @@ -1338,7 +1338,7 @@ if (!is_null($fid)) { $file_object = uc_file_get_by_id($fid); - module_invoke_all('file_action', 'insert', array('file_object' => $file_object)); + module_invoke_all('uc_file_action', 'insert', array('file_object' => $file_object)); unset($fid); } } === modified file 'uc_file/uc_file.pages.inc' --- uc_file/uc_file.pages.inc 2010-02-08 20:07:51 +0000 +++ uc_file/uc_file.pages.inc 2010-02-12 14:13:32 +0000 @@ -207,7 +207,7 @@ * Perform first-pass authorization. Call authorization hooks afterwards. * * Called when a user requests a file download, function checks download - * limits then checks for any implementation of hook_download_authorize. + * limits then checks for any implementation of hook_uc_download_authorize. * Passing that, the function _uc_file_download_transfer is called. * * @param $fid @@ -259,9 +259,9 @@ return UC_FILE_ERROR_EXPIRED; } - //Check any if any hook_download_authorize calls deny the download - foreach (module_implements('download_authorize') as $module) { - $name = $module .'_download_authorize'; + //Check any if any hook_uc_download_authorize calls deny the download + foreach (module_implements('uc_download_authorize') as $module) { + $name = $module .'_uc_download_authorize'; $result = $name($user, $file_download); if (!$result) { return UC_FILE_ERROR_HOOK_ERROR; === modified file 'uc_order/uc_order.admin.inc' --- uc_order/uc_order.admin.inc 2010-02-03 21:38:09 +0000 +++ uc_order/uc_order.admin.inc 2010-02-12 14:10:19 +0000 @@ -1440,10 +1440,10 @@ $product = node_load(intval($_POST['nid'])); $product->qty = intval($_POST['qty']); $product->price = $product->sell_price; - $product->data = module_invoke_all('add_to_cart_data', $form_state['values']); + $product->data = module_invoke_all('uc_add_to_cart_data', $form_state['values']); - foreach (module_implements('cart_item') as $module) { - $function = $module .'_cart_item'; + foreach (module_implements('uc_cart_item') as $module) { + $function = $module .'_uc_cart_item'; if (function_exists($function)) { // $product must be passed by reference. $function('load', $product); @@ -1465,7 +1465,7 @@ ); $product->price = uc_price($price_info, $context); - drupal_alter('order_product', $product, $order); + drupal_alter('uc_order_product', $product, $order); uc_order_product_save($order->order_id, $product); if (variable_get('uc_order_logging', TRUE)) { === modified file 'uc_order/uc_order.api.php' --- uc_order/uc_order.api.php 2010-02-02 16:01:30 +0000 +++ uc_order/uc_order.api.php 2010-02-12 14:00:06 +0000 @@ -66,7 +66,7 @@ * simply show the total of the order at the bottom of the list of line * items.) */ -function hook_line_item() { +function hook_uc_line_item() { $items[] = array( 'id' => 'generic', 'title' => t('Empty Line'), @@ -89,7 +89,7 @@ * @param $order * The order object containing the line item. */ -function hook_line_item_alter(&$item, $order) { +function hook_uc_line_item_alter(&$item, $order) { $account = user_load($order->uid); ca_pull_trigger('calculate_line_item_discounts', $item, $account); } @@ -100,7 +100,7 @@ * @param &$items * The combined return value of hook_line_item(). */ -function hook_line_item_data_alter(&$items) { +function hook_uc_line_item_data_alter(&$items) { foreach ($items as &$item) { // Tax amounts are added in to other line items, so the actual tax line // items should not be added to the order total. @@ -173,7 +173,7 @@ * Expects in return a value (positive or negative) by which to modify the * order total. */ -function hook_order($op, &$arg1, $arg2) { +function hook_uc_order($op, &$arg1, $arg2) { switch ($op) { case 'save': // Do something to save payment info! @@ -193,7 +193,7 @@ * - "icon": HTML of an image. * - "title": Title attribute text (mouseover tool-tip). */ -function hook_order_actions($order) { +function hook_uc_order_actions($order) { $actions = array(); $module_path = base_path() . drupal_get_path('module', 'uc_shipping'); if (user_access('fulfill orders')) { @@ -241,7 +241,7 @@ * this API page, so you'll have to click here to read more about what a callback * function should contain. */ -function hook_order_pane() { +function hook_uc_order_pane() { $panes[] = array( 'id' => 'payment', 'callback' => 'uc_order_pane_payment', @@ -265,7 +265,7 @@ * Nothing should be returned. Hook implementations should receive the * $product object by reference and alter it directly. */ -function hook_order_product_alter(&$product, $order) { +function hook_uc_order_product_alter(&$product, $order) { drupal_set_message('hook_order_product_alter(&$product, $order):'); drupal_set_message('&$product:
'. print_r($product, TRUE) .'
'); drupal_set_message('$order:
'. print_r($order, TRUE) .'
'); @@ -286,7 +286,7 @@ * - weight: The list position of the state. * - scope: Either "specific" or "general". */ -function hook_order_state() { +function hook_uc_order_state() { $states[] = array( 'id' => 'canceled', 'title' => t('Canceled'), === modified file 'uc_order/uc_order.line_item.inc' --- uc_order/uc_order.line_item.inc 2010-02-08 21:59:21 +0000 +++ uc_order/uc_order.line_item.inc 2010-02-12 14:10:19 +0000 @@ -180,13 +180,13 @@ return $items; } - $items = module_invoke_all('line_item', NULL); + $items = module_invoke_all('uc_line_item', NULL); foreach ($items as $i => $value) { $items[$i]['enabled'] = variable_get('uc_li_'. $items[$i]['id'] .'_enabled', (!isset($items[$i]['enabled']) ? TRUE : $items[$i]['enabled'])); $items[$i]['weight'] = variable_get('uc_li_'. $items[$i]['id'] .'_weight', (!isset($items[$i]['weight']) ? 1 : $items[$i]['weight'])); } - drupal_alter('line_item_data', $items); + drupal_alter('uc_line_item_data', $items); usort($items, 'uc_weight_sort'); === modified file 'uc_order/uc_order.module' --- uc_order/uc_order.module 2010-02-08 17:16:26 +0000 +++ uc_order/uc_order.module 2010-02-12 14:10:19 +0000 @@ -577,9 +577,9 @@ ******************************************************************************/ /** - * Implementation of hook_order_pane(). + * Implementation of hook_uc_order_pane(). */ -function uc_order_order_pane() { +function uc_order_uc_order_pane() { $panes[] = array( 'id' => 'ship_to', 'callback' => 'uc_order_pane_ship_to', @@ -657,9 +657,9 @@ } /** - * Implementation of hook_order_state(). + * Implementation of hook_uc_order_state(). */ -function uc_order_order_state() { +function uc_order_uc_order_state() { $states[] = array( 'id' => 'canceled', 'title' => t('Canceled'), @@ -689,9 +689,9 @@ } /** - * Implementation of hook_line_item(). + * Implementation of hook_uc_line_item(). */ -function uc_order_line_item() { +function uc_order_uc_line_item() { $items[] = array( 'id' => 'subtotal', 'title' => t('Subtotal'), @@ -1093,7 +1093,7 @@ if (is_array($order->products)) { foreach ($order->products as $product) { - drupal_alter('order_product', $product, $order); + drupal_alter('uc_order_product', $product, $order); uc_order_product_save($order->order_id, $product); } } @@ -1334,7 +1334,7 @@ } } foreach ($items as &$item) { - drupal_alter('line_item', $item, $order); + drupal_alter('uc_line_item', $item, $order); } usort($items, 'uc_weight_sort'); @@ -1363,8 +1363,8 @@ // Attempt the update if the order exists. if ($order !== FALSE) { // Return false if any module says the update is not good to go. - foreach (module_implements('order') as $module) { - $function = $module .'_order'; + foreach (module_implements('uc_order') as $module) { + $function = $module .'_uc_order'; // $order must be passed by reference. if (function_exists($function) && ($return = $function('can_update', $order, $status))){ for ($i = 0; $i < count($return); $i++) { @@ -1477,8 +1477,8 @@ * be passed by reference. */ function uc_order_module_invoke($op, &$order, $edit) { - foreach (module_implements('order') as $module) { - $function = $module .'_order'; + foreach (module_implements('uc_order') as $module) { + $function = $module .'_uc_order'; if (function_exists($function)) { $function($op, $order, $edit); } @@ -1538,8 +1538,8 @@ $total += uc_line_items_calculate($order); - foreach (module_implements('order') as $module) { - $function = $module .'_order'; + foreach (module_implements('uc_order') as $module) { + $function = $module .'_uc_order'; // $order must be passed by reference. Since hook_order() may be // unknowingly implemented (see date_order() in date_api.module), we verify // the results are numeric before continuing. @@ -1582,8 +1582,8 @@ } // See if any other modules have a say in the matter... - foreach (module_implements('cart_item') as $module) { - $function = $module .'_cart_item'; + foreach (module_implements('uc_cart_item') as $module) { + $function = $module .'_uc_cart_item'; if (function_exists($function) && $function('can_ship', $product)) { // $product must be passed by reference. $result[] = TRUE; @@ -1734,7 +1734,7 @@ * ids for use in a SQL query. */ function uc_order_state_list($scope = 'all', $sql = FALSE) { - $states = module_invoke_all('order_state'); + $states = module_invoke_all('uc_order_state'); foreach ($states as $i => $value) { if ($scope != 'all' && $states[$i]['scope'] != $scope) { unset($states[$i]); @@ -1921,8 +1921,8 @@ } else { // See if any modules have a say in this order's eligibility for deletion - foreach (module_implements('order') as $module) { - $function = $module .'_order'; + foreach (module_implements('uc_order') as $module) { + $function = $module .'_uc_order'; // $order must be passed by reference. if (function_exists($function) && ($response = $function('can_delete', $order, NULL))) { // Break out early if possible. @@ -1945,7 +1945,7 @@ } } - $extra = module_invoke_all('order_actions', $order); + $extra = module_invoke_all('uc_order_actions', $order); if (count($extra)) { $actions = array_merge($actions, $extra); } === modified file 'uc_order/uc_order.order_pane.inc' --- uc_order/uc_order.order_pane.inc 2010-02-03 20:43:21 +0000 +++ uc_order/uc_order.order_pane.inc 2010-02-11 17:02:49 +0000 @@ -1061,7 +1061,7 @@ return $panes; } - $panes = module_invoke_all('order_pane', NULL); + $panes = module_invoke_all('uc_order_pane', NULL); foreach ($panes as $i => $value) { $panes[$i]['enabled'] = variable_get('uc_order_pane_'. $panes[$i]['id'] .'_enabled', (!isset($panes[$i]['enabled']) ? TRUE : $panes[$i]['enabled'])); $panes[$i]['weight'] = variable_get('uc_order_pane_'. $panes[$i]['id'] .'_weight_'. $view, (!isset($panes[$i]['weight']) ? 0 : $panes[$i]['weight'])); === modified file 'uc_product/uc_product.admin.inc' --- uc_product/uc_product.admin.inc 2010-02-03 21:38:09 +0000 +++ uc_product/uc_product.admin.inc 2010-02-11 17:02:49 +0000 @@ -346,7 +346,7 @@ */ function uc_product_feature_settings_form() { $titles = array(); - $features = module_invoke_all('product_feature'); + $features = module_invoke_all('uc_product_feature'); foreach ($features as $feature) { $titles[] = $feature['title']; } @@ -510,7 +510,7 @@ * uc_product_feature_add_form_submit() */ function uc_product_feature_add_form() { - foreach (module_invoke_all('product_feature') as $feature) { + foreach (module_invoke_all('uc_product_feature') as $feature) { $options[$feature['id']] = $feature['title']; } ksort($options); @@ -658,10 +658,10 @@ variable_set('comment_'. $pcid, variable_get('comment_product', COMMENT_NODE_READ_WRITE)); } - module_invoke_all('product_class', $pcid, 'insert'); + module_invoke_all('uc_product_class', $pcid, 'insert'); } else { - module_invoke_all('product_class', $pcid, 'update'); + module_invoke_all('uc_product_class', $pcid, 'update'); } node_types_rebuild(); @@ -711,7 +711,7 @@ db_delete('uc_product_classes') ->condition('pcid', $form_state['values']['pcid']) ->execute(); - module_invoke_all('product_class', $form_state['values']['pcid'], 'delete'); + module_invoke_all('uc_product_class', $form_state['values']['pcid'], 'delete'); uc_product_node_info(TRUE); node_types_rebuild(); menu_rebuild(); === modified file 'uc_product/uc_product.api.php' --- uc_product/uc_product.api.php 2010-02-02 16:01:30 +0000 +++ uc_product/uc_product.api.php 2010-02-12 14:14:37 +0000 @@ -25,7 +25,7 @@ * additional information to the node type because it is a product type * should delete this information. */ -function hook_product_class($type, $op) { +function hook_uc_product_class($type, $op) { switch ($op) { case 'delete': db_query("DELETE FROM {uc_class_attributes} WHERE pcid = '%s'", $type); @@ -48,7 +48,7 @@ * @return * A structured array that can be fed into drupal_render(). */ -function hook_product_description($product) { +function hook_uc_product_description($product) { $description = array( 'attributes' => array( '#product' => array( @@ -98,26 +98,11 @@ * @param $product * The product being described. */ -function hook_product_description_alter(&$description, $product) { +function hook_uc_product_description_alter(&$description, $product) { $description['attributes']['#weight'] = 2; } /** - * List node types which should be considered products. - * - * Trusts the duck philosophy of object identification: if it walks like a duck, - * quacks like a duck, and has feathers like a duck, it's probably a duck. - * Products are nodes with prices, SKUs, and everything else Übercart expects - * them to have. - * - * @return - * Array of node type ids. - */ -function hook_product_types() { - return array('product_kit'); -} - -/** * Notify core of any SKUs your module adds to a given node. * * NOTE: DO NOT map the array keys, as the possibility for numeric SKUs exists, and @@ -141,6 +126,21 @@ } /** + * List node types which should be considered products. + * + * Trusts the duck philosophy of object identification: if it walks like a duck, + * quacks like a duck, and has feathers like a duck, it's probably a duck. + * Products are nodes with prices, SKUs, and everything else Übercart expects + * them to have. + * + * @return + * Array of node type ids. + */ +function hook_uc_product_types() { + return array('product_kit'); +} + +/** * @} End of "addtogroup hooks". */ === modified file 'uc_product/uc_product.module' --- uc_product/uc_product.module 2010-02-08 17:16:26 +0000 +++ uc_product/uc_product.module 2010-02-12 14:10:19 +0000 @@ -102,7 +102,7 @@ 'type' => MENU_DEFAULT_LOCAL_TASK, 'file' => 'uc_product.admin.inc', ); - $features = module_invoke_all('product_feature'); + $features = module_invoke_all('uc_product_feature'); if (!empty($features)) { $items['node/%node/edit/features'] = array( 'title' => 'Features', @@ -1075,9 +1075,9 @@ ******************************************************************************/ /** - * Implementation of hook_product_types(). + * Implementation of hook_uc_product_types(). */ -function uc_product_product_types() { +function uc_product_uc_product_types() { return array_keys(uc_product_node_info()); } @@ -1086,7 +1086,7 @@ * * @see uc_product_image_defaults() */ -function uc_product_store_status() { +function uc_product_uc_store_status() { if (!module_exists('imagefield') || !module_exists('imagecache')) { $status = 'warning'; $description = t('To automatically configure core image support, enable the Content, CCK Image field, and Imagecache modules.', array('!url' => url('admin/build/modules'))); @@ -1155,9 +1155,9 @@ } /** - * Implementation of hook_cart_display(). + * Implementation of hook_uc_cart_display(). */ -function uc_product_cart_display($item) { +function uc_product_uc_cart_display($item) { $node = node_load($item->nid); $element = array(); $element['nid'] = array('#type' => 'value', '#value' => $node->nid); @@ -1198,9 +1198,9 @@ } /** - * Implementation of hook_update_cart_item(). + * Implementation of hook_uc_update_cart_item(). */ -function uc_product_update_cart_item($nid, $data = array(), $qty, $cid = NULL) { +function uc_product_uc_update_cart_item($nid, $data = array(), $qty, $cid = NULL) { if (!$nid) return NULL; $cid = !(is_null($cid) || empty($cid)) ? $cid : uc_cart_get_id(); if ($qty < 1) { @@ -1220,17 +1220,17 @@ } /** - * Implementation of hook_add_to_cart_data(). + * Implementation of hook_uc_add_to_cart_data(). */ -function uc_product_add_to_cart_data($form_values) { +function uc_product_uc_add_to_cart_data($form_values) { $node = node_load($form_values['nid']); return array('shippable' => $node->shippable); } /** - * Implmentation of hook_product_class(). + * Implmentation of hook_uc_product_class(). */ -function uc_product_product_class($pcid, $op) { +function uc_product_uc_product_class($pcid, $op) { switch ($op) { case 'insert': db_update('node_type') @@ -1434,7 +1434,7 @@ * @see uc_catalog_buy_it_now_form() */ function uc_catalog_buy_it_now_form_submit($form, &$form_state) { - $form_state['redirect'] = uc_cart_add_item($form_state['values']['nid'], 1, module_invoke_all('add_to_cart_data', $form_state['values']), NULL, variable_get('uc_cart_add_item_msg', TRUE)); + $form_state['redirect'] = uc_cart_add_item($form_state['values']['nid'], 1, module_invoke_all('uc_add_to_cart_data', $form_state['values']), NULL, variable_get('uc_cart_add_item_msg', TRUE)); } /** @@ -1544,7 +1544,7 @@ * @see uc_product_add_to_cart_form() */ function uc_product_add_to_cart_form_submit($form, &$form_state) { - $form_state['redirect'] = uc_cart_add_item($form_state['values']['nid'], $form_state['values']['qty'], module_invoke_all('add_to_cart_data', $form_state['values']), NULL, variable_get('uc_cart_add_item_msg', TRUE)); + $form_state['redirect'] = uc_cart_add_item($form_state['values']['nid'], $form_state['values']['qty'], module_invoke_all('uc_add_to_cart_data', $form_state['values']), NULL, variable_get('uc_cart_add_item_msg', TRUE)); } /** @@ -1666,7 +1666,7 @@ * Return an array of product node types. */ function uc_product_types() { - return module_invoke_all('product_types'); + return module_invoke_all('uc_product_types'); } /** @@ -1886,10 +1886,10 @@ */ function uc_product_get_description($product) { // Run through implementations of hook_product_description() - $description = module_invoke_all('product_description', $product); + $description = module_invoke_all('uc_product_description', $product); // Now allow alterations via hook_product_description_alter() - drupal_alter('product_description', $description, $product); + drupal_alter('uc_product_description', $description, $product); return drupal_render($description); } @@ -1924,7 +1924,7 @@ static $features; if (empty($features)) { - foreach (module_invoke_all('product_feature') as $feature) { + foreach (module_invoke_all('uc_product_feature') as $feature) { $features[$feature['id']] = $feature; } } === modified file 'uc_product_kit/uc_product_kit.module' --- uc_product_kit/uc_product_kit.module 2010-02-08 17:16:26 +0000 +++ uc_product_kit/uc_product_kit.module 2010-02-12 14:10:19 +0000 @@ -905,16 +905,16 @@ ******************************************************************************/ /** - * Implementation of hook_product_types(). + * Implementation of hook_uc_product_types(). */ -function uc_product_kit_product_types() { +function uc_product_kit_uc_product_types() { return array('product_kit'); } /** - * Implementation of hook_store_status(). + * Implementation of hook_uc_store_status(). */ -function uc_product_kit_store_status() { +function uc_product_kit_uc_store_status() { if (module_exists('filefield')) { module_load_include('inc', 'content', 'includes/content.crud'); // Check for filefields on products. @@ -933,9 +933,9 @@ } /** - * Implementation of hook_add_to_cart(). + * Implementation of hook_uc_add_to_cart(). */ -function uc_product_kit_add_to_cart($nid, $qty, $kit_data) { +function uc_product_kit_uc_add_to_cart($nid, $qty, $kit_data) { $node = node_load($nid); if ($node->type == 'product_kit') { $cart = uc_cart_get_contents(); @@ -944,7 +944,7 @@ $product_data = array(); foreach ($node->products as $product) { - $data = array('kit_id' => $node->nid, 'module' => 'uc_product_kit') + module_invoke_all('add_to_cart_data', $kit_data['products'][$product->nid]); + $data = array('kit_id' => $node->nid, 'module' => 'uc_product_kit') + module_invoke_all('uc_add_to_cart_data', $kit_data['products'][$product->nid]); $product_data[$product->nid] = $data; foreach ($cart as $item) { if ($item->nid == $product->nid && isset($item->data['kit_id']) && $item->data['kit_id'] == $node->nid) { @@ -988,9 +988,9 @@ } /** - * Implementation of hook_cart_item(). + * Implementation of hook_uc_cart_item(). */ -function uc_product_kit_cart_item($op, &$item) { +function uc_product_kit_uc_cart_item($op, &$item) { switch ($op) { case 'load': if (isset($item->data['kit_id']) && ($kit = node_load($item->data['kit_id'])) && $kit->mutable != UC_PRODUCT_KIT_MUTABLE) { @@ -1004,7 +1004,7 @@ } /** - * Implementation of hook_order_product_alter(). + * Implementation of hook_uc_order_product_alter(). * * The hookups for making product kits work on the order edit admin screen. * @@ -1013,7 +1013,7 @@ * @param $order * The order being edited. */ -function uc_product_kit_order_product_alter(&$product, $order) { +function uc_product_kit_uc_order_product_alter(&$product, $order) { if ($product->type !== 'product_kit') { return; } @@ -1025,12 +1025,12 @@ // Load all the attributes/discounts/etc as if we were adding it to the // cart. - $kit_product->data = module_invoke_all('add_to_cart_data', $_POST['sub_products'][$kit_product->nid]); + $kit_product->data = module_invoke_all('uc_add_to_cart_data', $_POST['sub_products'][$kit_product->nid]); $kit_product->data['kit_id'] = $product->nid; // Run the product through the alter mill. - foreach (module_implements('cart_item') as $module) { - $function = $module .'_cart_item'; + foreach (module_implements('uc_cart_item') as $module) { + $function = $module .'_uc_cart_item'; if (function_exists($function)) { // $product must be passed by reference. $function('load', $kit_product); @@ -1052,7 +1052,7 @@ ); $kit_product->price = uc_price($price_info, $context); - drupal_alter('order_product', $kit_product, $order); + drupal_alter('uc_order_product', $kit_product, $order); // Save the individual item to the order. uc_order_product_save($order->order_id, $kit_product); @@ -1062,7 +1062,7 @@ $product->skip_save = TRUE; } /** - * Implementation of hook_cart_display(). + * Implementation of hook_uc_cart_display(). * * Displays either the kit as a whole, or each individual product based on the * store configuration. Each product in the cart that was added by uc_product_kit @@ -1075,7 +1075,7 @@ * @return * A form element array to be processed by uc_cart_view_form(). */ -function uc_product_kit_cart_display($item) { +function uc_product_kit_uc_cart_display($item) { static $elements = array(); static $products; $unique_id = $item->data['unique_id']; @@ -1161,11 +1161,11 @@ } /** - * Implementation of hook_update_cart_item(). + * Implementation of hook_uc_update_cart_item(). * * Handles individual products or entire kits. */ -function uc_product_kit_update_cart_item($nid, $data = array(), $qty, $cid = NULL) { +function uc_product_kit_uc_update_cart_item($nid, $data = array(), $qty, $cid = NULL) { if (!$nid) return NULL; $cid = !(is_null($cid) || empty($cid)) ? $cid : uc_cart_get_id(); if ($qty < 1) { === modified file 'uc_roles/uc_roles.module' --- uc_roles/uc_roles.module 2010-02-08 20:07:51 +0000 +++ uc_roles/uc_roles.module 2010-02-11 17:08:40 +0000 @@ -509,7 +509,7 @@ /** * Implementation of hook_cart_item(). */ -function uc_roles_cart_item($op, &$item) { +function uc_roles_uc_cart_item($op, &$item) { switch ($op) { case 'can_ship': $roles = db_query("SELECT * FROM {uc_roles_products} WHERE nid = :nid", array(':nid' => $item->nid)); @@ -534,9 +534,9 @@ } /** - * Implementation of hook_product_feature(). + * Implementation of hook_uc_product_feature(). */ -function uc_roles_product_feature() { +function uc_roles_uc_product_feature() { $features[] = array( 'id' => 'role', 'title' => t('Role assignment'), @@ -549,9 +549,9 @@ } /** - * Implementation of hook_store_status(). + * Implementation of hook_uc_store_status(). */ -function uc_roles_store_status() { +function uc_roles_uc_store_status() { $message = array(); $role_choices = _uc_roles_get_choices(); if (empty($role_choices)) { === modified file 'uc_store/uc_store.admin.inc' --- uc_store/uc_store.admin.inc 2010-02-03 21:38:09 +0000 +++ uc_store/uc_store.admin.inc 2010-02-11 17:02:49 +0000 @@ -27,7 +27,7 @@ ); } - $results = module_invoke_all('store_status'); + $results = module_invoke_all('uc_store_status'); foreach ($results as $message) { switch ($message['status']) { === modified file 'uc_store/uc_store.api.php' --- uc_store/uc_store.api.php 2010-02-02 16:01:30 +0000 +++ uc_store/uc_store.api.php 2010-02-12 14:15:09 +0000 @@ -12,38 +12,6 @@ */ /** - * Add status messages to the "Store administration" page. - * - * This hook is used to add items to the store status table on the main store - * administration screen. Each item gets a row in the table that consists of a - * status icon, title, and description. These items should be used to give - * special instructions, notifications, or indicators for components of the cart - * enabled by the modules. At a glance, a store owner should be able to look here - * and see if a critical component of your module is not functioning properly. - * - * For example, if the catalog module is installed and it cannot find the catalog - * taxonomy vocabulary, it will show an error message here to alert the store - * administrator. - * - * @return - * An array of tore status items which are arrays with the following keys: - * - "status": "ok", "warning", or "error" depending on the message. - * - "title" The title of the status message or module that defines it. - * - "desc": The description; can be any message, including links to pages and - * forms that deal with the issue being reported. - */ -function hook_store_status() { - if ($key = uc_credit_encryption_key()) { - $statuses[] = array( - 'status' => 'ok', - 'title' => t('Credit card encryption'), - 'desc' => t('Credit card data in the database is currently being encrypted.'), - ); - } - return $statuses; -} - -/** * Allow modules to alter the TAPIr table after the rows are populated. * * The example below adds a value for the custom 'designer' column to the table @@ -203,6 +171,38 @@ } /** + * Add status messages to the "Store administration" page. + * + * This hook is used to add items to the store status table on the main store + * administration screen. Each item gets a row in the table that consists of a + * status icon, title, and description. These items should be used to give + * special instructions, notifications, or indicators for components of the cart + * enabled by the modules. At a glance, a store owner should be able to look here + * and see if a critical component of your module is not functioning properly. + * + * For example, if the catalog module is installed and it cannot find the catalog + * taxonomy vocabulary, it will show an error message here to alert the store + * administrator. + * + * @return + * An array of tore status items which are arrays with the following keys: + * - "status": "ok", "warning", or "error" depending on the message. + * - "title" The title of the status message or module that defines it. + * - "desc": The description; can be any message, including links to pages and + * forms that deal with the issue being reported. + */ +function hook_uc_store_status() { + if ($key = uc_credit_encryption_key()) { + $statuses[] = array( + 'status' => 'ok', + 'title' => t('Credit card encryption'), + 'desc' => t('Credit card data in the database is currently being encrypted.'), + ); + } + return $statuses; +} + +/** * @} End of "addtogroup hooks". */ === modified file 'uc_taxes/uc_taxes.api.php' --- uc_taxes/uc_taxes.api.php 2010-02-02 16:01:30 +0000 +++ uc_taxes/uc_taxes.api.php 2010-02-11 17:04:13 +0000 @@ -19,7 +19,7 @@ * @return * An array of tax line item objects keyed by a module-specific id. */ -function hook_calculate_tax($order) { +function hook_uc_calculate_tax($order) { global $user; if (is_numeric($order)) { $order = uc_order_load($order); === modified file 'uc_taxes/uc_taxes.module' --- uc_taxes/uc_taxes.module 2010-02-08 21:59:21 +0000 +++ uc_taxes/uc_taxes.module 2010-02-12 14:00:06 +0000 @@ -131,9 +131,9 @@ ******************************************************************************/ /** - * Implementation of hook_line_item(). + * Implementation of hook_uc_line_item(). */ -function uc_taxes_line_item() { +function uc_taxes_uc_line_item() { $items[] = array( 'id' => 'tax', 'title' => t('Tax'), @@ -157,11 +157,11 @@ } /** - * Implementation of hook_order(). + * Implementation of hook_uc_order(). * * Update and save tax line items to the order. */ -function uc_taxes_order($op, $arg1, $arg2) { +function uc_taxes_uc_order($op, $arg1, $arg2) { switch ($op) { case 'save': $changes = array(); @@ -377,7 +377,7 @@ */ function uc_taxes_calculate($order) { // Find any taxes specified by enabled modules. - $taxes = module_invoke_all('calculate_tax', $order); + $taxes = module_invoke_all('uc_calculate_tax', $order); return $taxes; } @@ -385,7 +385,7 @@ /** * Calculate the amount and types of taxes that apply to an order. */ -function uc_taxes_calculate_tax($order) { +function uc_taxes_uc_calculate_tax($order) { global $user; if (is_numeric($order)) { $order = uc_order_load($order); @@ -469,7 +469,7 @@ function uc_taxes_javascript() { $order = $_POST['order']; if ($order = unserialize(rawurldecode($order))) { - $taxes = module_invoke_all('calculate_tax', $order); + $taxes = module_invoke_all('uc_calculate_tax', $order); $callback = _line_item_data('tax_subtotal', 'callback'); if (function_exists($callback)) { $subtotal = $callback('load', $order);