function dialog_library_alter in Dialog 7.2
Implements hook_library_alter().
File
- ./
dialog.module, line 160 - Provides an API for opening content in a dialog.
Code
function dialog_library_alter(&$libraries, $module) {
// Replace the default implementation of misc/ajax.js.
if ($module == 'system' && isset($libraries['drupal.ajax'])) {
$path = 'misc/ajax.js';
unset($libraries['drupal.ajax']['js'][$path]);
$libraries['drupal.ajax']['js'][drupal_get_path('module', 'dialog') . '/misc/ajax.js'] = array(
'group' => JS_LIBRARY,
'weight' => 2,
);
}
global $theme;
// Alter libraries on behalf of bartik.theme.
if ($theme == 'bartik') {
// Replace the default dialog theme CSS with custom CSS for bartik.theme.
if ($module == 'dialog' && isset($libraries['drupal.dialog'])) {
$path = drupal_get_path('module', 'dialog') . '/js/dialog/dialog.theme.css';
unset($libraries['drupal.dialog']['css'][$path]);
$libraries['drupal.dialog']['dependencies'][] = array(
'dialog',
'bartik.drupal.dialog',
);
}
}
// Alter libraries on behalf of seven.theme.
if ($theme == '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(
'dialog',
'seven.jquery.ui',
);
}
// Remove the default dialog styling.
if ($module == 'system' && isset($libraries['ui.dialog'])) {
$path = 'misc/ui/jquery.ui.dialog.css';
unset($libraries['ui.dialog']['css'][$path]);
}
// Replace the default dialog theme CSS with custom CSS for seven.theme.
if ($module == 'dialog' && isset($libraries['drupal.dialog'])) {
$path = drupal_get_path('module', 'dialog') . '/js/dialog/dialog.theme.css';
unset($libraries['drupal.dialog']['css'][$path]);
$libraries['drupal.dialog']['dependencies'][] = array(
'dialog',
'seven.drupal.dialog',
);
}
// Add custom styling for CKEditor dialogs.
if ($module == 'editor_ckeditor' && isset($libraries['ckeditor'])) {
$libraries['ckeditor']['dependencies'][] = array(
'dialog',
'seven.ckeditor-dialog',
);
}
}
// Require the dialog library when quick editing.
if ($module == 'quickedit' && isset($libraries['quickedit'])) {
$libraries['quickedit']['dependencies'][] = array(
'dialog',
'drupal.dialog',
);
}
}