function editor_ckeditor_image_plugin_check in Editor 7
Enabled callback for hook_editor_ckeditor_plugins().
Checks if the Caption plugin should be enabled based on the configuration of a text format and editor.
Parameters
object $format: The filter format object for which to check the settings of.
Return value
bool TRUE if the image plugin is enabled, FALSE otherwise.
1 string reference to 'editor_ckeditor_image_plugin_check'
- editor_ckeditor_editor_ckeditor_plugins in modules/
editor_ckeditor/ editor_ckeditor.editor_ckeditor.inc - Implements hook_editor_ckeditor_plugins().
File
- modules/
editor_ckeditor/ editor_ckeditor.module, line 254 - Adds CKEditor as a supported editor.
Code
function editor_ckeditor_image_plugin_check($format) {
// Automatically enable caption support if the DrupalImage button is enabled.
foreach ($format->editor_settings['toolbar'] as $row) {
foreach ($row as $button_group) {
if (in_array('DrupalImage', $button_group['items'])) {
return TRUE;
}
}
}
return FALSE;
}