'Serialized taxonomies', 'page callback' => 'cobalttaxonomy_json', 'page arguments' => array('update', 3), 'access arguments' => array('use cobalt'), 'type' => MENU_CALLBACK, ); return $items; } function cobalttaxonomy_json($op, $value) { global $user; $vocabularies = taxonomy_get_vocabularies(); $voc_data = array(); foreach ($vocabularies as $vocabulary) { $voc_data[$vocabulary->vid] = $vocabulary->name; } $term_tree = array(); foreach ($vocabularies as $vocabulary) { $term_tree += taxonomy_get_tree($vocabulary->vid); } $term_data = array(); foreach ($term_tree as $term) { $term_data[$term->tid] = array($term->name, $term->vid); } $data = array('vocabularies' => $voc_data, 'terms' => $term_data, 'access' => user_access('administer taxonomy')); print drupal_json_output($data); exit; }