public function GauthSettingsForm::buildForm in Google Auth 8
Define the form used for ContentEntityExample settings.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: An associative array containing the current state of the form.
Return value
array Form definition array.
Overrides FormInterface::buildForm
File
- src/
Form/ GauthSettingsForm.php, line 50
Class
- GauthSettingsForm
- Class ContentEntityExampleSettingsForm.
Namespace
Drupal\gauth\FormCode
public function buildForm(array $form, FormStateInterface $form_state) {
$form['gauth_settings']['#markup'] = 'Settings form for Gauth. Manage field settings here.<br/><br/>';
$form['gauth_intro']['#markup'] = "Gauth tries to detect all supported services and scopes from the library installed. <br/> If you don't find your desired class/service listed or you have updated library you need to flush cache or hit 'Scan library' button, to see them here.<br/>";
$form['submit'] = [
'#type' => 'submit',
'#value' => t('Scan Library'),
];
$names = \Drupal::config('gauth.google_api_services')
->get('gauth_google_api_services');
$form['gauth_services'] = [
'#theme' => 'item_list',
'#list_type' => 'ol',
'#title' => 'The supported services are:',
'#items' => $names,
];
return $form;
}