You are here

function glossary_alphabet_form in Glossary 6

Same name and namespace in other branches
  1. 5.2 glossary.module \glossary_alphabet_form()
  2. 5 glossary.module \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.admin.inc, line 159
Glossary administration functions and forms.

Code

function glossary_alphabet_form() {
  global $language;
  $form = array();
  $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(
    ' ' => t('<none>'),
    '|' => t('vertical bar (pipe)'),
    '•' => t('bullet'),
    '–' => t('en-dash (–)'),
    '—' => t('em-dash (—)'),
    '_' => t('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['alphabar_instruction'] = array(
    '#type' => 'textarea',
    '#title' => t('Alphabar instruction'),
    '#default_value' => variable_get('glossary_alphabar_instruction', _alphabar_instruction_default()),
    '#description' => t('This is the text that will appear immediately below the alphabar. HTML may not be rendered correctly.'),
    '#rows' => 1,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save configuration'),
    '#weight' => 5,
  );
  return $form;
}