You are here

function _taxonomy_hierarchical_select_get_save_linage in Hierarchical Select 5.2

Get the save lineage setting for a vocabulary, but use a smart default.

Parameters

$vid: A vocabulary id.

Return value

The save lineage setting.

3 calls to _taxonomy_hierarchical_select_get_save_linage()
hierarchical_select_taxonomy_form_vocabulary_validate in modules/taxonomy.inc
Additional validate handler for the taxonomy_form_vocabulary form.
taxonomy_hierarchical_select_form_alter in modules/taxonomy.inc
Implementation of hook_hierarchical_select_form_alter().
taxonomy_hierarchical_select_update_form_item in modules/taxonomy.inc
Sets certain Hierarchical Select settings, based on the vid. The user can configure this on the vocabulary administration page, this function applies those settings.

File

modules/taxonomy.inc, line 384

Code

function _taxonomy_hierarchical_select_get_save_linage($vid) {

  // Determine the default based on the type of hierarchy: single (1) or
  // multiple parents (2). The latter has the "Save lineage" option enabled
  // by default.
  $vocabulary = taxonomy_get_vocabulary($vid);
  $save_lineage_default = $vocabulary->hierarchy == HS_TAXONOMY_MULTIPLE_PARENTS ? HS_TAXONOMY_DO_SAVE_LINEAGE : HS_TAXONOMY_DONT_SAVE_LINEAGE;
  return variable_get("hierarchical_select_save_lineage_{$vid}", $save_lineage_default);
}