You are here

function node_export_node_operations in Node export 6.3

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

Implementation of hook_node_operations().

File

./node_export.module, line 203
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(
      'node_code',
    ));
    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_handler,
              NULL,
            ),
          );
        }
      }
    }
    else {
      $operations = array(
        'node_export' => array(
          'label' => t('Node export'),
          'callback' => 'node_export_bulk_operation',
          'callback arguments' => array(
            NULL,
            NULL,
          ),
        ),
      );
    }
  }
  return $operations;
}