class YamlFormDialogHelper in YAML Form 8
Helper class for dialog methods.
Hierarchy
- class \Drupal\yamlform\Utility\YamlFormDialogHelper
Expanded class hierarchy of YamlFormDialogHelper
11 files declare their use of YamlFormDialogHelper
- yamlform.theme.inc in includes/
yamlform.theme.inc - Preprocessors and helper functions to make theming easier.
- YamlFormEntityHandlersForm.php in src/
YamlFormEntityHandlersForm.php - YamlFormEntityListBuilder.php in src/
YamlFormEntityListBuilder.php - YamlFormPluginHandlerController.php in src/
Controller/ YamlFormPluginHandlerController.php - YamlFormSubmissionListBuilder.php in src/
YamlFormSubmissionListBuilder.php
File
- src/
Utility/ YamlFormDialogHelper.php, line 10
Namespace
Drupal\yamlform\UtilityView source
class YamlFormDialogHelper {
/**
* Get modal dialog attributes.
*
* @param int $width
* Width of the modal dialog.
* @param array $class
* Additional class names to be included in the dialog's attributes.
*
* @return array
* Modal dialog attributes.
*/
public static function getModalDialogAttributes($width = 800, array $class = []) {
if (\Drupal::config('yamlform.settings')
->get('ui.dialog_disabled')) {
return $class ? [
'class' => $class,
] : [];
}
else {
$class[] = 'use-ajax';
return [
'class' => $class,
'data-dialog-type' => 'modal',
'data-dialog-options' => Json::encode([
'width' => $width,
]),
];
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
YamlFormDialogHelper:: |
public static | function | Get modal dialog attributes. |