You are here

function commerce_recurring_ui_menu in Commerce Recurring Framework 7.2

Implements hook_menu().

File

commerce_recurring_ui/commerce_recurring_ui.module, line 6

Code

function commerce_recurring_ui_menu() {
  $items = array();
  $items['admin/commerce/recurring-entities/types'] = array(
    'title' => 'Recurring entity types',
    'description' => 'Manage recurring entity types for your store.',
    'page callback' => 'commerce_recurring_ui_types_overview',
    'access arguments' => array(
      'administer commerce_recurring entities',
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 0,
    'file' => 'commerce_recurring_ui.admin.inc',
  );
  foreach (commerce_recurring_types() as $type) {

    // Convert underscores to hyphens for the menu item argument.
    $type_arg = strtr($type, '_', '-');
    $title = ucfirst(strtr($type, '_', ' '));
    $items['admin/commerce/recurring-entities/types/' . $type_arg] = array(
      'title' => $title,
      'page callback' => 'commerce_recurring_ui_entity_type_redirect',
      'page arguments' => array(
        $type,
      ),
      'access arguments' => array(
        'administer commerce_recurring entities',
      ),
      'file' => 'commerce_recurring_ui.admin.inc',
    );
  }
  $items['admin/commerce/recurring-entities/%commerce_recurring/edit'] = array(
    'title' => 'Edit',
    'page callback' => 'entity_ui_get_form',
    'page arguments' => array(
      'commerce_recurring',
      3,
    ),
    'access callback' => 'commerce_recurring_access',
    'access arguments' => array(
      'update',
      3,
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => -5,
    'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,
    'file' => 'commerce_recurring_ui.admin.inc',
  );
  $items['admin/commerce/recurring-entities/%commerce_recurring/delete'] = array(
    'title' => 'Delete',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'commerce_recurring_ui_delete_confirm_form',
      3,
    ),
    'access callback' => 'commerce_recurring_access',
    'access arguments' => array(
      'delete',
      3,
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 20,
    'context' => MENU_CONTEXT_INLINE,
    'file' => 'commerce_recurring_ui.admin.inc',
  );
  $items['user/%user/recurring/%commerce_recurring/cancel/%'] = array(
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'commerce_recurring_ui_cancel_renewals_form',
      1,
      3,
      5,
    ),
    'access callback' => 'commerce_recurring_ui_cancel_access',
    'access arguments' => array(
      'cancel own subscription renewals',
      3,
    ),
    'description' => 'Cancel subscription renewals',
    'type' => MENU_CALLBACK,
  );
  return $items;
}