You are here

function bundle_copy_menu in Bundle Copy 7.2

Same name and namespace in other branches
  1. 7 bundle_copy.module \bundle_copy_menu()

Implements hook_menu().

File

./bundle_copy.module, line 82
Bundle copy.

Code

function bundle_copy_menu() {
  $items = array();
  $bc_info = bundle_copy_get_info();
  foreach ($bc_info as $entity_type => $info) {
    $items[$info['export_menu']['path']] = array(
      'title' => 'Export',
      'page callback' => 'drupal_get_form',
      'page arguments' => array(
        'bundle_copy_export',
        $entity_type,
      ),
      'access arguments' => array(
        $info['export_menu']['access arguments'],
      ),
      'type' => MENU_LOCAL_TASK,
    );
    $items[$info['import_menu']['path']] = array(
      'title' => 'Import',
      'page callback' => 'drupal_get_form',
      'page arguments' => array(
        'bundle_copy_import',
        $entity_type,
      ),
      'access callback' => 'bundle_copy_import_access',
      'access arguments' => array(
        $info['import_menu']['access arguments'],
      ),
      'type' => MENU_LOCAL_TASK,
    );
    if (isset($info['clone_menu']['path'])) {
      $bname_validate = $bc_info[$entity_type]['bundle_clone_name_validate'];
      $items[$info['clone_menu']['path']] = array(
        'title' => 'Clone',
        'page callback' => 'drupal_get_form',
        'page arguments' => array(
          'bundle_copy_clone',
          $entity_type,
          $bname_validate,
        ),
        'access arguments' => array(
          $info['clone_menu']['access arguments'],
        ),
        'type' => MENU_LOCAL_TASK,
      );
    }
  }
  return $items;
}