You are here

function node_export_menu in Node export 7.3

Same name and namespace in other branches
  1. 6.3 node_export.module \node_export_menu()
  2. 6.2 node_export.module \node_export_menu()

Implements hook_menu().

File

./node_export.module, line 32
The Node export module.

Code

function node_export_menu() {
  $items['admin/config/content/node_export'] = array(
    'access arguments' => array(
      'administer site configuration',
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'node_export_settings',
    ),
    'title' => 'Node export',
    'description' => 'Configure the settings for Node export.',
    'file' => 'node_export.pages.inc',
  );

  // Allow other modules to add local task tabs.
  $items['admin/config/content/node_export/settings'] = array(
    'title' => 'Settings',
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $selected_formats = variable_get('node_export_format', array(
    'drupal' => 'drupal',
  ));
  if (count(array_filter($selected_formats)) > 1) {
    $format_handlers = node_export_format_handlers();
    foreach ($format_handlers as $format_handler => $format) {
      if (!empty($selected_formats[$format_handler])) {
        $items['node/%node/node_export/' . $format_handler] = array(
          'access callback' => 'node_export_access_export',
          'access arguments' => array(
            1,
          ),
          'page callback' => 'node_export_gui',
          'page arguments' => array(
            1,
            $format_handler,
          ),
          'title' => 'Node export (' . $format['#title'] . ')',
          'weight' => 5,
          'type' => MENU_LOCAL_TASK,
          'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,
          'file' => 'node_export.pages.inc',
        );
      }
    }
  }
  else {
    $items['node/%node/node_export'] = array(
      'access callback' => 'node_export_access_export',
      'access arguments' => array(
        1,
      ),
      'page callback' => 'node_export_gui',
      'page arguments' => array(
        1,
      ),
      'title' => 'Node export',
      'weight' => 5,
      'type' => MENU_LOCAL_TASK,
      'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,
      'file' => 'node_export.pages.inc',
    );
  }
  $items['admin/content/node_export'] = array(
    'access arguments' => array(
      'export nodes',
    ),
    'page callback' => 'node_export_gui',
    'page arguments' => array(
      NULL,
      NULL,
    ),
    'title' => 'Node export',
    'type' => MENU_CALLBACK,
    'file' => 'node_export.pages.inc',
  );
  $items['node/add/node_export'] = array(
    'title' => 'Node export: import',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'node_export_import_form',
    ),
    'access callback' => 'node_export_access_import',
    'description' => 'Import content using <em>Node export</em>.',
    'file' => 'node_export.pages.inc',
  );
  return $items;
}