Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save colepacak/0aa2d14d9d7932653222ee8ca9abd520 to your computer and use it in GitHub Desktop.
Save colepacak/0aa2d14d9d7932653222ee8ca9abd520 to your computer and use it in GitHub Desktop.
ckeditor - Remove call to media_browser_js
diff --git a/includes/ckeditor.lib.inc b/includes/ckeditor.lib.inc
index e2395f3..6a93b4b 100644
--- a/includes/ckeditor.lib.inc
+++ b/includes/ckeditor.lib.inc
@@ -889,14 +889,8 @@ function ckeditor_profile_settings_compile($global_profile, $profile) {
$settings['loadPlugins'] = ckeditor_plugins_render($conf['loadPlugins']);
if (array_key_exists('media', $settings['loadPlugins']) && module_exists('media')) {
- module_load_include('inc', 'media', 'includes/media.browser');
- $javascript = media_browser_js();
- foreach ($javascript as $key => $definitions) {
- foreach ($definitions as $definition) {
- $function = 'drupal_add_' . $key;
- call_user_func_array($function, $definition);
- }
- }
+ drupal_add_library('media', 'media_browser');
+ drupal_add_library('media', 'media_browser_settings');
drupal_add_js(drupal_get_path('module', 'ckeditor') . '/plugins/media/library.js', array('scope' => 'footer', 'weight' => -20));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment