You are here

function autotag_tag_options in Taxonomy Autotagger 8.3

Same name and namespace in other branches
  1. 7.3 autotag.module \autotag_tag_options()

Callback for the options form

1 string reference to 'autotag_tag_options'
autotag_tag_suggestion_info in ./autotag.module
Implementation of hook_tag_suggestion_info().

File

./autotag.module, line 150
Implements the API on tag suggestion/autotagging modules as outlined at http://groups.drupal.org/node/100179

Code

function autotag_tag_options($node_type, $settings) {
  $vocabularies = taxonomy_vocabulary_load_multiple(FALSE);
  $options = array();
  foreach ($vocabularies as $vid => $vocabulary) {
    $options[$vid] = $vocabulary->name;
  }
  return array(
    'tag_only_with_tips' => array(
      '#title' => t('Tag with leaves'),
      '#type' => 'checkbox',
      '#default_value' => isset($settings['autotag']['tag_only_with_tips']) ? $settings['autotag']['tag_only_with_tips'] : 0,
      '#description' => 'Check this box if you would only like "leaf" terms to be used for tagging, else ALL terms will be used.',
    ),
    'autotag_vids' => array(
      '#title' => t('Vocabularies'),
      '#type' => 'select',
      '#options' => $options,
      '#multiple' => TRUE,
      '#description' => t('Select the vocabularies you would like to search.'),
      '#default_value' => isset($settings['autotag']['autotag_vids']) ? $settings['autotag']['autotag_vids'] : array(),
    ),
  );
}