function _pathologic_get_real_settings_source in Pathologic 7.3
Get the "real" settings_source value for a format.
We can't trust the settings_source setting because, on existing formats, it will be set to 'global' (the default value) when actually we want it to use the pre-existing settings, which we now call the 'local' settings. So let's get the settings as they are in {filter} without pre-processing. AFAICT, there's no API function to do this.
Parameters
$format_name: The machine name of the format.
Return value
Either "global" or "local" as appropriate.
2 calls to _pathologic_get_real_settings_source()
- _pathologic_filter in ./
pathologic.module - Pathologic filter callback.
- _pathologic_settings in ./
pathologic.module - Settings callback for Pathologic.
File
- ./
pathologic.module, line 518 - Pathologic text filter for Drupal.
Code
function _pathologic_get_real_settings_source($format_name) {
$orig_settings = db_select('filter', 'f')
->fields('f', array(
'settings',
))
->condition('format', $format_name)
->condition('name', 'pathologic')
->execute()
->fetchField();
if ($orig_settings) {
$orig_settings = unserialize($orig_settings);
return isset($orig_settings['settings_source']) ? $orig_settings['settings_source'] : 'local';
}
else {
return 'global';
}
}