You are here

function commerce_registration_menu_alter in Commerce Registration 7.2

Same name and namespace in other branches
  1. 7.3 commerce_registration.module \commerce_registration_menu_alter()

Implements hook_menu_alter().

Parameters

$menu:

File

./commerce_registration.module, line 47
Commerce Registration module code.

Code

function commerce_registration_menu_alter(&$menu) {
  foreach (commerce_info_fields('commerce_product_reference') as $field_name => $field) {
    foreach ($field['bundles'] as $type => $bundles) {
      if ($type == "commerce_line_item" || $type == "commerce_product") {
        continue;
      }
      $menu[$type . '/%entity_object/registrations'] = array(
        'load arguments' => array(
          $type,
        ),
        'title' => t('Manage Registrations'),
        'page callback' => 'commerce_registration_registration_page',
        'page arguments' => array(
          0,
          1,
        ),
        'access callback' => 'commerce_registration_administer_registrations_access',
        'access arguments' => array(
          0,
          1,
        ),
        'type' => MENU_LOCAL_TASK,
      );
      $menu[$type . '/%entity_object/registrations/list'] = array(
        'load arguments' => array(
          $type,
        ),
        'title' => t('Registrations'),
        'page callback' => 'commerce_registration_registration_page',
        'page arguments' => array(
          0,
          1,
        ),
        'access callback' => 'commerce_registration_administer_registrations_access',
        'access arguments' => array(
          0,
          1,
        ),
        'type' => MENU_DEFAULT_LOCAL_TASK,
      );
      $menu[$type . '/%entity_object/registrations/settings'] = array(
        'load arguments' => array(
          $type,
        ),
        'title' => t('Settings'),
        'page callback' => 'drupal_get_form',
        'page arguments' => array(
          'commerce_registration_node_registrations_settings_form',
          0,
          1,
        ),
        'access callback' => 'commerce_registration_administer_registrations_access',
        'access arguments' => array(
          0,
          1,
        ),
        'file path' => drupal_get_path('module', 'commerce_registration'),
        'file' => 'includes/commerce_registration.forms.inc',
        'weight' => 9,
        'type' => MENU_LOCAL_TASK,
      );
      $menu[$type . '/%entity_object/registrations/broadcast'] = array(
        'load arguments' => array(
          $type,
        ),
        'title' => t('Email Registrants'),
        'page callback' => 'drupal_get_form',
        'page arguments' => array(
          'commerce_registration_registrations_broadcast_form',
          0,
          1,
        ),
        'access callback' => 'commerce_registration_administer_registrations_access',
        'access arguments' => array(
          0,
          1,
        ),
        'file path' => drupal_get_path('module', 'commerce_registration'),
        'file' => 'includes/commerce_registration.forms.inc',
        'weight' => 10,
        'type' => MENU_LOCAL_TASK,
      );
    }
  }
}