function webform_icheck_webform_admin_third_party_settings_form_alter in Webform 8.5
Same name and namespace in other branches
- 6.x modules/webform_icheck/webform_icheck.module \webform_icheck_webform_admin_third_party_settings_form_alter()
Implements hook_webform_admin_third_party_settings_form_alter().
File
- modules/
webform_icheck/ webform_icheck.module, line 105 - Provides support for highly customizable checkboxes and radio buttons.
Code
function webform_icheck_webform_admin_third_party_settings_form_alter(&$form, FormStateInterface $form_state) {
/** @var \Drupal\webform\WebformThirdPartySettingsManagerInterface $third_party_settings_manager */
$third_party_settings_manager = \Drupal::service('webform.third_party_settings_manager');
$default_icheck = $third_party_settings_manager
->getThirdPartySetting('webform_icheck', 'default_icheck');
// iCheck.
$form['third_party_settings']['webform_icheck'] = [
'#type' => 'details',
'#title' => t('iCheck'),
'#open' => TRUE,
];
$form['third_party_settings']['webform_icheck']['default_icheck'] = [
'#type' => 'select',
'#title' => t('Enhance checkboxes/radio buttons using iCheck'),
'#description' => t('If set, all checkboxes/radio buttons with be enhanced using jQuery <a href=":href">iCheck</a> boxes.', [
':href' => 'http://icheck.fronteed.com/',
]),
'#empty_option' => t('- Default -'),
'#options' => _webform_icheck_get_options(),
'#default_value' => $default_icheck,
];
}