function glossary_alphabet_form in Glossary 5.2
Same name and namespace in other branches
- 5 glossary.module \glossary_alphabet_form()
- 6 glossary.admin.inc \glossary_alphabet_form()
- 7 glossary.admin.inc \glossary_alphabet_form()
This is the form for the getting the user's alphabet for the alphabar.
1 string reference to 'glossary_alphabet_form'
- glossary_menu in ./
glossary.module - Implementation of hook_menu().
File
- ./
glossary.module, line 1458 - Glossary terms will be automatically marked with links to their descriptions.
Code
function glossary_alphabet_form() {
global $locale;
$form = array();
// $status = db_fetch_array(db_query("SHOW TABLE STATUS LIKE '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(
' ' => 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.'),
'#rows' => 1,
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Save configuration'),
'#weight' => 5,
);
return $form;
}