You are here

function taxonomy_manager_search_form in Taxonomy Manager 7

form for searching terms

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

File

./taxonomy_manager.admin.inc, line 399

Code

function taxonomy_manager_search_form(&$form, $voc) {
  $form['#attached']['js'][] = array(
    'data' => array(
      'hideForm' => array(
        array(
          'show_button' => 'edit-search-show',
          'hide_button' => 'edit-search-cancel',
          'div' => 'edit-search',
        ),
      ),
    ),
    'type' => 'setting',
  );
  $form['toolbar']['search_show'] = array(
    //'#type' => 'button',
    '#attributes' => array(
      'class' => array(
        'taxonomy-manager-buttons',
        'search',
      ),
    ),
    '#value' => t('Search'),
    '#theme' => 'no_submit_button',
  );
  $search_description = t("You can search directly for existing terms.\n      If your input doesn't match an existing term, it will be used for filtering root level terms (useful for non-hierarchical vocabularies).");
  $form['search'] = array(
    '#type' => 'fieldset',
    '#title' => t('Search'),
    '#attributes' => array(
      'style' => 'display:none;',
      'id' => 'edit-search',
    ),
    '#description' => $search_description,
    '#collapsed' => TRUE,
    '#tree' => TRUE,
  );
  $form['search']['field'] = array(
    '#type' => 'textfield',
    '#title' => t('Search String'),
    '#autocomplete_path' => 'taxonomy_manager/autocomplete/' . $voc->vid,
  );
  $search_options = array(
    //'synonyms' => t('Include synonyms'), // @todo implement synonyms feature
    'subtrees' => t('Search under selected terms'),
  );
  if (module_exists('i18n_taxonomy')) {
    if (i18n_taxonomy_vocabulary_mode($voc->vid, I18N_MODE_TRANSLATE)) {
      $search_options['language'] = t('Search within selected language');
    }
  }
  $form['search']['options'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Search options'),
    '#options' => $search_options,
  );
  $form['search']['button'] = array(
    '#type' => 'submit',
    '#attributes' => array(
      'class' => array(
        'taxonomy-manager-buttons',
        'search',
      ),
    ),
    '#value' => t('Search'),
  );
  $form['search']['cancel'] = array(
    //'#type' => 'button',
    '#value' => t('Cancel'),
    '#theme' => 'no_submit_button',
    '#attributes' => array(
      'class' => array(
        'taxonomy-manager-buttons',
        'cancel',
      ),
    ),
  );
}