function Ckeditor5ReadOnlyModeHooks::formNodePageFormAlter

Implements hook_form_FORM_ID_alter().

File

core/modules/ckeditor5/tests/modules/ckeditor5_read_only_mode/src/Hook/Ckeditor5ReadOnlyModeHooks.php, line 18

Class

Ckeditor5ReadOnlyModeHooks
Hook implementations for ckeditor5_read_only_mode.

Namespace

Drupal\ckeditor5_read_only_mode\Hook

Code

public function formNodePageFormAlter(array &$form, FormStateInterface $form_state, string $form_id) : void {
    $form['body']['#disabled'] = \Drupal::state()->get('ckeditor5_read_only_mode_body_enabled', FALSE);
    $form['field_second_ckeditor5_field']['#disabled'] = \Drupal::state()->get('ckeditor5_read_only_mode_second_ckeditor5_field_enabled', FALSE);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.