You are here

function biblio_dump_db_data_for_pot in Bibliography Module 6.2

Same name and namespace in other branches
  1. 6 biblio.import.export.inc \biblio_dump_db_data_for_pot()
  2. 7 includes/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 851
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();
  while ($type = db_fetch_object($result)) {
    $strings[] = $type->name;
    if (!empty($type->description)) {
      $strings[] = $type->description;
    }
  }
  $query = "SELECT title, hint FROM {biblio_field_type_data} ";
  $result = db_query($query);
  while ($type_data = db_fetch_object($result)) {
    $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);
  while ($type_data = db_fetch_object($result)) {
    $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_set_header('Content-Type: text/plain; charset=utf-8');
  drupal_set_header('Content-Disposition: attachment; filename=biblio_db_values.pot');
  print $output;
}