function synonyms_form_taxonomy_form_vocabulary_alter in Synonyms 7
Implements hook_form_FORM_ID_alter().
File
- ./
synonyms.module, line 158 - Provide synonyms feature for Drupal entities.
Code
function synonyms_form_taxonomy_form_vocabulary_alter(&$form, &$form_state) {
// TODO: remove this function after a few releases of Synonyms module, since
// now the module oversees synonyms of all entities, not only taxonomy terms.
if (isset($form_state['confirm_delete']) && $form_state['confirm_delete']) {
return;
}
if (!isset($form['#vocabulary']->vid) || !$form['#vocabulary']->vid) {
return;
}
$form['synonyms'] = array(
'#type' => 'fieldset',
'#title' => t('Synonyms'),
'#collapsible' => TRUE,
);
$form['synonyms']['link'] = array(
'#markup' => t('You can configure synonyms of @vocabulary following <a href="@url">this link</a>.', array(
'@vocabulary' => $form['#vocabulary']->name,
'@url' => url('admin/structure/synonyms/taxonomy_term/' . $form['#vocabulary']->machine_name, array(
'query' => drupal_get_destination(),
)),
)),
);
}