function _entity_embed_button_is_enabled in Entity Embed 7.2
Same name and namespace in other branches
- 7.3 entity_embed.module \_entity_embed_button_is_enabled()
- 7 entity_embed.module \_entity_embed_button_is_enabled()
Checks whether or not the embed button is enabled for given text format.
Returns allowed if the editor toolbar contains the embed button and neutral otherwise.
Parameters
$filter_format: The filter format to which this dialog corresponds.
$embed_button: The embed button to which this dialog corresponds.
Return value
boolean The access result.
1 string reference to '_entity_embed_button_is_enabled'
- entity_embed_menu in ./
entity_embed.module - Implements hook_menu().
File
- ./
entity_embed.module, line 309 - Provides a CKEditor plugin and text filter for embedding and rendering entities.
Code
function _entity_embed_button_is_enabled($filter_format, $embed_button) {
module_load_include('inc', 'ckeditor', 'includes/ckeditor.lib');
$button_name = $embed_button->name;
$profile = ckeditor_get_profile($filter_format->format);
$settings = $profile->settings;
if (strpos($settings['toolbar'], "'" . $button_name . "'")) {
return TRUE;
}
return FALSE;
}