public static function ContentSyncDialogHelper::attachLibraries in Content Synchronization 8
Same name and namespace in other branches
- 8.2 src/Utility/ContentSyncDialogHelper.php \Drupal\content_sync\Utility\ContentSyncDialogHelper::attachLibraries()
- 3.0.x src/Utility/ContentSyncDialogHelper.php \Drupal\content_sync\Utility\ContentSyncDialogHelper::attachLibraries()
Attach libraries required by (modal) dialogs.
Parameters
array $build: A render array.
File
- src/
Utility/ ContentSyncDialogHelper.php, line 61
Class
- ContentSyncDialogHelper
- Helper class for dialog methods.
Namespace
Drupal\content_sync\UtilityCode
public static function attachLibraries(array &$build) {
$build['#attached']['library'][] = 'content_sync/content_sync.admin.dialog';
// @see \Drupal\content_sync\Element\content_syncHtmlEditor::preRendercontent_syncHtmlEditor
if (\Drupal::moduleHandler()
->moduleExists('imce') && \Drupal\imce\Imce::access()) {
$element['#attached']['library'][] = 'imce/drupal.imce.ckeditor';
$element['#attached']['drupalSettings']['content_sync']['html_editor']['ImceImageIcon'] = file_create_url(drupal_get_path('module', 'imce') . '/js/plugins/ckeditor/icons/imceimage.png');
}
}