You are here

function glossary_alphabet_form in Glossary 5

Same name and namespace in other branches
  1. 5.2 glossary.module \glossary_alphabet_form()
  2. 6 glossary.admin.inc \glossary_alphabet_form()
  3. 7 glossary.admin.inc \glossary_alphabet_form()
1 string reference to 'glossary_alphabet_form'
glossary_menu in ./glossary.module
Implementation of hook_menu().

File

./glossary.module, line 945

Code

function glossary_alphabet_form() {
  global $locale;
  $form = array();
  $status = db_fetch_array(db_query("SHOW TABLE STATUS WHERE name='term_data'"));
  $form['locale'] = array(
    '#type' => 'markup',
    '#value' => '<big>' . t('The current locale is set to "@loc". The term_data collation is "!collate".', array(
      '@loc' => $locale,
      '!collate' => $status['Collation'],
    )) . '</big>',
  );
  $form['alphabet'] = array(
    '#type' => 'textarea',
    '#title' => t('Enter all the letters of your alphabet, in the correct order and in lower case.'),
    '#default_value' => implode(' ', variable_get('glossary_alphabet', range('a', 'z'))),
    '#description' => t('Separate the letters by a blank.'),
    '#rows' => 1,
  );
  $form['digits'] = array(
    '#type' => 'textarea',
    '#title' => t('Enter all the digits of your alphabet, in the correct order.'),
    '#default_value' => implode(' ', variable_get('glossary_digits', range('0', '9'))),
    '#description' => t("Separate the digits by a blank. If you don't want terms to start with digits, leave this blank."),
    '#rows' => 1,
  );
  $form['suppress_unused'] = array(
    '#type' => 'checkbox',
    '#title' => t('Suppress unused letters?'),
    '#default_value' => variable_get('glossary_suppress_unused', false),
    '#description' => t('This will cause unused letters to be omitted from the alphabar.'),
  );
  $ab_seps = array(
    ' ' => '&lt;none>',
    '|' => 'vertical bar (pipe)',
    '&bull;' => 'bullet',
    '&#8211;' => 'en-dash (&#8211;)',
    '&#8212;' => 'em-dash (&#8212;)',
    '_' => 'underscore',
  );
  $form['alphabar_separator'] = array(
    '#type' => 'radios',
    '#options' => $ab_seps,
    '#title' => t('Alphabar separator'),
    '#default_value' => variable_get('glossary_alphabar_separator', '|'),
    '#description' => t('This is the character that will separate the letters in the alphabar.'),
    '#prefix' => '<div class="glossary_radios">',
    '#suffix' => '</div>',
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save configuration'),
    '#weight' => 5,
  );
  return $form;
}