You are here

function oa_core_get_space_type_options in Open Atrium Core 7.2

Gets all the options for space_type or section_type.

Parameters

string $vocab_name: (Optional) The name of the vocabulary (ex. space_type, section_type).

1 call to oa_core_get_space_type_options()
_oa_core_setup_node_space_type in ./oa_core.module
Alters a node edit form to setup the space_type/section_type functionality.

File

./oa_core.module, line 1563

Code

function oa_core_get_space_type_options($vocab_name = 'space_type') {

  // Load all the terms for this vocabulary.
  $query = db_select('taxonomy_term_data', 'td');
  $query
    ->join('taxonomy_vocabulary', 'v', 'v.vid = td.vid');
  $query
    ->fields('td', array(
    'tid',
  ))
    ->condition('v.machine_name', $vocab_name);
  $terms = taxonomy_term_load_multiple($query
    ->execute()
    ->fetchCol());
  $options = array();
  foreach ($terms as $term) {
    $options[$term->tid] = module_invoke_all('oa_core_space_type_options', $term, $vocab_name);
  }
  drupal_alter('oa_core_space_type_options', $options, $vocab_name);
  return $options;
}