You are here

function node_export_node_operations in Node export 7.3

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

Implements hook_node_operations().

File

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

Code

function node_export_node_operations() {
  $operations = array();
  if (user_access('export nodes')) {
    $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 ($selected_formats[$format_handler]) {
          $operations['node_export_' . $format_handler] = array(
            'label' => t('Node export') . " (" . $format['#title'] . ")",
            'callback' => 'node_export_bulk_operation',
            'callback arguments' => array(
              'format' => $format_handler,
            ),
          );
        }
      }
    }
    else {
      $operations = array(
        'node_export' => array(
          'label' => t('Node export'),
          'callback' => 'node_export_bulk_operation',
        ),
      );
    }
  }
  return $operations;
}