function _geshifilter_update_6001_brackets_to_tag_styles in GeSHi Filter for syntax highlighting 6
Helper function for updating the old geshifilter_brackets variables to geshifilter_tag_styles variables.
Parameters
$format NULL (for global variable) or input format id.:
1 call to _geshifilter_update_6001_brackets_to_tag_styles()
- geshifilter_update_6001 in ./
geshifilter.install - Implementation of hook_update_N().
File
- ./
geshifilter.install, line 61 - Installation and uninstallation functions for the GeSHi filter.
Code
function _geshifilter_update_6001_brackets_to_tag_styles($format) {
// Make $format a suffix for usage in variable name.
$format = isset($format) ? "_{$format}" : '';
// Try to fetch the variable value and convert it if found.
$geshifilter_brackets = variable_get('geshifilter_brackets' . $format, NULL);
if (isset($geshifilter_brackets)) {
switch ($geshifilter_brackets) {
case GESHIFILTER_BRACKETS_ANGLE:
case GESHIFILTER_BRACKETS_SQUARE:
variable_set('geshifilter_tag_styles' . $format, array(
$geshifilter_brackets => $geshifilter_brackets,
));
break;
case GESHIFILTER_BRACKETS_BOTH:
variable_set('geshifilter_tag_styles' . $format, array(
GESHIFILTER_BRACKETS_ANGLE => GESHIFILTER_BRACKETS_ANGLE,
GESHIFILTER_BRACKETS_SQUARE => GESHIFILTER_BRACKETS_SQUARE,
));
break;
}
// Remove old variable.
variable_del('geshifilter_brackets' . $format);
}
}