function glossary_general_settings_form in Glossary 5.2
Same name and namespace in other branches
- 5 glossary.module \glossary_general_settings_form()
- 6 glossary.admin.inc \glossary_general_settings_form()
- 7 glossary.admin.inc \glossary_general_settings_form()
2 string references to 'glossary_general_settings_form'
- glossary_menu in ./
glossary.module - Implementation of hook_menu().
- glossary_settings_page in ./
glossary.module - This is the introductory stuff for the settings.
File
- ./
glossary.module, line 1319 - Glossary terms will be automatically marked with links to their descriptions.
Code
function glossary_general_settings_form() {
$form = array();
$form['general'] = array(
'#type' => 'fieldset',
'#title' => t('General settings'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['general']['glossary_disable_indicator'] = array(
'#type' => 'checkbox',
'#title' => t('Allow the user to disable glossary links.'),
'#default_value' => variable_get('glossary_disable_indicator', FALSE),
'#description' => t('Determines whether or not the individual user may disable the Glossary indicators.'),
);
$form['general']['glossary_hide_menus'] = array(
'#type' => 'checkbox',
'#title' => t('Hide unused input format tabs.'),
'#default_value' => variable_get('glossary_hide_menus', FALSE),
'#description' => t('Determines whether or not to hide settings tabs for input formats that are not glossary-enabled.'),
);
$click_options = array(
t('Show only the single term.'),
t('Advance the whole glossary to the term.'),
);
$form['general']['glossary_click_option'] = array(
'#type' => 'radios',
'#title' => t('Clicking on a term link will'),
'#options' => $click_options,
'#default_value' => variable_get("glossary_click_option", 0),
'#description' => t('Changing this setting may require you to clear the cache_filter.'),
'#prefix' => '<div class="glossary_radios">',
'#suffix' => '</div>',
);
$form['general']['glossary_show_edit'] = array(
'#type' => 'checkbox',
'#title' => t('Show "edit" link.'),
'#default_value' => variable_get('glossary_show_edit', TRUE),
'#description' => t('Determines whether or not to show an "edit term" link for each entry.'),
);
$form['general']['glossary_show_search'] = array(
'#type' => 'checkbox',
'#title' => t('Show "search" link.'),
'#default_value' => variable_get('glossary_show_search', TRUE),
'#description' => t('Determines whether or not to show an "search for term" link for each entry.'),
);
$form['glossary_page'] = array(
'#type' => 'fieldset',
'#title' => t('Glossary Page'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
// This next setting cannot vary by format since the glossary overview doesn't care or know about input formats
$form['glossary_page']['glossary_page_per_letter'] = array(
'#type' => 'checkbox',
'#title' => t('Show glossary across many smaller pages.'),
'#default_value' => variable_get('glossary_page_per_letter', FALSE),
'#description' => t('Do you want to show all terms on one glossary page or break up the glossary into a page for each first letter (i.e. many pages).'),
);
$form['glossary_page']['glossary_separate_letters'] = array(
'#type' => 'checkbox',
'#title' => t('Separate letters.'),
'#default_value' => variable_get('glossary_separate_letters', FALSE),
'#description' => t('Separate the terms by the first letters. This will create a large letter at the beginning of each section.'),
);
$form['glossary_page']['glossary_allow_no_description'] = array(
'#type' => 'checkbox',
'#title' => t('Show glossary terms even if there is no description.'),
'#default_value' => variable_get('glossary_allow_no_description', FALSE),
'#description' => t('By default, Glossary omits terms from the list if there is no term description. This setting overrides that. This is useful on free-tagging vocabularies that rarely get descriptions.'),
);
$form['glossary_page']['glossary_show_description'] = array(
'#type' => 'checkbox',
'#title' => t('Show glossary term descriptions on the Glossary page.'),
'#default_value' => variable_get('glossary_show_description', FALSE),
'#description' => t('Glossary term descriptions may be large and/or include pictures, therefore the Glossary page can take a long time to load if you include the full descriptions.'),
);
$form['glossary_page']['glossary_show_detailed'] = array(
'#type' => 'checkbox',
'#title' => t('Show detailed descriptions on the Glossary page.'),
'#default_value' => variable_get('glossary_show_detailed', FALSE),
'#description' => t('Glossary terms may have nodes associated with them. This option allows you to include the teasers of those nodes under the term.'),
);
$form['glossary_page']['glossary_link_related'] = array(
'#type' => 'checkbox',
'#title' => t('Link related terms on the Glossary page.'),
'#default_value' => variable_get('glossary_link_related', TRUE),
'#description' => t('Do you want terms that are related to link to each other? The type of link is determined by "Clicking on a term link will" above.'),
);
$form['glossary_page']['glossary_link_related_how'] = array(
'#type' => 'checkbox',
'#title' => t('Related terms link one-way.'),
'#default_value' => variable_get('glossary_link_related_how', FALSE),
'#description' => t('By default, links are two way, that is if "a" is related to "b" then "b" is also related to "a". This option changes that so that "b" points to "a" only if it is set explicitly for the term. Requires "Link related" above to be selected.'),
'#prefix' => '<div class="glossary_link_related_how">',
'#suffix' => '</div>',
);
$form['glossary_page']['glossary_term_class'] = array(
'#type' => 'textfield',
'#title' => t('Term link class'),
'#default_value' => variable_get('glossary_term_class', 'glossary-term'),
'#description' => t('This is the style class that will be used for "acronym," "abbr," and "hovertip" links. It should only be used by those with specific site standards.'),
);
$format_list = filter_formats();
$formats = array(
FILTER_FORMAT_DEFAULT => '-default-',
);
foreach ($format_list as $number => $filter) {
$formats[$number] = $filter->name;
}
$form['glossary_page']['glossary_default_filter'] = array(
'#type' => 'radios',
'#options' => $formats,
'#title' => t('Default input format'),
'#default_value' => variable_get('glossary_default_filter', FILTER_FORMAT_DEFAULT),
'#description' => t('This will be used as the default input format.'),
'#prefix' => '<div class="glossary_radios">',
'#suffix' => '</div>',
);
return system_settings_form($form);
}