You are here

function entity_embed_library_alter in Entity Embed 7

Implements hook_library_alter().

File

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

Code

function entity_embed_library_alter(&$libraries, $module) {

  // Alter libraries on behalf of seven.theme.
  if (drupal_theme_access('seven')) {

    // Replace the default jQuery UI theme CSS with custom CSS for seven.theme.
    if ($module == 'system' && isset($libraries['ui'])) {
      $path = 'misc/ui/jquery.ui.theme.css';
      unset($libraries['ui']['css'][$path]);
      $libraries['ui']['dependencies'][] = array(
        'entity_embed',
        'seven.jquery.ui',
      );
    }

    // Replace the default dialog theme CSS with custom CSS for seven.theme.
    if ($module == 'entity_embed' && isset($libraries['drupal.dialog'])) {
      $path = drupal_get_path('module', 'entity_embed') . '/js/dialog/dialog.theme.css';
      unset($libraries['drupal.dialog']['css'][$path]);
      $libraries['drupal.dialog']['dependencies'][] = array(
        'entity_embed',
        'seven.drupal.dialog',
      );
    }
  }
}