You are here

function ctools_context_vocabulary_settings_form in Chaos Tool Suite (ctools) 6

Same name and namespace in other branches
  1. 7 plugins/contexts/vocabulary.inc \ctools_context_vocabulary_settings_form()
1 string reference to 'ctools_context_vocabulary_settings_form'
vocabulary.inc in plugins/contexts/vocabulary.inc
Plugin to provide a vocabulary context

File

plugins/contexts/vocabulary.inc, line 47
Plugin to provide a vocabulary context

Code

function ctools_context_vocabulary_settings_form($conf) {
  $options = array();
  foreach (taxonomy_get_vocabularies() as $vid => $vocabulary) {
    $options[$vid] = $vocabulary->name;
  }
  $form['vid'] = array(
    '#title' => t('Vocabulary'),
    '#type' => 'select',
    '#options' => $options,
    '#default_value' => isset($conf['vid']) ? $conf['vid'] : array(),
    '#prefix' => '<div class="clear-block">',
    '#suffix' => '</div>',
    '#description' => t('Select the vocabulary for this form.'),
  );
  return $form;
}