You are here

function _taxonomy_menu_build_variable in Taxonomy menu 8

Same name and namespace in other branches
  1. 6.2 taxonomy_menu.module \_taxonomy_menu_build_variable()
  2. 7.2 taxonomy_menu.module \_taxonomy_menu_build_variable()
  3. 7 taxonomy_menu.module \_taxonomy_menu_build_variable()

Builds a variable from the supplied name and machine name of the vocabulary.

Parameters

$name: The name of the variable.

$vid: The vocabulary id from which the machine name will be taken.

Return value

A variable name if a vocabulary could be found from the vid, FALSE otherwise.

2 calls to _taxonomy_menu_build_variable()
taxonomy_menu_form_taxonomy_form_vocabulary in ./taxonomy_menu.admin.inc
Form constructor for the vocabulary editing form. We add our taxonomy_menu settings in here on a per-vocabulary basis.
taxonomy_menu_variable_get in ./taxonomy_menu.module
Helper function to replace Drupal's config for Taxonomy menu. Gets a value per vocabulary.

File

./taxonomy_menu.module, line 648
Generates menu links for all selected taxonomy terms.

Code

function _taxonomy_menu_build_variable($name, $vid) {
  if ($vocabulary = entity_load('taxonomy_vocabulary', $vid)) {
    return 'taxonomy_menu_' . $name . '_' . $vocabulary->vid;
  }
  else {
    return FALSE;
  }
}