You are here

function globallink_translations_settings_taxonomy in GlobalLink Connect for Drupal 7.7

Taxonomy create form.

1 string reference to 'globallink_translations_settings_taxonomy'
globallink_menu in ./globallink.module
Implements hook_menu().

File

./globallink_settings.inc, line 1179

Code

function globallink_translations_settings_taxonomy($form, &$form_state, $object_type, $i18n_mode = I18N_MODE_NONE, $langcode = LANGUAGE_NONE, $options = NULL) {
  $form['i18n_globallink_translations_taxonomy'] = array(
    '#type' => 'fieldset',
    '#title' => t('Multilingual options'),
    '#collapsible' => TRUE,
  );
  $form['i18n_globallink_translations_taxonomy']['i18n_mode'] = array(
    '#type' => 'radios',
    '#title' => t('Translation mode'),
    '#options' => globallink_translation_taxonomy_options($object_type, $options),
    '#default_value' => $i18n_mode,
    '#description' => t('For localizable elements, to have all items available for translation visit the <a href="@locale-refresh">translation refresh</a> page.', array(
      '@locale-refresh' => url('admin/config/regional/translate/i18n_string'),
    )),
  );
  $form['i18n_globallink_translations_taxonomy']['language'] = array(
    '#default_value' => $langcode ? $langcode : LANGUAGE_NONE,
    '#description' => t('Predefined language. If set, it will apply to all items.'),
    '#required' => TRUE,
    '#states' => array(
      'visible' => array(
        'input[name="i18n_mode"]' => array(
          'value' => (string) I18N_MODE_LANGUAGE,
        ),
      ),
    ),
  ) + i18n_element_language_select();

  // The option value 'Language neutral' makes no sense here.
  $form['i18n_globallink_translations_taxonomy']['language']['#options'][LANGUAGE_NONE] = t('- Select a language -');
  $form['i18n_globallink_translations_taxonomy']['prepare_taxonomy_button'] = array(
    '#type' => 'submit',
    '#value' => t('Run Tool'),
    '#name' => 'submit_taxonomy',
    '#submit' => array(
      'prepare_taxonomy_button_submit',
    ),
    '#attributes' => array(
      'onclick' => 'if (!confirm("RUNNING TOOL: Prepare Taxonomy. This action is irreversible. Confirm this operation.")){return false;}',
    ),
  );
  return $form;
}