You are here

function taxonomy_manager_form_voc_jumper in Taxonomy Manager 7

Adds a voc jumper menu, if ctools is enabled.

1 call to taxonomy_manager_form_voc_jumper()
taxonomy_manager_form in ./taxonomy_manager.admin.inc
defines forms for taxonomy manager interface

File

./taxonomy_manager.admin.inc, line 379

Code

function taxonomy_manager_form_voc_jumper(&$form, $form_state) {
  if (module_exists('ctools')) {
    $options = array();
    foreach (taxonomy_vocabulary_get_names() as $voc) {
      $options[url('admin/structure/taxonomy_manager/voc/' . $voc->machine_name)] = $voc->name;
    }
    ctools_include('jump-menu');
    $settings = array(
      'choose' => t('-- Switch vocabulary --'),
    );
    $form = ctools_jump_menu($form, $form_state, $options, $settings);

    // Attach the JS in case we rebuild the form.
    $form['#attached']['js'][] = drupal_get_path('module', 'ctools') . '/js/jump-menu.js';
  }
}