You are here

function biblio_dump_db_data_for_pot in Bibliography Module 7

Same name and namespace in other branches
  1. 6.2 includes/biblio.import.export.inc \biblio_dump_db_data_for_pot()
  2. 6 biblio.import.export.inc \biblio_dump_db_data_for_pot()
  3. 7.2 includes/biblio.import.export.inc \biblio_dump_db_data_for_pot()
1 call to biblio_dump_db_data_for_pot()
biblio_export_form_submit in includes/biblio.import.export.inc
1 string reference to 'biblio_dump_db_data_for_pot'
biblio_menu in ./biblio.module
Implements hook_menu().

File

includes/biblio.import.export.inc, line 932
Functions that are used to import and export biblio data.

Code

function biblio_dump_db_data_for_pot() {
  $query = "SELECT name, description FROM {biblio_types} ";
  $result = db_query($query);
  $strings = array();
  foreach ($result as $type) {
    $strings[] = $type->name;
    if (!empty($type->description)) {
      $strings[] = $type->description;
    }
  }
  $query = "SELECT title, hint FROM {biblio_field_type_data} ";
  $result = db_query($query);
  foreach ($result as $type_data) {
    $strings[] = $type_data->title;
    if (!empty($type_data->hint)) {
      $strings[] = $type_data->hint;
    }
  }
  $query = "SELECT title, hint FROM {biblio_contributor_type_data} ";
  $result = db_query($query);
  foreach ($result as $type_data) {
    $strings[] = $type_data->title;
    if (!empty($type_data->hint)) {
      $type_data->hint;
    }
  }
  $strings = array_unique($strings);
  foreach ($strings as $string) {
    $output .= "t(\"{$string}\"\\);\n";
  }
  drupal_add_http_header('Content-Type', 'text/plain; charset=utf-8');
  drupal_add_http_header('Content-Disposition', 'attachment; filename=biblio_db_values.pot');
  print $output;
}