function tripal_chado_tripal_default_title_format

3.x tripal_chado.entity.inc tripal_chado_tripal_default_title_format($bundle, $available_tokens)

Implements hook_tripal_default_title_format().

Overrides the default titles.

File

tripal_chado/includes/tripal_chado.entity.inc, line 141

Code

function tripal_chado_tripal_default_title_format($bundle, $available_tokens) {
  $format = array();

  $table = $bundle->data_table;

  if ($table == 'organism') {
    if (chado_get_version() <= '1.2') {
      $format[] = array(
        'format' => '[taxrank__genus] [taxrank__species]',
        'weight' => -5
      );
    }
    else {
      $format[] = array(
        'format' => '[taxrank__genus] [taxrank__species] [taxrank__infraspecific_taxon]',
        'weight' => -5
      );
    }
  }
  if ($table == 'biomaterial') {
    $format[] = array(
      'format' => '[schema__name]',
      'weight' => -5
    );
  }
  if ($table == 'analysis') {
    $format[] = array(
      'format' => '[schema__name]',
      'weight' => -5
    );
  }
  if ($table == 'feature') {
    $format[] = array(
      'format' => '[schema__name]',
      'weight' => -5
    );
  }
  if ($table == 'featuremap') {
    $format[] = array(
      'format' => '[schema__name]',
      'weight' => -5
    );
  }
  if ($table == 'stock') {
    $format[] = array(
      'format' => '[schema__name]',
      'weight' => -5
    );
  }
  if ($table == 'pub') {
    $format[] = array(
      'format' => '[tpub__title]',
      'weight' => -5,
    );
  }
  if ($table == 'cvterm') {
    $format[] = array(
      'format' => '[schema__name]',
      'weight' => -5,
    );
  }
  if ($table == 'project') {
    $format[] = array(
      'format' => '[schema__name]',
      'weight' => -5,
    );
  }
  if ($table == 'contact') {
    $format[] = array(
      'format' => '[schema__name]',
      'weight' => -5,
    );
  }
  if ($table == 'phylotree') {
    $format[] = array(
      'format' => '[schema__name]',
      'weight' => -5,
    );
  }
  if ($table == 'library') {
    $format[] = array(
      'format' => '[schema__name]',
      'weight' => -5,
    );
  }
  return $format;
}