You are here

function name_install_default_formats in Name Field 6

Same name and namespace in other branches
  1. 7 name.install \name_install_default_formats()

Inserts some common formats.

2 calls to name_install_default_formats()
name_install in ./name.install
Implementation of hook_install().
name_update_6000 in ./name.install
This adds the formats that would otherwise be inserted during installation.

File

./name.install, line 135
Standard installation functions for name.

Code

function name_install_default_formats() {
  $t = get_t();
  $formats = array(
    array(
      'format' => '(((((t+ig)+im)+if)+is)+ic)',
      'name' => $t('Full'),
      'machine_name' => 'full',
    ),
    array(
      'format' => 'g',
      'name' => $t('Given'),
      'machine_name' => 'given',
    ),
    array(
      'format' => 'f',
      'name' => $t('Family'),
      'machine_name' => 'family',
    ),
    array(
      'format' => 't+if',
      'name' => $t('Title Family'),
      'machine_name' => 'formal',
    ),
    array(
      'format' => 'g+if',
      'name' => $t('Given Family'),
      'machine_name' => 'short_full',
    ),
  );
  foreach ($formats as $format) {
    db_query("INSERT INTO {name_custom_format} (name, machine_name, format) VALUES ('%s', '%s', '%s')", $format['name'], $format['machine_name'], $format['format']);
  }
}