You are here

function workbench_access_vocabulary_exists in Workbench Access 7

Check to see if our vocabulary is installed.

Parameters

$vocabulary: A vocabulary object,

Return value

Boolean TRUE or FALSE.

2 calls to workbench_access_vocabulary_exists()
workbench_access_example_taxonomy in ./workbench_access.admin.inc
Install a test vocabulary.
workbench_access_settings_form in ./workbench_access.admin.inc
Settings form for Workbench Access configuration.

File

./workbench_access.admin.inc, line 1013
Workbench Access admin file.

Code

function workbench_access_vocabulary_exists($vocabulary) {

  // Ensure that this is a unique vocabulary.
  $existing = taxonomy_get_vocabularies();
  foreach ($existing as $voc) {
    if ($voc->machine_name == $vocabulary->machine_name) {
      return TRUE;
    }
  }
  return FALSE;
}