You are here

function _taxonomy_menu_build_variable in Taxonomy menu 7.2

Same name and namespace in other branches
  1. 8 taxonomy_menu.module \_taxonomy_menu_build_variable()
  2. 6.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.

3 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 variable_get() for Taxonomy menu. Gets a value per vocabulary.
taxonomy_menu_variable_set in ./taxonomy_menu.module
Helper function to replace Drupal's variable_set() for Taxonomy menu. Sets a value per vocabulary.

File

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

Code

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