You are here

function nfcbiblio_nodeformcols_variants_alter in Node form columns 7

Implements hook_nodeformcols_variants_alter().

Implement this hook to supply information about form variants that can be configured.

Parameters

array $variants: The current variants of the form

string $type: The node type

Return value

void

File

./nfcbiblio.module, line 15

Code

function nfcbiblio_nodeformcols_variants_alter(&$variants, $type) {
  if ($type == 'biblio') {
    $res = db_query('SELECT tid, name
      FROM {biblio_types}
      WHERE tid >= :tid
        AND visible = :visible
      ORDER BY weight ASC', array(
      ':tid' => 0,
      ':visible' => 1,
    ));
    while ($option = $res
      ->fetchObject()) {
      $variants[$option->tid] = $option->name;
    }
  }
}