You are here

function _entity_embed_entity_embed_js_settings in Entity Embed 7.3

Implements callback_filter_js_settings().

Entity Embed JS settings callback: return settings for JavaScript.

1 string reference to '_entity_embed_entity_embed_js_settings'
entity_embed_filter_info in ./entity_embed.module
Implements hook_filter_info().

File

./entity_embed.module, line 456
Provides a CKEditor plugin and text filter for embedding and rendering entities.

Code

function _entity_embed_entity_embed_js_settings($filter, $format) {

  // Add user-defined buttons.
  $embed_buttons = entity_embed_embed_button_load_all();
  $buttons = array();
  foreach ($embed_buttons as $embed_button) {
    $buttons[$embed_button->name] = array(
      'id' => check_plain($embed_button->name),
      'name' => check_plain($embed_button->admin_title),
      'label' => check_plain($embed_button->admin_title),
      'entity_type' => check_plain($embed_button->entity_type),
      'image' => check_plain(_entity_embed_button_image($embed_button->button_icon_fid)),
    );
  }
  return array(
    'DrupalEntity_dialogTitleAdd' => t('Insert entity'),
    'DrupalEntity_dialogTitleEdit' => t('Edit entity'),
    'DrupalEntity_buttons' => $buttons,
  );
}