- <?php
-
- * Implementation of hook_nap_handler().
- */
- function ec_nap_nap_handler() {
- return array(
-
- 'name' => 'Node Access Product for e-Commerce',
-
- 'integration' => 'e-Commerce',
-
- 'recurring module' => 'ec_recurring',
-
- 'settings path' => 'admin/ecsettings',
-
- 'reports path' => 'admin/store',
- );
- }
-
- * Implementation of hook_enable().
- */
- function ec_nap_enable() {
- drupal_load('module', 'nap');
- nap_notify('enable', 'ec_nap');
- }
-
- * Implementation of hook_disable().
- */
- function ec_nap_disable() {
- drupal_load('module', 'nap');
- nap_notify('disable', 'ec_nap');
- }
-
- * Implementation of hook_ec_txn_workflow().
- */
- function ec_nap_ec_txn_workflow($txn, $orig) {
- if (ec_store_transaction_workflow('type_code', $txn->workflow) == EC_WORKFLOW_TYPE_COMPLETE) {
-
- foreach ($txn->items as $i => &$node) {
-
- if ($node->schedule['expiry']) {
-
- $node->nap_recurring_date = strftime('%Y-%m-%d %H:%M:%S', $node->schedule['expiry']);
- }
- else {
-
- $node->nap_recurring_date = 0;
- }
- }
- $customer = $txn->customer;
- nap_save_purchase($txn->txnid, $customer->uid, $txn->items);
- }
- }
-
- * Implementation of hook_nap_form_is_product().
- */
- function ec_nap_nap_form_is_product($form, $form_state, $form_id) {
- return ec_product_form_is_product($form_id, $form);
- }
-