You are here

commerce_recurring.module in Commerce Recurring Framework 7

Same filename and directory in other branches
  1. 8 commerce_recurring.module
  2. 7.2 commerce_recurring.module

commerce_recurring.module Provides recurring framework for Drupal Commerce

File

commerce_recurring.module
View source
<?php

/**
 * @file commerce_recurring.module
 * Provides recurring framework for Drupal Commerce
 */

/**
 * Implements hook_menu().
*/
function commerce_recurring_menu() {
  $items = array();
  $items['admin/commerce/config/recurring'] = array(
    'title' => 'Recurring Orders',
    'file' => 'commerce_recurring.admin.inc',
    'description' => 'Configure recurring order settings',
    'access arguments' => array(
      'administer commerce recurring',
    ),
    'type' => MENU_NORMAL_ITEM,
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'commerce_recurring_admin_form',
    ),
  );
  return $items;
}

/**
 * Implements hook_permission()
*/
function commerce_recurring_permission() {
  return array(
    'administer commerce recurring' => array(
      'title' => t('Administer Commerce Recurring'),
    ),
  );
}

/**
 * Implements hook_help().
 */
function commerce_recurring_help($path, $arg) {
  switch ($path) {
    case 'admin/help#commerce_recurring':
      return t("Provides recurring payment options for Drupal Commerce");
  }
}

/**
 * Implements hook_views_api().
 */
function commerce_recurring_views_api() {
  return array(
    'api' => 3,
    'path' => drupal_get_path('module', 'commerce_recurring') . '/includes/views',
  );
}

/**
 * Implements hook_entity_info_alter()
*/
function commerce_recurring_entity_info_alter() {
  $entity_info['commerce_order']['bundles']['recurring_order'] = array(
    'label' => t('Recurring Order', array(), array(
      'context' => 'a recurring drupal commerce order',
    )),
  );
}