You are here

function export_menu in Node export 5

Same name and namespace in other branches
  1. 5.2 export.module \export_menu()
  2. 6 export.module \export_menu()

Implementation of hook_menu().

File

./export.module, line 28

Code

function export_menu($may_cache) {
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => 'admin/settings/export',
      'title' => t('Export module'),
      'description' => t('Allows users to export (copy then edit) an existing node.'),
      'callback' => 'drupal_get_form',
      'callback arguments' => 'export_settings',
      'access' => user_access('administer site configuration'),
    );
  }
  else {
    $items[] = array(
      'path' => 'admin/content/import',
      'title' => t('Import Node'),
      'description' => t('Allows users to import a node from another site.'),
      'callback' => 'export_node_import',
      'access' => user_access('import nodes'),
    );
    if (arg(0) == 'node' && is_numeric(arg(1))) {
      $node = node_load(arg(1));
      if ($node->nid) {
        $items[] = array(
          'path' => 'node/' . $node->nid . '/export',
          'title' => t('Export'),
          'callback' => 'drupal_get_form',
          'callback arguments' => array(
            'export_node_export',
            $node->nid,
          ),
          'access' => export_access($node),
          'type' => MENU_LOCAL_TASK,
          'weight' => 5,
        );
      }
    }
  }
  return $items;
}