You are here

function biblio_ui_export_view in Bibliography Module 7.3

Export a Biblio entities to a file by a View.

Parameters

$view_name: Biblio related View name.

$display_name: Biblio related View display name.

$style_name: Biblio style string.

$format_name: (Optional) Biblio export format string.

1 string reference to 'biblio_ui_export_view'
biblio_ui_menu in modules/biblio_ui/biblio_ui.module
Implements hook_menu().

File

modules/biblio_ui/biblio_ui.module, line 1168
Main functionality file for the biblio UI module.

Code

function biblio_ui_export_view($view_name, $display_name, $style_name, $format_name = NULL) {
  $bids = array();
  $view = views_get_view($view_name);
  $view
    ->set_display($display_name);

  // Disable pager. Need to export all at once.
  $pager = $view->display_handler
    ->get_option('pager');
  $pager['type'] = 'none';
  $view->display_handler
    ->set_option('pager', $pager);

  // Execute and gather the IDs.
  $view
    ->execute($display_name);
  foreach ($view->result as $biblio) {
    $bids[] = $biblio->bid;
  }
  biblio_ui_export($bids, $style_name, $format_name);
}