You are here

function taxonomy_workbench_access_load in Workbench Access 7

Implements hook_workbench_access_load().

Load data for a taxonomy term.

File

modules/taxonomy.workbench_access.inc, line 210
Taxonomy integration for Workbench Access.

Code

function taxonomy_workbench_access_load($scheme) {
  $data = array();
  if ($vocabulary = taxonomy_vocabulary_machine_name_load($scheme['access_id'])) {
    $data = array(
      'name' => $vocabulary->name,
      'description' => $vocabulary->description,
      'access_id' => $vocabulary->machine_name,
    );
  }
  elseif ($term = taxonomy_term_load($scheme['access_id'])) {
    $data = array(
      'name' => $term->name,
      'description' => $term->description,
      'access_id' => $term->tid,
    );
  }
  return $data;
}