function ckeditor4to5upgrade_plugin_test_ckeditor4to5upgrade_plugin_info_alter
Same name in other branches
- 9 core/modules/ckeditor5/tests/modules/ckeditor4to5upgrade_plugin_test/ckeditor4to5upgrade_plugin_test.module \ckeditor4to5upgrade_plugin_test_ckeditor4to5upgrade_plugin_info_alter()
- 11.x core/modules/ckeditor5/tests/modules/ckeditor4to5upgrade_plugin_test/ckeditor4to5upgrade_plugin_test.module \ckeditor4to5upgrade_plugin_test_ckeditor4to5upgrade_plugin_info_alter()
Implements hook_ckeditor4to5upgrade_plugin_info_alter().
File
-
core/
modules/ ckeditor5/ tests/ modules/ ckeditor4to5upgrade_plugin_test/ ckeditor4to5upgrade_plugin_test.module, line 13
Code
function ckeditor4to5upgrade_plugin_test_ckeditor4to5upgrade_plugin_info_alter(array &$plugin_definitions) : void {
switch (\Drupal::state()->get('ckeditor4to5upgrade_plugin_test')) {
case 'duplicate_button':
$plugin_definitions['foo'] = array_intersect_key($plugin_definitions['core'], [
'cke4_buttons' => TRUE,
]);
break;
case 'duplicate_plugin_settings':
$plugin_definitions['foo'] = array_intersect_key($plugin_definitions['core'], [
'cke4_plugin_settings' => TRUE,
]);
break;
case 'duplicate_subset':
$plugin_definitions['foo'] = array_intersect_key($plugin_definitions['core'], [
'cke5_plugin_elements_subset_configuration' => TRUE,
]);
break;
case 'lying_button':
$plugin_definitions['foo'] = [
'cke4_buttons' => [
'foo',
],
'class' => $plugin_definitions['core']['class'],
];
break;
case 'lying_plugin_settings':
$plugin_definitions['foo'] = [
'cke4_plugin_settings' => [
'foo',
],
'class' => $plugin_definitions['core']['class'],
];
break;
case 'lying_subset':
$plugin_definitions['foo'] = [
'cke5_plugin_elements_subset_configuration' => [
'foo',
],
'class' => $plugin_definitions['core']['class'],
];
break;
default:
throw new \LogicException();
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.