function _codefilter_settings in Code Filter 7
Settings callback for the codefilter filter.
See also
hook_filter_FILTER_settings()
1 string reference to '_codefilter_settings'
- codefilter_filter_info in ./
codefilter.module - Implements hook_filter_info().
File
- ./
codefilter.module, line 220 - Text filter for highlighting PHP source code.
Code
function _codefilter_settings($form, &$form_state, $filter, $format, $defaults) {
$filter->settings += $defaults;
$elements = array();
$elements['nowrap_expand'] = array(
'#type' => 'checkbox',
'#title' => t('Expand code boxes on hover.'),
'#description' => t('By default, code boxes inherit text wrapping from the active theme. With this setting, code boxes will not wrap, but will expand to full width on hover (with Javascript).'),
'#default_value' => $filter->settings['nowrap_expand'],
);
if (module_exists('codefilter_prism')) {
$elements['codefilter_prism'] = array(
'#type' => 'checkbox',
'#title' => t('Prism Library Support'),
'#description' => t('Enable code styling using the <a href="http://prismjs.com/">Prism library</a> (requires Javascript). To enable highlighting, download the prism.js and prism.js and add them to your site\'s libraries folder.'),
'#default_value' => $filter->settings['codefilter_prism'],
);
}
return $elements;
}