You are here

function eck_form_system_themes_admin_form_alter in Entity Construction Kit (ECK) 8

Implements hook_form_FORM_ID_alter().

Alters the theme form to use the admin theme on eck editing.

See also

eck_form_system_themes_admin_form_submit()

File

./eck.module, line 300
Contains hook implementations.

Code

function eck_form_system_themes_admin_form_alter(&$form, FormStateInterface $form_state, $form_id) {
  $form['admin_theme']['eck_use_admin_theme'] = [
    '#type' => 'checkbox',
    '#title' => t('Use the administration theme when editing or creating ECK entities'),
    '#description' => t('Control which roles can "View the administration theme" on the <a href=":permissions">Permissions page</a>.', [
      ':permissions' => Url::fromRoute('user.admin_permissions')
        ->toString(),
    ]),
    '#default_value' => \Drupal::configFactory()
      ->getEditable('eck.settings')
      ->get('use_admin_theme'),
  ];
  $form['#submit'][] = 'eck_form_system_themes_admin_form_submit';
}