You are here

public static function WebformDialogHelper::attachLibraries in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Utility/WebformDialogHelper.php \Drupal\webform\Utility\WebformDialogHelper::attachLibraries()

Attach libraries required by (modal) dialogs.

Parameters

array $build: A render array.

19 calls to WebformDialogHelper::attachLibraries()
template_preprocess_webform_submission_information in includes/webform.theme.template.inc
Prepares variables for webform submission information template.
WebformAccessGroupForm::actions in modules/webform_access/src/WebformAccessGroupForm.php
Returns an array of supported actions for the current entity form.
WebformAccessTypeForm::actions in modules/webform_access/src/WebformAccessTypeForm.php
Returns an array of supported actions for the current entity form.
WebformActions::processWebformActions in src/Element/WebformActions.php
Processes a form actions container element.
WebformDevelEntityFormApiExportForm::buildForm in modules/webform_devel/src/Form/WebformDevelEntityFormApiExportForm.php
Form constructor.

... See full list

File

src/Utility/WebformDialogHelper.php, line 62

Class

WebformDialogHelper
Helper class for modal and off-canvas dialog methods.

Namespace

Drupal\webform\Utility

Code

public static function attachLibraries(array &$build) {
  $build['#attached']['library'][] = 'webform/webform.admin.dialog';
  if (static::useOffCanvas()) {
    $build['#attached']['library'][] = 'webform/webform.admin.off_canvas';
  }

  // @see \Drupal\webform\Element\WebformHtmlEditor::preRenderWebformHtmlEditor
  if (\Drupal::moduleHandler()
    ->moduleExists('imce') && \Drupal\imce\Imce::access()) {
    $build['#attached']['library'][] = 'imce/drupal.imce.ckeditor';
    $build['#attached']['drupalSettings']['webform']['html_editor']['ImceImageIcon'] = file_create_url(drupal_get_path('module', 'imce') . '/js/plugins/ckeditor/icons/imceimage.png');
  }
}