function glossary_alphabet_form in Glossary 7
Same name and namespace in other branches
- 5.2 glossary.module \glossary_alphabet_form()
- 5 glossary.module \glossary_alphabet_form()
- 6 glossary.admin.inc \glossary_alphabet_form()
This is the form for the getting the user's alphabet for the alphabar. @todo Please document this function.
See also
1 string reference to 'glossary_alphabet_form'
- glossary_menu in ./
glossary.module - Implements hook_menu().
File
- ./
glossary.admin.inc, line 162 - Glossary administration functions and forms.
Code
function glossary_alphabet_form($form, &$form_state) {
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.'),
'#attributes' => array(
'class' => array(
'container-inline',
),
),
);
$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;
}