function event_available_terms in Event Calendar 7
Callback: Function to collect available terms for event calendar.
2 calls to event_available_terms()
- event_admin_events in ./
event_calendar.list.inc - Form builder: Builds the event administration overview.
- event_filter_form in ./
event_calendar.list.inc - Return form for events node administration filters.
File
- ./
event_calendar.list.inc, line 186 - Event administration UI.
Code
function event_available_terms() {
// Build query to fetch available terms.
$vid = db_query("SELECT vid FROM {taxonomy_vocabulary} WHERE machine_name = :machine_name", array(
':machine_name' => TAXONOMY_NAME,
))
->fetchField();
// Get all terms of a vocabulary.
$taxonomy = taxonomy_get_tree($vid);
// Add an extra option 'any', will be show as filter option.
$terms = array(
'any',
);
foreach ($taxonomy as $term) {
$terms[$term->tid] = $term->name;
}
return $terms;
}